Merge pull request #24616 from ashithasantosh/clang_tidy_fix

Fix compilation errors after clang-tidy upgrade.
pull/24659/head
Ashitha Santhosh 4 years ago committed by GitHub
commit d8d1090b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      BUILD
  2. 4
      BUILD.gn
  3. 4
      build_autogenerated.yaml
  4. 8
      gRPC-C++.podspec
  5. 8
      gRPC-Core.podspec
  6. 4
      grpc.gemspec
  7. 4
      package.xml
  8. 2
      src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
  9. 9
      src/core/lib/security/authorization/mock_cel/cel_expression.h
  10. 12
      src/core/lib/security/authorization/mock_cel/evaluator_core.h
  11. 19
      src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
  12. 50
      src/core/lib/security/authorization/mock_cel/statusor.h
  13. 4
      tools/doxygen/Doxyfile.c++.internal
  14. 4
      tools/doxygen/Doxyfile.core.internal

@ -1889,12 +1889,11 @@ grpc_cc_library(
name = "grpc_mock_cel",
hdrs = [
"src/core/lib/security/authorization/mock_cel/activation.h",
#"src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h",
#"src/core/lib/security/authorization/mock_cel/cel_expression.h",
"src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h",
"src/core/lib/security/authorization/mock_cel/cel_expression.h",
"src/core/lib/security/authorization/mock_cel/cel_value.h",
#"src/core/lib/security/authorization/mock_cel/evaluator_core.h",
#"src/core/lib/security/authorization/mock_cel/flat_expr_builder.h",
#"src/core/lib/security/authorization/mock_cel/statusor.h",
"src/core/lib/security/authorization/mock_cel/evaluator_core.h",
"src/core/lib/security/authorization/mock_cel/flat_expr_builder.h",
],
language = "c++",
deps = [

@ -984,7 +984,11 @@ config("grpc_config") {
"src/core/lib/security/authorization/evaluate_args.cc",
"src/core/lib/security/authorization/evaluate_args.h",
"src/core/lib/security/authorization/mock_cel/activation.h",
"src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h",
"src/core/lib/security/authorization/mock_cel/cel_expression.h",
"src/core/lib/security/authorization/mock_cel/cel_value.h",
"src/core/lib/security/authorization/mock_cel/evaluator_core.h",
"src/core/lib/security/authorization/mock_cel/flat_expr_builder.h",
"src/core/lib/security/context/security_context.cc",
"src/core/lib/security/context/security_context.h",
"src/core/lib/security/credentials/alts/alts_credentials.cc",

@ -755,7 +755,11 @@ libs:
- src/core/lib/security/authorization/authorization_engine.h
- src/core/lib/security/authorization/evaluate_args.h
- src/core/lib/security/authorization/mock_cel/activation.h
- src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h
- src/core/lib/security/authorization/mock_cel/cel_expression.h
- src/core/lib/security/authorization/mock_cel/cel_value.h
- src/core/lib/security/authorization/mock_cel/evaluator_core.h
- src/core/lib/security/authorization/mock_cel/flat_expr_builder.h
- src/core/lib/security/context/security_context.h
- src/core/lib/security/credentials/alts/alts_credentials.h
- src/core/lib/security/credentials/alts/check_gcp_environment.h

@ -600,7 +600,11 @@ Pod::Spec.new do |s|
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
'src/core/lib/security/authorization/mock_cel/cel_value.h',
'src/core/lib/security/authorization/mock_cel/evaluator_core.h',
'src/core/lib/security/authorization/mock_cel/flat_expr_builder.h',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.h',
'src/core/lib/security/credentials/alts/check_gcp_environment.h',
@ -1204,7 +1208,11 @@ Pod::Spec.new do |s|
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
'src/core/lib/security/authorization/mock_cel/cel_value.h',
'src/core/lib/security/authorization/mock_cel/evaluator_core.h',
'src/core/lib/security/authorization/mock_cel/flat_expr_builder.h',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.h',
'src/core/lib/security/credentials/alts/check_gcp_environment.h',

@ -1040,7 +1040,11 @@ Pod::Spec.new do |s|
'src/core/lib/security/authorization/evaluate_args.cc',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
'src/core/lib/security/authorization/mock_cel/cel_value.h',
'src/core/lib/security/authorization/mock_cel/evaluator_core.h',
'src/core/lib/security/authorization/mock_cel/flat_expr_builder.h',
'src/core/lib/security/context/security_context.cc',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.cc',
@ -1733,7 +1737,11 @@ Pod::Spec.new do |s|
'src/core/lib/security/authorization/authorization_engine.h',
'src/core/lib/security/authorization/evaluate_args.h',
'src/core/lib/security/authorization/mock_cel/activation.h',
'src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h',
'src/core/lib/security/authorization/mock_cel/cel_expression.h',
'src/core/lib/security/authorization/mock_cel/cel_value.h',
'src/core/lib/security/authorization/mock_cel/evaluator_core.h',
'src/core/lib/security/authorization/mock_cel/flat_expr_builder.h',
'src/core/lib/security/context/security_context.h',
'src/core/lib/security/credentials/alts/alts_credentials.h',
'src/core/lib/security/credentials/alts/check_gcp_environment.h',

@ -957,7 +957,11 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/authorization/evaluate_args.cc )
s.files += %w( src/core/lib/security/authorization/evaluate_args.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/activation.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/cel_expression.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/cel_value.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/evaluator_core.h )
s.files += %w( src/core/lib/security/authorization/mock_cel/flat_expr_builder.h )
s.files += %w( src/core/lib/security/context/security_context.cc )
s.files += %w( src/core/lib/security/context/security_context.h )
s.files += %w( src/core/lib/security/credentials/alts/alts_credentials.cc )

@ -937,7 +937,11 @@
<file baseinstalldir="/" name="src/core/lib/security/authorization/evaluate_args.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/evaluate_args.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/activation.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/cel_expression.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/cel_value.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/evaluator_core.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/authorization/mock_cel/flat_expr_builder.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/context/security_context.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/security/credentials/alts/alts_credentials.cc" role="src" />

@ -33,7 +33,7 @@ struct InterpreterOptions {
bool short_circuiting = true;
};
std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder(
inline std::unique_ptr<CelExpressionBuilder> CreateCelExpressionBuilder(
const InterpreterOptions& options) {
return absl::make_unique<FlatExprBuilder>();
}

@ -20,10 +20,11 @@
#include <memory>
#include <vector>
#include "absl/status/statusor.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "src/core/lib/security/authorization/mock_cel/activation.h"
#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
#include "src/core/lib/security/authorization/mock_cel/statusor.h"
namespace grpc_core {
namespace mock_cel {
@ -38,7 +39,7 @@ class CelExpression {
// Evaluates expression and returns value.
// activation contains bindings from parameter names to values
virtual StatusOr<CelValue> Evaluate(
virtual absl::StatusOr<CelValue> Evaluate(
const BaseActivation& activation) const = 0;
};
@ -52,11 +53,11 @@ class CelExpressionBuilder {
// Creates CelExpression object from AST tree.
// expr specifies root of AST tree
virtual StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
virtual absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
const google_api_expr_v1alpha1_Expr* expr,
const google_api_expr_v1alpha1_SourceInfo* source_info) const = 0;
virtual StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
virtual absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
const google_api_expr_v1alpha1_Expr* expr,
const google_api_expr_v1alpha1_SourceInfo* source_info,
std::vector<absl::Status>* warnings) const = 0;

@ -21,11 +21,12 @@
#include <set>
#include <vector>
#include "absl/status/statusor.h"
#include "google/api/expr/v1alpha1/syntax.upb.h"
#include "src/core/lib/security/authorization/mock_cel/activation.h"
#include "src/core/lib/security/authorization/mock_cel/cel_expression.h"
#include "src/core/lib/security/authorization/mock_cel/cel_value.h"
#include "src/core/lib/security/authorization/mock_cel/statusor.h"
namespace grpc_core {
namespace mock_cel {
@ -33,13 +34,11 @@ namespace mock_cel {
// This is a temporary stub implementation of CEL APIs.
// Once gRPC imports the CEL library, this file will be removed.
class ExpressionStep {
class ExecutionPath {
public:
virtual ~ExpressionStep() = default;
ExecutionPath() = default;
};
using ExecutionPath = std::vector<std::unique_ptr<const ExpressionStep>>;
// Implementation of the CelExpression that utilizes flattening
// of the expression tree.
class CelExpressionFlatImpl : public CelExpression {
@ -56,7 +55,8 @@ class CelExpressionFlatImpl : public CelExpression {
bool enable_unknown_function_results = false) {}
// Implementation of CelExpression evaluate method.
StatusOr<CelValue> Evaluate(const BaseActivation& activation) const override {
absl::StatusOr<CelValue> Evaluate(
const BaseActivation& activation) const override {
return CelValue::CreateNull();
}
};

@ -33,20 +33,21 @@ class FlatExprBuilder : public CelExpressionBuilder {
public:
FlatExprBuilder() = default;
cel_base::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
const google::api::expr::v1alpha1::Expr* expr,
const google::api::expr::v1alpha1::SourceInfo* source_info)
const override {
absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
const google_api_expr_v1alpha1_Expr* expr,
const google_api_expr_v1alpha1_SourceInfo* source_info) const override {
ExecutionPath path;
return absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0);
return absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0,
std::set<std::string>{});
}
cel_base::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
const google::api::expr::v1alpha1::Expr* expr,
const google::api::expr::v1alpha1::SourceInfo* source_info,
absl::StatusOr<std::unique_ptr<CelExpression>> CreateExpression(
const google_api_expr_v1alpha1_Expr* expr,
const google_api_expr_v1alpha1_SourceInfo* source_info,
std::vector<absl::Status>* warnings) const override {
ExecutionPath path;
return absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0);
return absl::make_unique<CelExpressionFlatImpl>(nullptr, path, 0,
std::set<std::string>{});
}
};

@ -1,50 +0,0 @@
// Copyright 2020 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H
#define GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H
#include <grpc/support/port_platform.h>
#include <memory>
#include "absl/status/status.h"
namespace grpc_core {
namespace mock_cel {
// This is a temporary stub implementation of CEL APIs.
// Once gRPC imports the CEL library, this file will be removed.
template <typename T>
class ABSL_MUST_USE_RESULT StatusOr;
template <typename T>
class StatusOr {
public:
StatusOr() = default;
StatusOr(const T& value) {}
StatusOr(const absl::Status& status) {}
StatusOr(absl::Status&& status) {}
bool ok() const { return true; }
};
} // namespace mock_cel
} // namespace grpc_core
#endif // GRPC_CORE_LIB_SECURITY_AUTHORIZATION_MOCK_CEL_STATUSOR_H

@ -1889,7 +1889,11 @@ src/core/lib/security/authorization/authorization_engine.h \
src/core/lib/security/authorization/evaluate_args.cc \
src/core/lib/security/authorization/evaluate_args.h \
src/core/lib/security/authorization/mock_cel/activation.h \
src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h \
src/core/lib/security/authorization/mock_cel/cel_expression.h \
src/core/lib/security/authorization/mock_cel/cel_value.h \
src/core/lib/security/authorization/mock_cel/evaluator_core.h \
src/core/lib/security/authorization/mock_cel/flat_expr_builder.h \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/context/security_context.h \
src/core/lib/security/credentials/alts/alts_credentials.cc \

@ -1731,7 +1731,11 @@ src/core/lib/security/authorization/authorization_engine.h \
src/core/lib/security/authorization/evaluate_args.cc \
src/core/lib/security/authorization/evaluate_args.h \
src/core/lib/security/authorization/mock_cel/activation.h \
src/core/lib/security/authorization/mock_cel/cel_expr_builder_factory.h \
src/core/lib/security/authorization/mock_cel/cel_expression.h \
src/core/lib/security/authorization/mock_cel/cel_value.h \
src/core/lib/security/authorization/mock_cel/evaluator_core.h \
src/core/lib/security/authorization/mock_cel/flat_expr_builder.h \
src/core/lib/security/context/security_context.cc \
src/core/lib/security/context/security_context.h \
src/core/lib/security/credentials/alts/alts_credentials.cc \

Loading…
Cancel
Save