• 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_CEL_EXPR_BUILDER_FACTORY_H
16 #define GRPC_SRC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
17 
18 #include <grpc/support/port_platform.h>
19 
20 #include <memory>
21 
22 #include "src/core/lib/security/authorization/mock_cel/cel_expression.h"
23 #include "src/core/lib/security/authorization/mock_cel/flat_expr_builder.h"
24 
25 namespace grpc_core {
26 namespace mock_cel {
27 
28 // This is a temporary stub implementation of CEL APIs.
29 // Once gRPC imports the CEL library, this file will be removed.
30 
31 struct InterpreterOptions {
32   bool short_circuiting = true;
33 };
34 
CreateCelExpressionBuilder(const InterpreterOptions & options)35 inline std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder(
36     const InterpreterOptions& options) {
37   return std::make_unique<FlatExprBuilder>();
38 }
39 
40 }  // namespace mock_cel
41 }  // namespace grpc_core
42 
43 #endif  // GRPC_SRC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_CEL_EXPR_BUILDER_FACTORY_H
44