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_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
16 #define GRPC_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 
22 #include "src/core/lib/security/authorization/mock_cel/cel_value.h"
23 
24 namespace grpc_core {
25 namespace mock_cel {
26 
27 // Base class for an activation. This is a temporary stub implementation of CEL
28 // APIs. Once gRPC imports the CEL library, this class will be removed.
29 class BaseActivation {
30  public:
31   BaseActivation() = default;
32 
33   // Non-copyable/non-assignable
34   BaseActivation(const BaseActivation&) = delete;
35   BaseActivation& operator=(const BaseActivation&) = delete;
36 };
37 
38 // Instance of Activation class is used by evaluator.
39 // It provides binding between references used in expressions
40 // and actual values. This is a temporary stub implementation of CEL APIs.
41 // Once gRPC imports the CEL library, this class will be removed.
42 class Activation : public BaseActivation {
43  public:
44   Activation() = default;
45 
46   // Non-copyable/non-assignable
47   Activation(const Activation&) = delete;
48   Activation& operator=(const Activation&) = delete;
49 
50   // Insert value into Activation.
InsertValue(absl::string_view name,const CelValue & value)51   void InsertValue(absl::string_view name, const CelValue& value) {}
52 };
53 
54 }  // namespace mock_cel
55 }  // namespace grpc_core
56 
57 #endif  // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_ACTIVATION_H
58