• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GRPC_SRC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
16 #define GRPC_SRC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
17 
18 #include <grpc/support/port_platform.h>
19 
20 #include "absl/strings/string_view.h"
21 #include "src/core/lib/security/authorization/mock_cel/cel_value.h"
22 
23 namespace grpc_core {
24 namespace mock_cel {
25 
26 // Base class for an activation. This is a temporary stub implementation of CEL
27 // APIs. Once gRPC imports the CEL library, this class will be removed.
28 class BaseActivation {
29  public:
30   BaseActivation() = default;
31 
32   // Non-copyable/non-assignable
33   BaseActivation(const BaseActivation&) = delete;
34   BaseActivation& operator=(const BaseActivation&) = delete;
35 };
36 
37 // Instance of Activation class is used by evaluator.
38 // It provides binding between references used in expressions
39 // and actual values. This is a temporary stub implementation of CEL APIs.
40 // Once gRPC imports the CEL library, this class will be removed.
41 class Activation : public BaseActivation {
42  public:
43   Activation() = default;
44 
45   // Non-copyable/non-assignable
46   Activation(const Activation&) = delete;
47   Activation& operator=(const Activation&) = delete;
48 
49   // Insert value into Activation.
InsertValue(absl::string_view,const CelValue &)50   void InsertValue(absl::string_view /*name*/, const CelValue& /*value*/) {}
51 };
52 
53 }  // namespace mock_cel
54 }  // namespace grpc_core
55 
56 #endif  // GRPC_SRC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
57