[xDS] validate Audience cluster metadata (#37566)

Add validation of the `Audience` cluster metadata type, as per gRFC A83 (https://github.com/grpc/proposal/pull/438).

I had previously changed the metadata to be represented as JSON in #37468.  However, while working on the GCP Authentication filter implementation, I realized that that's not an ideal representation, because it would have required us to validate the JSON on a per-RPC basis, which would be bad for performance.  So I've changed the representation of metadata to be an abstract type, and we now store the `Audience` metadata as a simple string.  I've also moved metadata into its own type with its own validation code, so that in the future we can use it in places other than CDS (many xDS resource types have metadata fields).

While I was at it, I also add some helper functions for validating the `UInt32Value` and `UInt64Value` wrapper protos.

Closes #37566

PiperOrigin-RevId: 668281729
pull/37587/head
Mark D. Roth 3 months ago committed by Copybara-Service
parent 8260e319a4
commit ae5dfa13e8
  1. 10
      BUILD
  2. 71
      CMakeLists.txt
  3. 4
      Makefile
  4. 9
      Package.swift
  5. 30
      build_autogenerated.yaml
  6. 6
      config.m4
  7. 8
      config.w32
  8. 10
      gRPC-C++.podspec
  9. 14
      gRPC-Core.podspec
  10. 9
      grpc.gemspec
  11. 9
      package.xml
  12. 39
      src/core/BUILD
  13. 431
      src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h
  14. 129
      src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c
  15. 33
      src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h
  16. 86
      src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c
  17. 47
      src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h
  18. 20
      src/core/lib/debug/trace_flags.cc
  19. 6
      src/core/lib/debug/trace_flags.h
  20. 24
      src/core/lib/debug/trace_flags.yaml
  21. 24
      src/core/load_balancing/xds/xds_cluster_impl.cc
  22. 8
      src/core/xds/grpc/xds_cluster.cc
  23. 3
      src/core/xds/grpc/xds_cluster.h
  24. 167
      src/core/xds/grpc/xds_cluster_parser.cc
  25. 12
      src/core/xds/grpc/xds_common_types_parser.h
  26. 24
      src/core/xds/grpc/xds_endpoint_parser.cc
  27. 8
      src/core/xds/grpc/xds_http_fault_filter.cc
  28. 10
      src/core/xds/grpc/xds_http_rbac_filter.cc
  29. 30
      src/core/xds/grpc/xds_lb_policy_registry.cc
  30. 17
      src/core/xds/grpc/xds_listener_parser.cc
  31. 62
      src/core/xds/grpc/xds_metadata.cc
  32. 127
      src/core/xds/grpc/xds_metadata.h
  33. 143
      src/core/xds/grpc/xds_metadata_parser.cc
  34. 36
      src/core/xds/grpc/xds_metadata_parser.h
  35. 27
      src/core/xds/grpc/xds_route_config_parser.cc
  36. 8
      src/proto/grpc/testing/xds/v3/BUILD
  37. 45
      src/proto/grpc/testing/xds/v3/gcp_authn.proto
  38. 4
      src/python/grpcio/grpc_core_dependencies.py
  39. 19
      test/core/xds/BUILD
  40. 65
      test/core/xds/xds_cluster_resource_type_test.cc
  41. 7
      test/core/xds/xds_common_types_test.cc
  42. 7
      test/core/xds/xds_endpoint_resource_type_test.cc
  43. 7
      test/core/xds/xds_listener_resource_type_test.cc
  44. 274
      test/core/xds/xds_metadata_test.cc
  45. 7
      test/core/xds/xds_route_config_resource_type_test.cc
  46. 9
      tools/doxygen/Doxyfile.c++.internal
  47. 9
      tools/doxygen/Doxyfile.core.internal
  48. 24
      tools/run_tests/generated/tests.json

10
BUILD

@ -5018,6 +5018,16 @@ grpc_upb_proto_reflection_library(
deps = ["@envoy_api//envoy/extensions/filters/http/fault/v3:pkg"],
)
grpc_upb_proto_library(
name = "envoy_extensions_filters_http_gcp_authn_upb",
deps = ["@envoy_api//envoy/extensions/filters/http/gcp_authn/v3:pkg"],
)
grpc_upb_proto_reflection_library(
name = "envoy_extensions_filters_http_gcp_authn_upbdefs",
deps = ["@envoy_api//envoy/extensions/filters/http/gcp_authn/v3:pkg"],
)
grpc_upb_proto_library(
name = "envoy_extensions_filters_http_rbac_upb",
deps = ["@envoy_api//envoy/extensions/filters/http/rbac/v3:pkg"],

71
CMakeLists.txt generated

@ -784,6 +784,9 @@ protobuf_generate_grpc_cpp_with_import_path_correction(
protobuf_generate_grpc_cpp_with_import_path_correction(
src/proto/grpc/testing/xds/v3/fault_common.proto src/proto/grpc/testing/xds/v3/fault_common.proto
)
protobuf_generate_grpc_cpp_with_import_path_correction(
src/proto/grpc/testing/xds/v3/gcp_authn.proto src/proto/grpc/testing/xds/v3/gcp_authn.proto
)
protobuf_generate_grpc_cpp_with_import_path_correction(
src/proto/grpc/testing/xds/v3/health_check.proto src/proto/grpc/testing/xds/v3/health_check.proto
)
@ -1592,6 +1595,7 @@ if(gRPC_BUILD_TESTS)
add_dependencies(buildtests_cxx xds_http_filters_test)
add_dependencies(buildtests_cxx xds_lb_policy_registry_test)
add_dependencies(buildtests_cxx xds_listener_resource_type_test)
add_dependencies(buildtests_cxx xds_metadata_test)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx xds_outlier_detection_end2end_test)
endif()
@ -1986,6 +1990,7 @@ add_library(grpc
src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c
src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c
src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c
src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c
@ -2151,6 +2156,7 @@ add_library(grpc
src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c
@ -2643,6 +2649,8 @@ add_library(grpc
src/core/xds/grpc/xds_lb_policy_registry.cc
src/core/xds/grpc/xds_listener.cc
src/core/xds/grpc/xds_listener_parser.cc
src/core/xds/grpc/xds_metadata.cc
src/core/xds/grpc/xds_metadata_parser.cc
src/core/xds/grpc/xds_route_config.cc
src/core/xds/grpc/xds_route_config_parser.cc
src/core/xds/grpc/xds_routing.cc
@ -34121,6 +34129,10 @@ add_executable(xds_cluster_resource_type_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/extension.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/health_check.pb.h
@ -35955,6 +35967,65 @@ target_link_libraries(xds_listener_resource_type_test
)
endif()
if(gRPC_BUILD_TESTS)
add_executable(xds_metadata_test
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/base.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/gcp_authn.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/percent.grpc.pb.h
src/cpp/client/global_callback_hook.cc
src/cpp/util/status.cc
test/core/xds/xds_metadata_test.cc
)
if(WIN32 AND MSVC)
if(BUILD_SHARED_LIBS)
target_compile_definitions(xds_metadata_test
PRIVATE
"GPR_DLL_IMPORTS"
"GRPC_DLL_IMPORTS"
)
endif()
endif()
target_compile_features(xds_metadata_test PUBLIC cxx_std_14)
target_include_directories(xds_metadata_test
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/include
${_gRPC_ADDRESS_SORTING_INCLUDE_DIR}
${_gRPC_RE2_INCLUDE_DIR}
${_gRPC_SSL_INCLUDE_DIR}
${_gRPC_UPB_GENERATED_DIR}
${_gRPC_UPB_GRPC_GENERATED_DIR}
${_gRPC_UPB_INCLUDE_DIR}
${_gRPC_XXHASH_INCLUDE_DIR}
${_gRPC_ZLIB_INCLUDE_DIR}
third_party/googletest/googletest/include
third_party/googletest/googletest
third_party/googletest/googlemock/include
third_party/googletest/googlemock
${_gRPC_PROTO_GENS_DIR}
)
target_link_libraries(xds_metadata_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::absl_check
absl::absl_log
${_gRPC_PROTOBUF_LIBRARIES}
grpc_test_util
)
endif()
if(gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)

4
Makefile generated

@ -804,6 +804,7 @@ LIBGRPC_SRC = \
src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c \
@ -969,6 +970,7 @@ LIBGRPC_SRC = \
src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c \
@ -1506,6 +1508,8 @@ LIBGRPC_SRC = \
src/core/xds/grpc/xds_lb_policy_registry.cc \
src/core/xds/grpc/xds_listener.cc \
src/core/xds/grpc/xds_listener_parser.cc \
src/core/xds/grpc/xds_metadata.cc \
src/core/xds/grpc/xds_metadata_parser.cc \
src/core/xds/grpc/xds_route_config.cc \
src/core/xds/grpc/xds_route_config_parser.cc \
src/core/xds/grpc/xds_routing.cc \

9
Package.swift generated

@ -465,6 +465,9 @@ let package = Package(
"src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h",
"src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c",
"src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h",
"src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h",
"src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c",
"src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h",
"src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h",
"src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c",
"src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h",
@ -892,6 +895,8 @@ let package = Package(
"src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h",
"src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c",
@ -2007,6 +2012,10 @@ let package = Package(
"src/core/xds/grpc/xds_listener.h",
"src/core/xds/grpc/xds_listener_parser.cc",
"src/core/xds/grpc/xds_listener_parser.h",
"src/core/xds/grpc/xds_metadata.cc",
"src/core/xds/grpc/xds_metadata.h",
"src/core/xds/grpc/xds_metadata_parser.cc",
"src/core/xds/grpc/xds_metadata_parser.h",
"src/core/xds/grpc/xds_route_config.cc",
"src/core/xds/grpc/xds_route_config.h",
"src/core/xds/grpc/xds_route_config_parser.cc",

@ -433,6 +433,8 @@ libs:
- src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h
- src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h
@ -695,6 +697,7 @@ libs:
- src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
- src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.h
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h
@ -1245,6 +1248,8 @@ libs:
- src/core/xds/grpc/xds_lb_policy_registry.h
- src/core/xds/grpc/xds_listener.h
- src/core/xds/grpc/xds_listener_parser.h
- src/core/xds/grpc/xds_metadata.h
- src/core/xds/grpc/xds_metadata_parser.h
- src/core/xds/grpc/xds_route_config.h
- src/core/xds/grpc/xds_route_config_parser.h
- src/core/xds/grpc/xds_routing.h
@ -1400,6 +1405,7 @@ libs:
- src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c
- src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c
- src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c
- src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c
- src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c
- src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c
- src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c
@ -1565,6 +1571,7 @@ libs:
- src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
- src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c
- src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c
@ -2057,6 +2064,8 @@ libs:
- src/core/xds/grpc/xds_lb_policy_registry.cc
- src/core/xds/grpc/xds_listener.cc
- src/core/xds/grpc/xds_listener_parser.cc
- src/core/xds/grpc/xds_metadata.cc
- src/core/xds/grpc/xds_metadata_parser.cc
- src/core/xds/grpc/xds_route_config.cc
- src/core/xds/grpc/xds_route_config_parser.cc
- src/core/xds/grpc/xds_routing.cc
@ -21343,6 +21352,7 @@ targets:
- src/proto/grpc/testing/xds/v3/config_source.proto
- src/proto/grpc/testing/xds/v3/endpoint.proto
- src/proto/grpc/testing/xds/v3/extension.proto
- src/proto/grpc/testing/xds/v3/gcp_authn.proto
- src/proto/grpc/testing/xds/v3/health_check.proto
- src/proto/grpc/testing/xds/v3/http_protocol_options.proto
- src/proto/grpc/testing/xds/v3/outlier_detection.proto
@ -21964,6 +21974,26 @@ targets:
- protoc
- grpc_test_util
uses_polling: false
- name: xds_metadata_test
gtest: true
build: test
language: c++
headers:
- test/core/test_util/scoped_env_var.h
src:
- src/proto/grpc/testing/xds/v3/base.proto
- src/proto/grpc/testing/xds/v3/gcp_authn.proto
- src/proto/grpc/testing/xds/v3/percent.proto
- src/cpp/client/global_callback_hook.cc
- src/cpp/util/status.cc
- test/core/xds/xds_metadata_test.cc
deps:
- gtest
- absl/log:absl_check
- absl/log:absl_log
- protobuf
- grpc_test_util
uses_polling: false
- name: xds_outlier_detection_end2end_test
gtest: true
build: test

6
config.m4 generated

@ -179,6 +179,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c \
@ -344,6 +345,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c \
@ -881,6 +883,8 @@ if test "$PHP_GRPC" != "no"; then
src/core/xds/grpc/xds_lb_policy_registry.cc \
src/core/xds/grpc/xds_listener.cc \
src/core/xds/grpc/xds_listener_parser.cc \
src/core/xds/grpc/xds_metadata.cc \
src/core/xds/grpc/xds_metadata_parser.cc \
src/core/xds/grpc/xds_route_config.cc \
src/core/xds/grpc/xds_route_config_parser.cc \
src/core/xds/grpc/xds_routing.cc \
@ -1431,6 +1435,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3)
@ -1487,6 +1492,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3)

8
config.w32 generated

@ -144,6 +144,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-gen\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upb_minitable.c " +
"src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\common\\fault\\v3\\fault.upb_minitable.c " +
"src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\fault\\v3\\fault.upb_minitable.c " +
"src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\gcp_authn\\v3\\gcp_authn.upb_minitable.c " +
"src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\rbac\\v3\\rbac.upb_minitable.c " +
"src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\router\\v3\\router.upb_minitable.c " +
"src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\stateful_session\\v3\\stateful_session.upb_minitable.c " +
@ -309,6 +310,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upbdefs.c " +
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\common\\fault\\v3\\fault.upbdefs.c " +
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\fault\\v3\\fault.upbdefs.c " +
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\gcp_authn\\v3\\gcp_authn.upbdefs.c " +
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\rbac\\v3\\rbac.upbdefs.c " +
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\router\\v3\\router.upbdefs.c " +
"src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\stateful_session\\v3\\stateful_session.upbdefs.c " +
@ -846,6 +848,8 @@ if (PHP_GRPC != "no") {
"src\\core\\xds\\grpc\\xds_lb_policy_registry.cc " +
"src\\core\\xds\\grpc\\xds_listener.cc " +
"src\\core\\xds\\grpc\\xds_listener_parser.cc " +
"src\\core\\xds\\grpc\\xds_metadata.cc " +
"src\\core\\xds\\grpc\\xds_metadata_parser.cc " +
"src\\core\\xds\\grpc\\xds_route_config.cc " +
"src\\core\\xds\\grpc\\xds_route_config_parser.cc " +
"src\\core\\xds\\grpc\\xds_routing.cc " +
@ -1455,6 +1459,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\fault");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\fault\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\gcp_authn");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\gcp_authn\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\rbac");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\rbac\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-gen\\envoy\\extensions\\filters\\http\\router");
@ -1587,6 +1593,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\fault");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\fault\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\gcp_authn");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\gcp_authn\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\rbac");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\rbac\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-gen\\envoy\\extensions\\filters\\http\\router");

10
gRPC-C++.podspec generated

@ -518,6 +518,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h',
@ -780,6 +782,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h',
@ -1355,6 +1358,8 @@ Pod::Spec.new do |s|
'src/core/xds/grpc/xds_lb_policy_registry.h',
'src/core/xds/grpc/xds_listener.h',
'src/core/xds/grpc/xds_listener_parser.h',
'src/core/xds/grpc/xds_metadata.h',
'src/core/xds/grpc/xds_metadata_parser.h',
'src/core/xds/grpc/xds_route_config.h',
'src/core/xds/grpc/xds_route_config_parser.h',
'src/core/xds/grpc/xds_routing.h',
@ -1805,6 +1810,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h',
@ -2067,6 +2074,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h',
@ -2642,6 +2650,8 @@ Pod::Spec.new do |s|
'src/core/xds/grpc/xds_lb_policy_registry.h',
'src/core/xds/grpc/xds_listener.h',
'src/core/xds/grpc/xds_listener_parser.h',
'src/core/xds/grpc/xds_metadata.h',
'src/core/xds/grpc/xds_metadata_parser.h',
'src/core/xds/grpc/xds_route_config.h',
'src/core/xds/grpc/xds_route_config_parser.h',
'src/core/xds/grpc/xds_routing.h',

14
gRPC-Core.podspec generated

@ -585,6 +585,9 @@ Pod::Spec.new do |s|
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h',
@ -1012,6 +1015,8 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
@ -2123,6 +2128,10 @@ Pod::Spec.new do |s|
'src/core/xds/grpc/xds_listener.h',
'src/core/xds/grpc/xds_listener_parser.cc',
'src/core/xds/grpc/xds_listener_parser.h',
'src/core/xds/grpc/xds_metadata.cc',
'src/core/xds/grpc/xds_metadata.h',
'src/core/xds/grpc/xds_metadata_parser.cc',
'src/core/xds/grpc/xds_metadata_parser.h',
'src/core/xds/grpc/xds_route_config.cc',
'src/core/xds/grpc/xds_route_config.h',
'src/core/xds/grpc/xds_route_config_parser.cc',
@ -2585,6 +2594,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h',
'src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb.h',
@ -2847,6 +2858,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.h',
@ -3421,6 +3433,8 @@ Pod::Spec.new do |s|
'src/core/xds/grpc/xds_lb_policy_registry.h',
'src/core/xds/grpc/xds_listener.h',
'src/core/xds/grpc/xds_listener_parser.h',
'src/core/xds/grpc/xds_metadata.h',
'src/core/xds/grpc/xds_metadata_parser.h',
'src/core/xds/grpc/xds_route_config.h',
'src/core/xds/grpc/xds_route_config_parser.h',
'src/core/xds/grpc/xds_routing.h',

9
grpc.gemspec generated

@ -471,6 +471,9 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c )
s.files += %w( src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h )
@ -898,6 +901,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c )
@ -2009,6 +2014,10 @@ Gem::Specification.new do |s|
s.files += %w( src/core/xds/grpc/xds_listener.h )
s.files += %w( src/core/xds/grpc/xds_listener_parser.cc )
s.files += %w( src/core/xds/grpc/xds_listener_parser.h )
s.files += %w( src/core/xds/grpc/xds_metadata.cc )
s.files += %w( src/core/xds/grpc/xds_metadata.h )
s.files += %w( src/core/xds/grpc/xds_metadata_parser.cc )
s.files += %w( src/core/xds/grpc/xds_metadata_parser.h )
s.files += %w( src/core/xds/grpc/xds_route_config.cc )
s.files += %w( src/core/xds/grpc/xds_route_config.h )
s.files += %w( src/core/xds/grpc/xds_route_config_parser.cc )

9
package.xml generated

@ -453,6 +453,9 @@
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h" role="src" />
@ -880,6 +883,8 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c" role="src" />
@ -1991,6 +1996,10 @@
<file baseinstalldir="/" name="src/core/xds/grpc/xds_listener.h" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_listener_parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_listener_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_metadata.cc" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_metadata_parser.cc" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_metadata_parser.h" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_route_config.cc" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_route_config.h" role="src" />
<file baseinstalldir="/" name="src/core/xds/grpc/xds_route_config_parser.cc" role="src" />

@ -5494,6 +5494,29 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "xds_metadata",
srcs = [
"xds/grpc/xds_metadata.cc",
],
hdrs = [
"xds/grpc/xds_metadata.h",
],
external_deps = [
"absl/log:check",
"absl/container:flat_hash_map",
"absl/strings",
],
language = "c++",
tags = ["nofixdeps"],
deps = [
"down_cast",
"json",
"json_writer",
"validation_errors",
],
)
grpc_cc_library(
name = "xds_cluster",
srcs = [
@ -5518,6 +5541,7 @@ grpc_cc_library(
"time",
"xds_common_types",
"xds_health_status",
"xds_metadata",
"xds_server_grpc",
"//:xds_client",
],
@ -5564,6 +5588,7 @@ grpc_cc_library(
"xds/grpc/xds_http_stateful_session_filter.cc",
"xds/grpc/xds_lb_policy_registry.cc",
"xds/grpc/xds_listener_parser.cc",
"xds/grpc/xds_metadata_parser.cc",
"xds/grpc/xds_route_config_parser.cc",
"xds/grpc/xds_routing.cc",
"xds/grpc/xds_transport_grpc.cc",
@ -5582,6 +5607,7 @@ grpc_cc_library(
"xds/grpc/xds_http_stateful_session_filter.h",
"xds/grpc/xds_lb_policy_registry.h",
"xds/grpc/xds_listener_parser.h",
"xds/grpc/xds_metadata_parser.h",
"xds/grpc/xds_route_config_parser.h",
"xds/grpc/xds_routing.h",
"xds/grpc/xds_transport_grpc.h",
@ -5639,6 +5665,8 @@ grpc_cc_library(
"envoy_extensions_filters_common_fault_upb",
"envoy_extensions_filters_http_fault_upb",
"envoy_extensions_filters_http_fault_upbdefs",
"envoy_extensions_filters_http_gcp_authn_upb",
"envoy_extensions_filters_http_gcp_authn_upbdefs",
"envoy_extensions_filters_http_rbac_upb",
"envoy_extensions_filters_http_rbac_upbdefs",
"envoy_extensions_filters_http_router_upb",
@ -5725,6 +5753,7 @@ grpc_cc_library(
"xds_health_status",
"xds_http_filter",
"xds_listener",
"xds_metadata",
"xds_route_config",
"xds_server_grpc",
"xds_type_upb",
@ -8481,6 +8510,16 @@ grpc_upb_proto_reflection_library(
deps = ["@envoy_api//envoy/extensions/filters/http/fault/v3:pkg"],
)
grpc_upb_proto_library(
name = "envoy_extensions_filters_http_gcp_authn_upb",
deps = ["@envoy_api//envoy/extensions/filters/http/gcp_authn/v3:pkg"],
)
grpc_upb_proto_reflection_library(
name = "envoy_extensions_filters_http_gcp_authn_upbdefs",
deps = ["@envoy_api//envoy/extensions/filters/http/gcp_authn/v3:pkg"],
)
grpc_upb_proto_library(
name = "envoy_extensions_filters_http_rbac_upb",
deps = ["@envoy_api//envoy/extensions/filters/http/rbac/v3:pkg"],

@ -0,0 +1,431 @@
/* This file was generated by upb_generator from the input file:
*
* envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPB_H_
#include "upb/generated_code_support.h"
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h"
#include "envoy/config/core/v3/base.upb_minitable.h"
#include "envoy/config/core/v3/http_uri.upb_minitable.h"
#include "google/protobuf/duration.upb_minitable.h"
#include "google/protobuf/wrappers.upb_minitable.h"
#include "envoy/annotations/deprecation.upb_minitable.h"
#include "udpa/annotations/status.upb_minitable.h"
#include "validate/validate.upb_minitable.h"
// Must be last.
#include "upb/port/def.inc"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig { upb_Message UPB_PRIVATE(base); } envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig;
typedef struct envoy_extensions_filters_http_gcp_authn_v3_Audience { upb_Message UPB_PRIVATE(base); } envoy_extensions_filters_http_gcp_authn_v3_Audience;
typedef struct envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig { upb_Message UPB_PRIVATE(base); } envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig;
typedef struct envoy_extensions_filters_http_gcp_authn_v3_TokenHeader { upb_Message UPB_PRIVATE(base); } envoy_extensions_filters_http_gcp_authn_v3_TokenHeader;
struct envoy_config_core_v3_HttpUri;
struct envoy_config_core_v3_RetryPolicy;
struct google_protobuf_Duration;
struct google_protobuf_UInt64Value;
/* envoy.extensions.filters.http.gcp_authn.v3.GcpAuthnFilterConfig */
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_new(upb_Arena* arena) {
return (envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig*)_upb_Message_New(&envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init, arena);
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* ret = envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init, NULL, 0, arena) !=
kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_parse_ex(const char* buf, size_t size,
const upb_ExtensionRegistry* extreg,
int options, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* ret = envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init, extreg, options,
arena) != kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_serialize(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init, 0, arena, &ptr, len);
return ptr;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_serialize_ex(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, int options,
upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init, options, arena, &ptr, len);
return ptr;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_clear_http_uri(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const struct envoy_config_core_v3_HttpUri* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_http_uri(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const struct envoy_config_core_v3_HttpUri* default_val = NULL;
const struct envoy_config_core_v3_HttpUri* ret;
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_has_http_uri(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_clear_retry_policy(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const struct envoy_config_core_v3_RetryPolicy* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_retry_policy(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const struct envoy_config_core_v3_RetryPolicy* default_val = NULL;
const struct envoy_config_core_v3_RetryPolicy* ret;
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_has_retry_policy(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_clear_cache_config(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {3, UPB_SIZE(20, 32), 66, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_cache_config(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* default_val = NULL;
const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* ret;
const upb_MiniTableField field = {3, UPB_SIZE(20, 32), 66, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_has_cache_config(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {3, UPB_SIZE(20, 32), 66, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_clear_token_header(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 67, 3, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_token_header(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* default_val = NULL;
const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* ret;
const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 67, 3, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_has_token_header(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 67, 3, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_clear_cluster(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE upb_StringView envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_cluster(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
upb_StringView default_val = upb_StringView_FromString("");
upb_StringView ret;
const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_clear_timeout(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 68, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const struct google_protobuf_Duration* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_timeout(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const struct google_protobuf_Duration* default_val = NULL;
const struct google_protobuf_Duration* ret;
const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 68, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_has_timeout(const envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg) {
const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 68, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_http_uri(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig *msg, struct envoy_config_core_v3_HttpUri* value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct envoy_config_core_v3_HttpUri* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_mutable_http_uri(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, upb_Arena* arena) {
struct envoy_config_core_v3_HttpUri* sub = (struct envoy_config_core_v3_HttpUri*)envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_http_uri(msg);
if (sub == NULL) {
sub = (struct envoy_config_core_v3_HttpUri*)_upb_Message_New(&envoy__config__core__v3__HttpUri_msg_init, arena);
if (sub) envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_http_uri(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_retry_policy(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig *msg, struct envoy_config_core_v3_RetryPolicy* value) {
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct envoy_config_core_v3_RetryPolicy* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_mutable_retry_policy(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, upb_Arena* arena) {
struct envoy_config_core_v3_RetryPolicy* sub = (struct envoy_config_core_v3_RetryPolicy*)envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_retry_policy(msg);
if (sub == NULL) {
sub = (struct envoy_config_core_v3_RetryPolicy*)_upb_Message_New(&envoy__config__core__v3__RetryPolicy_msg_init, arena);
if (sub) envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_retry_policy(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_cache_config(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig *msg, envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* value) {
const upb_MiniTableField field = {3, UPB_SIZE(20, 32), 66, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_mutable_cache_config(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, upb_Arena* arena) {
struct envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* sub = (struct envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig*)envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_cache_config(msg);
if (sub == NULL) {
sub = (struct envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig*)_upb_Message_New(&envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init, arena);
if (sub) envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_cache_config(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_token_header(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig *msg, envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* value) {
const upb_MiniTableField field = {4, UPB_SIZE(24, 40), 67, 3, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_mutable_token_header(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, upb_Arena* arena) {
struct envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* sub = (struct envoy_extensions_filters_http_gcp_authn_v3_TokenHeader*)envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_token_header(msg);
if (sub == NULL) {
sub = (struct envoy_extensions_filters_http_gcp_authn_v3_TokenHeader*)_upb_Message_New(&envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init, arena);
if (sub) envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_token_header(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_cluster(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig *msg, upb_StringView value) {
const upb_MiniTableField field = {5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_timeout(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig *msg, struct google_protobuf_Duration* value) {
const upb_MiniTableField field = {6, UPB_SIZE(28, 64), 68, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct google_protobuf_Duration* envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_mutable_timeout(envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig* msg, upb_Arena* arena) {
struct google_protobuf_Duration* sub = (struct google_protobuf_Duration*)envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_timeout(msg);
if (sub == NULL) {
sub = (struct google_protobuf_Duration*)_upb_Message_New(&google__protobuf__Duration_msg_init, arena);
if (sub) envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_set_timeout(msg, sub);
}
return sub;
}
/* envoy.extensions.filters.http.gcp_authn.v3.Audience */
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_Audience* envoy_extensions_filters_http_gcp_authn_v3_Audience_new(upb_Arena* arena) {
return (envoy_extensions_filters_http_gcp_authn_v3_Audience*)_upb_Message_New(&envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init, arena);
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_Audience* envoy_extensions_filters_http_gcp_authn_v3_Audience_parse(const char* buf, size_t size, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_Audience* ret = envoy_extensions_filters_http_gcp_authn_v3_Audience_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init, NULL, 0, arena) !=
kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_Audience* envoy_extensions_filters_http_gcp_authn_v3_Audience_parse_ex(const char* buf, size_t size,
const upb_ExtensionRegistry* extreg,
int options, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_Audience* ret = envoy_extensions_filters_http_gcp_authn_v3_Audience_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init, extreg, options,
arena) != kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_Audience_serialize(const envoy_extensions_filters_http_gcp_authn_v3_Audience* msg, upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init, 0, arena, &ptr, len);
return ptr;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_Audience_serialize_ex(const envoy_extensions_filters_http_gcp_authn_v3_Audience* msg, int options,
upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init, options, arena, &ptr, len);
return ptr;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_Audience_clear_url(envoy_extensions_filters_http_gcp_authn_v3_Audience* msg) {
const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE upb_StringView envoy_extensions_filters_http_gcp_authn_v3_Audience_url(const envoy_extensions_filters_http_gcp_authn_v3_Audience* msg) {
upb_StringView default_val = upb_StringView_FromString("");
upb_StringView ret;
const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_Audience_set_url(envoy_extensions_filters_http_gcp_authn_v3_Audience *msg, upb_StringView value) {
const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
/* envoy.extensions.filters.http.gcp_authn.v3.TokenCacheConfig */
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_new(upb_Arena* arena) {
return (envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig*)_upb_Message_New(&envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init, arena);
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_parse(const char* buf, size_t size, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* ret = envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init, NULL, 0, arena) !=
kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_parse_ex(const char* buf, size_t size,
const upb_ExtensionRegistry* extreg,
int options, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* ret = envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init, extreg, options,
arena) != kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_serialize(const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* msg, upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init, 0, arena, &ptr, len);
return ptr;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_serialize_ex(const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* msg, int options,
upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init, options, arena, &ptr, len);
return ptr;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_clear_cache_size(envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* msg) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE const struct google_protobuf_UInt64Value* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_cache_size(const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* msg) {
const struct google_protobuf_UInt64Value* default_val = NULL;
const struct google_protobuf_UInt64Value* ret;
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE bool envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_has_cache_size(const envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* msg) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
return upb_Message_HasBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_set_cache_size(envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig *msg, struct google_protobuf_UInt64Value* value) {
const upb_MiniTableField field = {1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE struct google_protobuf_UInt64Value* envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_mutable_cache_size(envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig* msg, upb_Arena* arena) {
struct google_protobuf_UInt64Value* sub = (struct google_protobuf_UInt64Value*)envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_cache_size(msg);
if (sub == NULL) {
sub = (struct google_protobuf_UInt64Value*)_upb_Message_New(&google__protobuf__UInt64Value_msg_init, arena);
if (sub) envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_set_cache_size(msg, sub);
}
return sub;
}
/* envoy.extensions.filters.http.gcp_authn.v3.TokenHeader */
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_new(upb_Arena* arena) {
return (envoy_extensions_filters_http_gcp_authn_v3_TokenHeader*)_upb_Message_New(&envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init, arena);
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_parse(const char* buf, size_t size, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* ret = envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init, NULL, 0, arena) !=
kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_parse_ex(const char* buf, size_t size,
const upb_ExtensionRegistry* extreg,
int options, upb_Arena* arena) {
envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* ret = envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_new(arena);
if (!ret) return NULL;
if (upb_Decode(buf, size, UPB_UPCAST(ret), &envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init, extreg, options,
arena) != kUpb_DecodeStatus_Ok) {
return NULL;
}
return ret;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_serialize(const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* msg, upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init, 0, arena, &ptr, len);
return ptr;
}
UPB_INLINE char* envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_serialize_ex(const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* msg, int options,
upb_Arena* arena, size_t* len) {
char* ptr;
(void)upb_Encode(UPB_UPCAST(msg), &envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init, options, arena, &ptr, len);
return ptr;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_clear_name(envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* msg) {
const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE upb_StringView envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_name(const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* msg) {
upb_StringView default_val = upb_StringView_FromString("");
upb_StringView ret;
const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_clear_value_prefix(envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* msg) {
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_ClearBaseField(UPB_UPCAST(msg), &field);
}
UPB_INLINE upb_StringView envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_value_prefix(const envoy_extensions_filters_http_gcp_authn_v3_TokenHeader* msg) {
upb_StringView default_val = upb_StringView_FromString("");
upb_StringView ret;
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
_upb_Message_GetNonExtensionField(UPB_UPCAST(msg), &field,
&default_val, &ret);
return ret;
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_set_name(envoy_extensions_filters_http_gcp_authn_v3_TokenHeader *msg, upb_StringView value) {
const upb_MiniTableField field = {1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
UPB_INLINE void envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_set_value_prefix(envoy_extensions_filters_http_gcp_authn_v3_TokenHeader *msg, upb_StringView value) {
const upb_MiniTableField field = {2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)};
upb_Message_SetBaseField((upb_Message *)msg, &field, &value);
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port/undef.inc"
#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPB_H_ */

@ -0,0 +1,129 @@
/* This file was generated by upb_generator from the input file:
*
* envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/generated_code_support.h"
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h"
#include "envoy/config/core/v3/base.upb_minitable.h"
#include "envoy/config/core/v3/http_uri.upb_minitable.h"
#include "google/protobuf/duration.upb_minitable.h"
#include "google/protobuf/wrappers.upb_minitable.h"
#include "envoy/annotations/deprecation.upb_minitable.h"
#include "udpa/annotations/status.upb_minitable.h"
#include "validate/validate.upb_minitable.h"
// Must be last.
#include "upb/port/def.inc"
static const upb_MiniTableSub envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_submsgs[5] = {
{.UPB_PRIVATE(submsg) = &envoy__config__core__v3__HttpUri_msg_init},
{.UPB_PRIVATE(submsg) = &envoy__config__core__v3__RetryPolicy_msg_init},
{.UPB_PRIVATE(submsg) = &envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init},
{.UPB_PRIVATE(submsg) = &envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init},
{.UPB_PRIVATE(submsg) = &google__protobuf__Duration_msg_init},
};
static const upb_MiniTableField envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig__fields[6] = {
{1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(16, 24), 65, 1, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{3, UPB_SIZE(20, 32), 66, 2, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{4, UPB_SIZE(24, 40), 67, 3, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
{5, UPB_SIZE(32, 48), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{6, UPB_SIZE(28, 64), 68, 4, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
};
const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init = {
&envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_submsgs[0],
&envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig__fields[0],
UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, UPB_FASTTABLE_MASK(56), 0,
#ifdef UPB_TRACING_ENABLED
"envoy.extensions.filters.http.gcp_authn.v3.GcpAuthnFilterConfig",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x003000003f00002a, &upb_pss_1bt},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
static const upb_MiniTableField envoy_extensions_filters_http_gcp_authn_v3_Audience__fields[1] = {
{1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init = {
NULL,
&envoy_extensions_filters_http_gcp_authn_v3_Audience__fields[0],
UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(8), 0,
#ifdef UPB_TRACING_ENABLED
"envoy.extensions.filters.http.gcp_authn.v3.Audience",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000800003f00000a, &upb_pss_1bt},
})
};
static const upb_MiniTableSub envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_submsgs[1] = {
{.UPB_PRIVATE(submsg) = &google__protobuf__UInt64Value_msg_init},
};
static const upb_MiniTableField envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig__fields[1] = {
{1, UPB_SIZE(12, 16), 64, 0, 11, (int)kUpb_FieldMode_Scalar | ((int)UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte) << kUpb_FieldRep_Shift)},
};
const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init = {
&envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_submsgs[0],
&envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig__fields[0],
UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, UPB_FASTTABLE_MASK(255), 0,
#ifdef UPB_TRACING_ENABLED
"envoy.extensions.filters.http.gcp_authn.v3.TokenCacheConfig",
#endif
};
static const upb_MiniTableField envoy_extensions_filters_http_gcp_authn_v3_TokenHeader__fields[2] = {
{1, 8, 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
{2, UPB_SIZE(16, 24), 0, kUpb_NoSub, 9, (int)kUpb_FieldMode_Scalar | ((int)kUpb_FieldRep_StringView << kUpb_FieldRep_Shift)},
};
const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init = {
NULL,
&envoy_extensions_filters_http_gcp_authn_v3_TokenHeader__fields[0],
UPB_SIZE(24, 40), 2, kUpb_ExtMode_NonExtendable, 2, UPB_FASTTABLE_MASK(24), 0,
#ifdef UPB_TRACING_ENABLED
"envoy.extensions.filters.http.gcp_authn.v3.TokenHeader",
#endif
UPB_FASTTABLE_INIT({
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
{0x000800003f00000a, &upb_pss_1bt},
{0x001800003f000012, &upb_pss_1bt},
{0x0000000000000000, &_upb_FastDecoder_DecodeGeneric},
})
};
static const upb_MiniTable *messages_layout[4] = {
&envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init,
&envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init,
&envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init,
&envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init,
};
const upb_MiniTableFile envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upb_file_layout = {
messages_layout,
NULL,
NULL,
4,
0,
0,
};
#include "upb/port/undef.inc"

@ -0,0 +1,33 @@
/* This file was generated by upb_generator from the input file:
*
* envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPB_MINITABLE_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPB_MINITABLE_H_
#include "upb/generated_code_support.h"
// Must be last.
#include "upb/port/def.inc"
#ifdef __cplusplus
extern "C" {
#endif
extern const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__GcpAuthnFilterConfig_msg_init;
extern const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__Audience_msg_init;
extern const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__TokenCacheConfig_msg_init;
extern const upb_MiniTable envoy__extensions__filters__http__gcp_0authn__v3__TokenHeader_msg_init;
extern const upb_MiniTableFile envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upb_file_layout;
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port/undef.inc"
#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPB_MINITABLE_H_ */

@ -0,0 +1,86 @@
/* This file was generated by upb_generator from the input file:
*
* envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include "upb/reflection/def.h"
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h"
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h"
extern _upb_DefPool_Init envoy_config_core_v3_base_proto_upbdefinit;
extern _upb_DefPool_Init envoy_config_core_v3_http_uri_proto_upbdefinit;
extern _upb_DefPool_Init google_protobuf_duration_proto_upbdefinit;
extern _upb_DefPool_Init google_protobuf_wrappers_proto_upbdefinit;
extern _upb_DefPool_Init envoy_annotations_deprecation_proto_upbdefinit;
extern _upb_DefPool_Init udpa_annotations_status_proto_upbdefinit;
extern _upb_DefPool_Init validate_validate_proto_upbdefinit;
static const char descriptor[1207] = {'\n', ':', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r',
's', '/', 'h', 't', 't', 'p', '/', 'g', 'c', 'p', '_', 'a', 'u', 't', 'h', 'n', '/', 'v', '3', '/', 'g', 'c', 'p', '_', 'a',
'u', 't', 'h', 'n', '.', 'p', 'r', 'o', 't', 'o', '\022', '*', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'g', 'c', 'p', '_', 'a', 'u', 't', 'h',
'n', '.', 'v', '3', '\032', '\037', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'c', 'o', 'r', 'e', '/', 'v',
'3', '/', 'b', 'a', 's', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'c', 'o', 'n', 'f', 'i',
'g', '/', 'c', 'o', 'r', 'e', '/', 'v', '3', '/', 'h', 't', 't', 'p', '_', 'u', 'r', 'i', '.', 'p', 'r', 'o', 't', 'o', '\032',
'\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'd', 'u', 'r', 'a', 't', 'i', 'o', 'n',
'.', 'p', 'r', 'o', 't', 'o', '\032', '\036', 'g', 'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 'w',
'r', 'a', 'p', 'p', 'e', 'r', 's', '.', 'p', 'r', 'o', 't', 'o', '\032', '#', 'e', 'n', 'v', 'o', 'y', '/', 'a', 'n', 'n', 'o',
't', 'a', 't', 'i', 'o', 'n', 's', '/', 'd', 'e', 'p', 'r', 'e', 'c', 'a', 't', 'i', 'o', 'n', '.', 'p', 'r', 'o', 't', 'o',
'\032', '\035', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 's', 't', 'a', 't', 'u', 's',
'.', 'p', 'r', 'o', 't', 'o', '\032', '\027', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e',
'.', 'p', 'r', 'o', 't', 'o', '\"', '\301', '\003', '\n', '\024', 'G', 'c', 'p', 'A', 'u', 't', 'h', 'n', 'F', 'i', 'l', 't', 'e', 'r',
'C', 'o', 'n', 'f', 'i', 'g', '\022', 'E', '\n', '\010', 'h', 't', 't', 'p', '_', 'u', 'r', 'i', '\030', '\001', ' ', '\001', '(', '\013', '2',
'\035', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'H', 't',
't', 'p', 'U', 'r', 'i', 'B', '\013', '\030', '\001', '\222', '\307', '\206', '\330', '\004', '\003', '3', '.', '0', 'R', '\007', 'h', 't', 't', 'p', 'U',
'r', 'i', '\022', 'D', '\n', '\014', 'r', 'e', 't', 'r', 'y', '_', 'p', 'o', 'l', 'i', 'c', 'y', '\030', '\002', ' ', '\001', '(', '\013', '2',
'!', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'c', 'o', 'r', 'e', '.', 'v', '3', '.', 'R', 'e',
't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', 'R', '\013', 'r', 'e', 't', 'r', 'y', 'P', 'o', 'l', 'i', 'c', 'y', '\022', '_', '\n',
'\014', 'c', 'a', 'c', 'h', 'e', '_', 'c', 'o', 'n', 'f', 'i', 'g', '\030', '\003', ' ', '\001', '(', '\013', '2', '<', '.', 'e', 'n', 'v',
'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't',
'p', '.', 'g', 'c', 'p', '_', 'a', 'u', 't', 'h', 'n', '.', 'v', '3', '.', 'T', 'o', 'k', 'e', 'n', 'C', 'a', 'c', 'h', 'e',
'C', 'o', 'n', 'f', 'i', 'g', 'R', '\013', 'c', 'a', 'c', 'h', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'Z', '\n', '\014', 't', 'o',
'k', 'e', 'n', '_', 'h', 'e', 'a', 'd', 'e', 'r', '\030', '\004', ' ', '\001', '(', '\013', '2', '7', '.', 'e', 'n', 'v', 'o', 'y', '.',
'e', 'x', 't', 'e', 'n', 's', 'i', 'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'g',
'c', 'p', '_', 'a', 'u', 't', 'h', 'n', '.', 'v', '3', '.', 'T', 'o', 'k', 'e', 'n', 'H', 'e', 'a', 'd', 'e', 'r', 'R', '\013',
't', 'o', 'k', 'e', 'n', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '\030', '\n', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\030', '\005', ' ',
'\001', '(', '\t', 'R', '\007', 'c', 'l', 'u', 's', 't', 'e', 'r', '\022', 'E', '\n', '\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\006',
' ', '\001', '(', '\013', '2', '\031', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'D', 'u',
'r', 'a', 't', 'i', 'o', 'n', 'B', '\020', '\372', 'B', '\r', '\252', '\001', '\n', '\032', '\006', '\010', '\200', '\200', '\200', '\200', '\020', '2', '\000', 'R',
'\007', 't', 'i', 'm', 'e', 'o', 'u', 't', '\"', '%', '\n', '\010', 'A', 'u', 'd', 'i', 'e', 'n', 'c', 'e', '\022', '\031', '\n', '\003', 'u',
'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'B', '\007', '\372', 'B', '\004', 'r', '\002', '\020', '\001', 'R', '\003', 'u', 'r', 'l', '\"', '`', '\n',
'\020', 'T', 'o', 'k', 'e', 'n', 'C', 'a', 'c', 'h', 'e', 'C', 'o', 'n', 'f', 'i', 'g', '\022', 'L', '\n', '\n', 'c', 'a', 'c', 'h',
'e', '_', 's', 'i', 'z', 'e', '\030', '\001', ' ', '\001', '(', '\013', '2', '\034', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o',
't', 'o', 'b', 'u', 'f', '.', 'U', 'I', 'n', 't', '6', '4', 'V', 'a', 'l', 'u', 'e', 'B', '\017', '\372', 'B', '\014', '2', '\n', '\030',
'\377', '\377', '\377', '\377', '\377', '\377', '\377', '\377', '\177', 'R', '\t', 'c', 'a', 'c', 'h', 'e', 'S', 'i', 'z', 'e', '\"', '`', '\n', '\013', 'T',
'o', 'k', 'e', 'n', 'H', 'e', 'a', 'd', 'e', 'r', '\022', '!', '\n', '\004', 'n', 'a', 'm', 'e', '\030', '\001', ' ', '\001', '(', '\t', 'B',
'\r', '\372', 'B', '\n', 'r', '\010', '\020', '\001', '\300', '\001', '\001', '\310', '\001', '\000', 'R', '\004', 'n', 'a', 'm', 'e', '\022', '.', '\n', '\014', 'v',
'a', 'l', 'u', 'e', '_', 'p', 'r', 'e', 'f', 'i', 'x', '\030', '\002', ' ', '\001', '(', '\t', 'B', '\013', '\372', 'B', '\010', 'r', '\006', '\300',
'\001', '\002', '\310', '\001', '\000', 'R', '\013', 'v', 'a', 'l', 'u', 'e', 'P', 'r', 'e', 'f', 'i', 'x', 'B', '\262', '\001', '\n', '8', 'i', 'o',
'.', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '.', 'e', 'n', 'v', 'o', 'y', '.', 'e', 'x', 't', 'e', 'n', 's', 'i',
'o', 'n', 's', '.', 'f', 'i', 'l', 't', 'e', 'r', 's', '.', 'h', 't', 't', 'p', '.', 'g', 'c', 'p', '_', 'a', 'u', 't', 'h',
'n', '.', 'v', '3', 'B', '\r', 'G', 'c', 'p', 'A', 'u', 't', 'h', 'n', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'Z', ']', 'g', 'i',
't', 'h', 'u', 'b', '.', 'c', 'o', 'm', '/', 'e', 'n', 'v', 'o', 'y', 'p', 'r', 'o', 'x', 'y', '/', 'g', 'o', '-', 'c', 'o',
'n', 't', 'r', 'o', 'l', '-', 'p', 'l', 'a', 'n', 'e', '/', 'e', 'n', 'v', 'o', 'y', '/', 'e', 'x', 't', 'e', 'n', 's', 'i',
'o', 'n', 's', '/', 'f', 'i', 'l', 't', 'e', 'r', 's', '/', 'h', 't', 't', 'p', '/', 'g', 'c', 'p', '_', 'a', 'u', 't', 'h',
'n', '/', 'v', '3', ';', 'g', 'c', 'p', '_', 'a', 'u', 't', 'h', 'n', 'v', '3', '\272', '\200', '\310', '\321', '\006', '\002', '\020', '\002', 'b',
'\006', 'p', 'r', 'o', 't', 'o', '3',
};
static _upb_DefPool_Init *deps[8] = {
&envoy_config_core_v3_base_proto_upbdefinit,
&envoy_config_core_v3_http_uri_proto_upbdefinit,
&google_protobuf_duration_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&envoy_annotations_deprecation_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
_upb_DefPool_Init envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upbdefinit = {
deps,
&envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upb_file_layout,
"envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto",
UPB_STRINGVIEW_INIT(descriptor, 1207)
};

@ -0,0 +1,47 @@
/* This file was generated by upb_generator from the input file:
*
* envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPBDEFS_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPBDEFS_H_
#include "upb/reflection/def.h"
#include "upb/reflection/internal/def_pool.h"
#include "upb/port/def.inc" // Must be last.
#ifdef __cplusplus
extern "C" {
#endif
extern _upb_DefPool_Init envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upbdefinit;
UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_gcp_authn_v3_GcpAuthnFilterConfig_getmsgdef(upb_DefPool *s) {
_upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upbdefinit);
return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.gcp_authn.v3.GcpAuthnFilterConfig");
}
UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_gcp_authn_v3_Audience_getmsgdef(upb_DefPool *s) {
_upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upbdefinit);
return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.gcp_authn.v3.Audience");
}
UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_gcp_authn_v3_TokenCacheConfig_getmsgdef(upb_DefPool *s) {
_upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upbdefinit);
return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.gcp_authn.v3.TokenCacheConfig");
}
UPB_INLINE const upb_MessageDef *envoy_extensions_filters_http_gcp_authn_v3_TokenHeader_getmsgdef(upb_DefPool *s) {
_upb_DefPool_LoadDefInit(s, &envoy_extensions_filters_http_gcp_authn_v3_gcp_authn_proto_upbdefinit);
return upb_DefPool_FindMessageByName(s, "envoy.extensions.filters.http.gcp_authn.v3.TokenHeader");
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port/undef.inc"
#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_GCP_AUTHN_V3_GCP_AUTHN_PROTO_UPBDEFS_H_ */

@ -122,18 +122,10 @@ TraceFlag xds_client_trace(false, "xds_client");
TraceFlag xds_client_refcount_trace(false, "xds_client_refcount");
TraceFlag xds_cluster_impl_lb_trace(false, "xds_cluster_impl_lb");
TraceFlag xds_cluster_manager_lb_trace(false, "xds_cluster_manager_lb");
TraceFlag xds_cluster_resource_type_test_trace(
true, "xds_cluster_resource_type_test");
TraceFlag xds_common_types_test_trace(true, "xds_common_types_test");
TraceFlag xds_endpoint_resource_type_test_trace(
true, "xds_endpoint_resource_type_test");
TraceFlag xds_listener_resource_type_test_trace(
true, "xds_listener_resource_type_test");
TraceFlag xds_override_host_lb_trace(false, "xds_override_host_lb");
TraceFlag xds_resolver_trace(false, "xds_resolver");
TraceFlag xds_route_config_resource_type_test_trace(
true, "xds_route_config_resource_type_test");
TraceFlag xds_server_config_fetcher_trace(false, "xds_server_config_fetcher");
TraceFlag xds_unittest_trace(true, "xds_unittest");
TraceFlag xds_wrr_locality_lb_trace(false, "xds_wrr_locality_lb");
const absl::flat_hash_map<std::string, TraceFlag*>& GetAllTraceFlags() {
@ -215,18 +207,10 @@ const absl::flat_hash_map<std::string, TraceFlag*>& GetAllTraceFlags() {
{"xds_client_refcount", &xds_client_refcount_trace},
{"xds_cluster_impl_lb", &xds_cluster_impl_lb_trace},
{"xds_cluster_manager_lb", &xds_cluster_manager_lb_trace},
{"xds_cluster_resource_type_test",
&xds_cluster_resource_type_test_trace},
{"xds_common_types_test", &xds_common_types_test_trace},
{"xds_endpoint_resource_type_test",
&xds_endpoint_resource_type_test_trace},
{"xds_listener_resource_type_test",
&xds_listener_resource_type_test_trace},
{"xds_override_host_lb", &xds_override_host_lb_trace},
{"xds_resolver", &xds_resolver_trace},
{"xds_route_config_resource_type_test",
&xds_route_config_resource_type_test_trace},
{"xds_server_config_fetcher", &xds_server_config_fetcher_trace},
{"xds_unittest", &xds_unittest_trace},
{"xds_wrr_locality_lb", &xds_wrr_locality_lb_trace},
#ifndef NDEBUG
{"auth_context_refcount", &auth_context_refcount_trace},

@ -120,14 +120,10 @@ extern TraceFlag xds_client_trace;
extern TraceFlag xds_client_refcount_trace;
extern TraceFlag xds_cluster_impl_lb_trace;
extern TraceFlag xds_cluster_manager_lb_trace;
extern TraceFlag xds_cluster_resource_type_test_trace;
extern TraceFlag xds_common_types_test_trace;
extern TraceFlag xds_endpoint_resource_type_test_trace;
extern TraceFlag xds_listener_resource_type_test_trace;
extern TraceFlag xds_override_host_lb_trace;
extern TraceFlag xds_resolver_trace;
extern TraceFlag xds_route_config_resource_type_test_trace;
extern TraceFlag xds_server_config_fetcher_trace;
extern TraceFlag xds_unittest_trace;
extern TraceFlag xds_wrr_locality_lb_trace;
} // namespace grpc_core

@ -336,35 +336,19 @@ xds_cluster_impl_lb:
xds_cluster_manager_lb:
default: false
description: XDS Cluster manager LB policy.
xds_cluster_resource_type_test:
default: true
description: XDS Cluster resource type.
internal: true
xds_common_types_test:
default: true
description: XDS Common types.
internal: true
xds_endpoint_resource_type_test:
default: true
description: XDS Endpoint resource type.
internal: true
xds_listener_resource_type_test:
default: true
description: XDS Listener resource type.
internal: true
xds_override_host_lb:
default: false
description: XDS Override host LB.
xds_resolver:
default: false
description: XDS Resolver.
xds_route_config_resource_type_test:
default: true
description: XDS Route config resource type.
internal: true
xds_server_config_fetcher:
default: false
description: XDS Server config fetcher.
xds_unittest:
default: true
description: xDS unit tests.
internal: true
xds_wrr_locality_lb:
default: false
description: XDS WRR locality LB policy.

@ -646,17 +646,21 @@ absl::Status XdsClusterImplLb::UpdateLocked(UpdateArgs args) {
// Update config state, now that we're done comparing old and new fields.
config_ = std::move(new_config);
cluster_resource_ = new_cluster_config.cluster;
auto it2 =
cluster_resource_->metadata.find("com.google.csm.telemetry_labels");
if (it2 != cluster_resource_->metadata.end()) {
auto& json_object = it2->second.object();
auto it3 = json_object.find("service_name");
if (it3 != json_object.end() && it3->second.type() == Json::Type::kString) {
service_telemetry_label_ = RefCountedStringValue(it3->second.string());
const XdsMetadataValue* metadata_value =
cluster_resource_->metadata.Find("com.google.csm.telemetry_labels");
if (metadata_value != nullptr &&
metadata_value->type() == XdsStructMetadataValue::Type()) {
const Json::Object& json_object =
DownCast<const XdsStructMetadataValue*>(metadata_value)
->json()
.object();
auto it = json_object.find("service_name");
if (it != json_object.end() && it->second.type() == Json::Type::kString) {
service_telemetry_label_ = RefCountedStringValue(it->second.string());
}
it3 = json_object.find("service_namespace");
if (it3 != json_object.end() && it3->second.type() == Json::Type::kString) {
namespace_telemetry_label_ = RefCountedStringValue(it3->second.string());
it = json_object.find("service_namespace");
if (it != json_object.end() && it->second.type() == Json::Type::kString) {
namespace_telemetry_label_ = RefCountedStringValue(it->second.string());
}
}
drop_config_ = endpoint_config->endpoints != nullptr

@ -66,13 +66,7 @@ std::string XdsClusterResource::ToString() const {
contents.push_back(absl::StrCat("override_host_statuses=",
override_host_statuses.ToString()));
if (!metadata.empty()) {
std::vector<std::string> metadata_entries;
for (const auto& p : metadata) {
metadata_entries.push_back(
absl::StrCat(p.first, "=", JsonDump(p.second)));
}
contents.push_back(
absl::StrCat("metadata={", absl::StrJoin(metadata_entries, ", "), "}"));
contents.push_back(absl::StrCat("metadata={", metadata.ToString(), "}"));
}
return absl::StrCat("{", absl::StrJoin(contents, ", "), "}");
}

@ -28,6 +28,7 @@
#include "src/core/util/json/json.h"
#include "src/core/xds/grpc/xds_common_types.h"
#include "src/core/xds/grpc/xds_health_status.h"
#include "src/core/xds/grpc/xds_metadata.h"
#include "src/core/xds/grpc/xds_server_grpc.h"
#include "src/core/xds/xds_client/xds_resource_type.h"
#include "src/core/xds/xds_client/xds_resource_type_impl.h"
@ -87,7 +88,7 @@ struct XdsClusterResource : public XdsResourceType::ResourceData {
XdsHealthStatusSet override_host_statuses;
absl::flat_hash_map<std::string, Json> metadata;
XdsMetadataMap metadata;
bool operator==(const XdsClusterResource& other) const {
return type == other.type && lb_policy_config == other.lb_policy_config &&

@ -58,6 +58,7 @@
#include "src/core/xds/grpc/xds_common_types.h"
#include "src/core/xds/grpc/xds_common_types_parser.h"
#include "src/core/xds/grpc/xds_lb_policy_registry.h"
#include "src/core/xds/grpc/xds_metadata_parser.h"
namespace grpc_core {
@ -300,22 +301,22 @@ void ParseLbPolicyConfig(const XdsResourceType::DecodeContext& context,
uint64_t max_ring_size = 8388608;
if (ring_hash_config != nullptr) {
ValidationErrors::ScopedField field(errors, ".ring_hash_lb_config");
const google_protobuf_UInt64Value* uint64_value =
auto value = ParseUInt64Value(
envoy_config_cluster_v3_Cluster_RingHashLbConfig_maximum_ring_size(
ring_hash_config);
if (uint64_value != nullptr) {
ring_hash_config));
if (value.has_value()) {
ValidationErrors::ScopedField field(errors, ".maximum_ring_size");
max_ring_size = google_protobuf_UInt64Value_value(uint64_value);
max_ring_size = *value;
if (max_ring_size > 8388608 || max_ring_size == 0) {
errors->AddError("must be in the range of 1 to 8388608");
}
}
uint64_value =
value = ParseUInt64Value(
envoy_config_cluster_v3_Cluster_RingHashLbConfig_minimum_ring_size(
ring_hash_config);
if (uint64_value != nullptr) {
ring_hash_config));
if (value.has_value()) {
ValidationErrors::ScopedField field(errors, ".minimum_ring_size");
min_ring_size = google_protobuf_UInt64Value_value(uint64_value);
min_ring_size = *value;
if (min_ring_size > 8388608 || min_ring_size == 0) {
errors->AddError("must be in the range of 1 to 8388608");
}
@ -478,13 +479,10 @@ absl::StatusOr<std::shared_ptr<const XdsClusterResource>> CdsResourceParse(
const auto* threshold = thresholds[i];
if (envoy_config_cluster_v3_CircuitBreakers_Thresholds_priority(
threshold) == envoy_config_core_v3_DEFAULT) {
const google_protobuf_UInt32Value* max_requests =
auto value = ParseUInt32Value(
envoy_config_cluster_v3_CircuitBreakers_Thresholds_max_requests(
threshold);
if (max_requests != nullptr) {
cds_update->max_concurrent_requests =
google_protobuf_UInt32Value_value(max_requests);
}
threshold));
if (value.has_value()) cds_update->max_concurrent_requests = *value;
break;
}
}
@ -515,91 +513,80 @@ absl::StatusOr<std::shared_ptr<const XdsClusterResource>> CdsResourceParse(
outlier_detection_update.max_ejection_time =
ParseDuration(duration, &errors);
}
const google_protobuf_UInt32Value* max_ejection_percent =
auto max_ejection_percent = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_max_ejection_percent(
outlier_detection);
if (max_ejection_percent != nullptr) {
outlier_detection_update.max_ejection_percent =
google_protobuf_UInt32Value_value(max_ejection_percent);
outlier_detection));
if (max_ejection_percent.has_value()) {
outlier_detection_update.max_ejection_percent = *max_ejection_percent;
if (outlier_detection_update.max_ejection_percent > 100) {
ValidationErrors::ScopedField field(&errors, ".max_ejection_percent");
errors.AddError("value must be <= 100");
}
}
const google_protobuf_UInt32Value* enforcing_success_rate =
auto enforcement_percentage = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_enforcing_success_rate(
outlier_detection);
if (enforcing_success_rate != nullptr) {
uint32_t enforcement_percentage =
google_protobuf_UInt32Value_value(enforcing_success_rate);
if (enforcement_percentage > 100) {
outlier_detection));
if (enforcement_percentage.has_value()) {
if (*enforcement_percentage > 100) {
ValidationErrors::ScopedField field(&errors, ".enforcing_success_rate");
errors.AddError("value must be <= 100");
}
if (enforcement_percentage != 0) {
if (*enforcement_percentage != 0) {
OutlierDetectionConfig::SuccessRateEjection success_rate_ejection;
success_rate_ejection.enforcement_percentage = enforcement_percentage;
const google_protobuf_UInt32Value* minimum_hosts =
success_rate_ejection.enforcement_percentage = *enforcement_percentage;
auto minimum_hosts = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_success_rate_minimum_hosts(
outlier_detection);
if (minimum_hosts != nullptr) {
success_rate_ejection.minimum_hosts =
google_protobuf_UInt32Value_value(minimum_hosts);
outlier_detection));
if (minimum_hosts.has_value()) {
success_rate_ejection.minimum_hosts = *minimum_hosts;
}
const google_protobuf_UInt32Value* request_volume =
auto request_volume = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_success_rate_request_volume(
outlier_detection);
if (request_volume != nullptr) {
success_rate_ejection.request_volume =
google_protobuf_UInt32Value_value(request_volume);
outlier_detection));
if (request_volume.has_value()) {
success_rate_ejection.request_volume = *request_volume;
}
const google_protobuf_UInt32Value* stdev_factor =
auto stdev_factor = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_success_rate_stdev_factor(
outlier_detection);
if (stdev_factor != nullptr) {
success_rate_ejection.stdev_factor =
google_protobuf_UInt32Value_value(stdev_factor);
outlier_detection));
if (stdev_factor.has_value()) {
success_rate_ejection.stdev_factor = *stdev_factor;
}
outlier_detection_update.success_rate_ejection = success_rate_ejection;
}
}
const google_protobuf_UInt32Value* enforcing_failure_percentage =
enforcement_percentage = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_enforcing_failure_percentage(
outlier_detection);
if (enforcing_failure_percentage != nullptr) {
uint32_t enforcement_percentage =
google_protobuf_UInt32Value_value(enforcing_failure_percentage);
if (enforcement_percentage > 100) {
outlier_detection));
if (enforcement_percentage.has_value()) {
if (*enforcement_percentage > 100) {
ValidationErrors::ScopedField field(&errors,
".enforcing_failure_percentage");
errors.AddError("value must be <= 100");
}
if (enforcement_percentage != 0) {
if (*enforcement_percentage != 0) {
OutlierDetectionConfig::FailurePercentageEjection
failure_percentage_ejection;
failure_percentage_ejection.enforcement_percentage =
enforcement_percentage;
const google_protobuf_UInt32Value* minimum_hosts =
*enforcement_percentage;
auto minimum_hosts = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_failure_percentage_minimum_hosts(
outlier_detection);
if (minimum_hosts != nullptr) {
failure_percentage_ejection.minimum_hosts =
google_protobuf_UInt32Value_value(minimum_hosts);
outlier_detection));
if (minimum_hosts.has_value()) {
failure_percentage_ejection.minimum_hosts = *minimum_hosts;
}
const google_protobuf_UInt32Value* request_volume =
auto request_volume = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_failure_percentage_request_volume(
outlier_detection);
if (request_volume != nullptr) {
failure_percentage_ejection.request_volume =
google_protobuf_UInt32Value_value(request_volume);
outlier_detection));
if (request_volume.has_value()) {
failure_percentage_ejection.request_volume = *request_volume;
}
const google_protobuf_UInt32Value* threshold =
auto threshold = ParseUInt32Value(
envoy_config_cluster_v3_OutlierDetection_failure_percentage_threshold(
outlier_detection);
if (threshold != nullptr) {
failure_percentage_ejection.threshold =
google_protobuf_UInt32Value_value(threshold);
if (enforcement_percentage > 100) {
outlier_detection));
if (threshold.has_value()) {
failure_percentage_ejection.threshold = *threshold;
if (*enforcement_percentage > 100) {
ValidationErrors::ScopedField field(
&errors, ".failure_percentage_threshold");
errors.AddError("value must be <= 100");
@ -642,50 +629,10 @@ absl::StatusOr<std::shared_ptr<const XdsClusterResource>> CdsResourceParse(
XdsHealthStatus(XdsHealthStatus::kHealthy));
}
// Parse metadata.
const envoy_config_core_v3_Metadata* metadata =
envoy_config_cluster_v3_Cluster_metadata(cluster);
if (metadata != nullptr) {
// First, try typed_filter_metadata.
size_t iter = kUpb_Map_Begin;
const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* typed_entry;
while (
(typed_entry = envoy_config_core_v3_Metadata_typed_filter_metadata_next(
metadata, &iter)) != nullptr) {
absl::string_view key = UpbStringToAbsl(
envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_key(
typed_entry));
ValidationErrors::ScopedField field(
&errors, absl::StrCat(".metadata.typed_filter_metadata[", key, "]"));
auto extension = ExtractXdsExtension(
context,
envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_value(
typed_entry),
&errors);
if (!extension.has_value()) continue;
// TODO(roth): If we ever need to support another type here, refactor
// this into a separate registry.
if (extension->type == "extensions.filters.http.gcp_authn.v3.Audience") {
// TODO(roth): In a subsequent PR, add parsing here.
}
}
// Then, try filter_metadata.
iter = kUpb_Map_Begin;
const envoy_config_core_v3_Metadata_FilterMetadataEntry* entry;
while ((entry = envoy_config_core_v3_Metadata_filter_metadata_next(
metadata, &iter)) != nullptr) {
absl::string_view key = UpbStringToAbsl(
envoy_config_core_v3_Metadata_FilterMetadataEntry_key(entry));
auto json = ParseProtobufStructToJson(
context,
envoy_config_core_v3_Metadata_FilterMetadataEntry_value(entry));
if (!json.ok()) {
ValidationErrors::ScopedField field(
&errors, absl::StrCat(".metadata.filter_metadata[", key, "]"));
errors.AddError(json.status().message());
} else if (!cds_update->metadata.contains(key)) {
cds_update->metadata[key] = std::move(*json);
}
}
{
ValidationErrors::ScopedField field(&errors, ".metadata");
cds_update->metadata = ParseXdsMetadataMap(
context, envoy_config_cluster_v3_Cluster_metadata(cluster), &errors);
}
// Return result.
if (!errors.ok()) {

@ -40,6 +40,18 @@ inline bool ParseBoolValue(const google_protobuf_BoolValue* bool_value_proto,
return google_protobuf_BoolValue_value(bool_value_proto);
}
inline absl::optional<uint64_t> ParseUInt64Value(
const google_protobuf_UInt64Value* proto) {
if (proto == nullptr) return absl::nullopt;
return google_protobuf_UInt64Value_value(proto);
}
inline absl::optional<uint32_t> ParseUInt32Value(
const google_protobuf_UInt32Value* proto) {
if (proto == nullptr) return absl::nullopt;
return google_protobuf_UInt32Value_value(proto);
}
CommonTlsContext CommonTlsContextParse(
const XdsResourceType::DecodeContext& context,
const envoy_extensions_transport_sockets_tls_v3_CommonTlsContext*

@ -52,6 +52,7 @@
#include "src/core/lib/iomgr/resolved_address.h"
#include "src/core/util/string.h"
#include "src/core/util/upb_utils.h"
#include "src/core/xds/grpc/xds_common_types_parser.h"
#include "src/core/xds/grpc/xds_health_status.h"
#include "src/core/xds/xds_client/xds_resource_type.h"
@ -126,16 +127,15 @@ absl::optional<EndpointAddresses> EndpointAddressesParse(
auto status = XdsHealthStatus::FromUpb(health_status);
if (!status.has_value()) return absl::nullopt;
// load_balancing_weight
uint32_t weight = 1;
uint32_t weight;
{
ValidationErrors::ScopedField field(errors, ".load_balancing_weight");
const google_protobuf_UInt32Value* load_balancing_weight =
envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(lb_endpoint);
if (load_balancing_weight != nullptr) {
weight = google_protobuf_UInt32Value_value(load_balancing_weight);
if (weight == 0) {
errors->AddError("must be greater than 0");
}
weight = ParseUInt32Value(
envoy_config_endpoint_v3_LbEndpoint_load_balancing_weight(
lb_endpoint))
.value_or(1);
if (weight == 0) {
errors->AddError("must be greater than 0");
}
}
// endpoint
@ -207,11 +207,11 @@ absl::optional<ParsedLocality> LocalityParse(
// load_balancing_weight
// If LB weight is not specified or 0, it means this locality is assigned
// no load.
const google_protobuf_UInt32Value* lb_weight =
envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(
locality_lb_endpoints);
parsed_locality.locality.lb_weight =
lb_weight != nullptr ? google_protobuf_UInt32Value_value(lb_weight) : 0;
ParseUInt32Value(
envoy_config_endpoint_v3_LocalityLbEndpoints_load_balancing_weight(
locality_lb_endpoints))
.value_or(0);
if (parsed_locality.locality.lb_weight == 0) return absl::nullopt;
// locality
const envoy_config_core_v3_Locality* locality =

@ -195,12 +195,12 @@ XdsHttpFaultFilter::GenerateFilterConfig(
}
}
// Section 3: Parse the maximum active faults
const auto* max_fault_wrapper =
auto max_fault_wrapper = ParseUInt32Value(
envoy_extensions_filters_http_fault_v3_HTTPFault_max_active_faults(
http_fault);
if (max_fault_wrapper != nullptr) {
http_fault));
if (max_fault_wrapper.has_value()) {
fault_injection_policy_json["maxFaults"] =
Json::FromNumber(google_protobuf_UInt32Value_value(max_fault_wrapper));
Json::FromNumber(*max_fault_wrapper);
}
return FilterConfig{ConfigProtoName(),
Json::FromObject(std::move(fault_injection_policy_json))};

@ -53,6 +53,7 @@
#include "src/core/util/upb_utils.h"
#include "src/core/xds/grpc/xds_audit_logger_registry.h"
#include "src/core/xds/grpc/xds_bootstrap_grpc.h"
#include "src/core/xds/grpc/xds_common_types_parser.h"
#include "src/core/xds/xds_client/xds_client.h"
namespace grpc_core {
@ -190,11 +191,10 @@ Json ParseCidrRangeToJson(const envoy_config_core_v3_CidrRange* range) {
json.emplace("addressPrefix",
Json::FromString(UpbStringToStdString(
envoy_config_core_v3_CidrRange_address_prefix(range))));
const auto* prefix_len = envoy_config_core_v3_CidrRange_prefix_len(range);
if (prefix_len != nullptr) {
json.emplace(
"prefixLen",
Json::FromNumber(google_protobuf_UInt32Value_value(prefix_len)));
auto prefix_len =
ParseUInt32Value(envoy_config_core_v3_CidrRange_prefix_len(range));
if (prefix_len.has_value()) {
json.emplace("prefixLen", Json::FromNumber(*prefix_len));
}
return Json::FromObject(std::move(json));
}

@ -173,23 +173,21 @@ class RingHashLbPolicyConfigFactory final
ValidationErrors::ScopedField field(errors, ".hash_function");
errors->AddError("unsupported value (must be XX_HASH)");
}
uint64_t max_ring_size = 8388608;
const auto* uint64_value =
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_maximum_ring_size(
resource);
if (uint64_value != nullptr) {
max_ring_size = google_protobuf_UInt64Value_value(uint64_value);
if (max_ring_size == 0 || max_ring_size > 8388608) {
ValidationErrors::ScopedField field(errors, ".maximum_ring_size");
errors->AddError("value must be in the range [1, 8388608]");
}
uint64_t max_ring_size =
ParseUInt64Value(
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_maximum_ring_size(
resource))
.value_or(8388608);
if (max_ring_size == 0 || max_ring_size > 8388608) {
ValidationErrors::ScopedField field(errors, ".maximum_ring_size");
errors->AddError("value must be in the range [1, 8388608]");
}
uint64_t min_ring_size = 1024;
uint64_value =
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_minimum_ring_size(
resource);
if (uint64_value != nullptr) {
min_ring_size = google_protobuf_UInt64Value_value(uint64_value);
uint64_t min_ring_size =
ParseUInt64Value(
envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_minimum_ring_size(
resource))
.value_or(1024);
{
ValidationErrors::ScopedField field(errors, ".minimum_ring_size");
if (min_ring_size == 0 || min_ring_size > 8388608) {
errors->AddError("value must be in the range [1, 8388608]");

@ -478,11 +478,11 @@ absl::optional<XdsListenerResource::FilterChainMap::CidrRange> CidrRangeParse(
}
cidr_range.address = *address;
cidr_range.prefix_len = 0;
auto* prefix_len_proto =
envoy_config_core_v3_CidrRange_prefix_len(cidr_range_proto);
if (prefix_len_proto != nullptr) {
auto value = ParseUInt32Value(
envoy_config_core_v3_CidrRange_prefix_len(cidr_range_proto));
if (value.has_value()) {
cidr_range.prefix_len = std::min(
google_protobuf_UInt32Value_value(prefix_len_proto),
*value,
(reinterpret_cast<const grpc_sockaddr*>(cidr_range.address.addr))
->sa_family == GRPC_AF_INET
? uint32_t{32}
@ -499,12 +499,11 @@ absl::optional<FilterChain::FilterChainMatch> FilterChainMatchParse(
FilterChain::FilterChainMatch filter_chain_match;
const size_t original_error_size = errors->size();
// destination_port
auto* destination_port =
auto destination_port = ParseUInt32Value(
envoy_config_listener_v3_FilterChainMatch_destination_port(
filter_chain_match_proto);
if (destination_port != nullptr) {
filter_chain_match.destination_port =
google_protobuf_UInt32Value_value(destination_port);
filter_chain_match_proto));
if (destination_port.has_value()) {
filter_chain_match.destination_port = *destination_port;
}
// prefix_ranges
size_t size = 0;

@ -0,0 +1,62 @@
//
// Copyright 2024 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.
//
#include "src/core/xds/grpc/xds_metadata.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include "absl/log/check.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
namespace grpc_core {
void XdsMetadataMap::Insert(absl::string_view key,
std::unique_ptr<XdsMetadataValue> value) {
CHECK(value != nullptr);
CHECK(map_.emplace(key, std::move(value)).second) << "duplicate key: " << key;
}
const XdsMetadataValue* XdsMetadataMap::Find(absl::string_view key) const {
auto it = map_.find(key);
if (it == map_.end()) return nullptr;
return it->second.get();
}
bool XdsMetadataMap::operator==(const XdsMetadataMap& other) const {
if (map_.size() != other.map_.size()) return false;
for (const auto& p : map_) {
auto it = other.map_.find(p.first);
if (it == other.map_.end()) return false;
if (*p.second != *it->second) return false;
}
return true;
}
std::string XdsMetadataMap::ToString() const {
std::vector<std::string> entries;
for (const auto& p : map_) {
entries.push_back(absl::StrCat(p.first, "=", p.second->ToString()));
}
std::sort(entries.begin(), entries.end());
return absl::StrCat("{", absl::StrJoin(entries, ", "), "}");
}
} // namespace grpc_core

@ -0,0 +1,127 @@
//
// Copyright 2024 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_SRC_CORE_XDS_GRPC_XDS_METADATA_H
#define GRPC_SRC_CORE_XDS_GRPC_XDS_METADATA_H
#include <memory>
#include <string>
#include <utility>
#include "absl/container/flat_hash_map.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "src/core/lib/gprpp/down_cast.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_writer.h"
namespace grpc_core {
// Interface for metadata value types.
class XdsMetadataValue {
public:
virtual ~XdsMetadataValue() = default;
// The proto message name.
virtual absl::string_view type() const = 0;
bool operator==(const XdsMetadataValue& other) const {
return type() == other.type() && Equals(other);
}
bool operator!=(const XdsMetadataValue& other) const {
return !(*this == other);
}
virtual std::string ToString() const = 0;
private:
// Called only if the type() methods return the same thing.
virtual bool Equals(const XdsMetadataValue& other) const = 0;
};
// Metadata map.
class XdsMetadataMap {
public:
void Insert(absl::string_view key, std::unique_ptr<XdsMetadataValue> value);
const XdsMetadataValue* Find(absl::string_view key) const;
bool empty() const { return map_.empty(); }
size_t size() const { return map_.size(); }
bool operator==(const XdsMetadataMap& other) const;
std::string ToString() const;
private:
absl::flat_hash_map<std::string, std::unique_ptr<XdsMetadataValue>> map_;
};
// Concrete metadata value type for google.protobuf.Struct.
class XdsStructMetadataValue : public XdsMetadataValue {
public:
explicit XdsStructMetadataValue(Json json) : json_(std::move(json)) {}
static absl::string_view Type() { return "google.protobuf.Struct"; }
absl::string_view type() const override { return Type(); }
const Json& json() const { return json_; }
std::string ToString() const override {
return absl::StrCat(type(), "{", JsonDump(json_), "}");
}
private:
bool Equals(const XdsMetadataValue& other) const override {
return json_ == DownCast<const XdsStructMetadataValue&>(other).json_;
}
Json json_;
};
// Concrete metadata value type for GCP Authn filter Audience.
class XdsGcpAuthnAudienceMetadataValue : public XdsMetadataValue {
public:
explicit XdsGcpAuthnAudienceMetadataValue(absl::string_view url)
: url_(url) {}
static absl::string_view Type() {
return "envoy.extensions.filters.http.gcp_authn.v3.Audience";
}
absl::string_view type() const override { return Type(); }
const std::string& url() const { return url_; }
std::string ToString() const override {
return absl::StrCat(type(), "{url=\"", url_, "\"}");
}
private:
bool Equals(const XdsMetadataValue& other) const override {
return url_ ==
DownCast<const XdsGcpAuthnAudienceMetadataValue&>(other).url_;
}
std::string url_;
};
} // namespace grpc_core
#endif // GRPC_SRC_CORE_XDS_GRPC_XDS_METADATA_H

@ -0,0 +1,143 @@
// Copyright 2018 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.
//
#include "src/core/xds/grpc/xds_metadata_parser.h"
#include <memory>
#include <utility>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/types/variant.h"
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h"
#include "envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h"
#include "upb/base/string_view.h"
#include "upb/text/encode.h"
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/util/string.h"
#include "src/core/util/upb_utils.h"
#include "src/core/xds/grpc/xds_common_types.h"
#include "src/core/xds/grpc/xds_common_types_parser.h"
namespace grpc_core {
// TODO(roth): Remove this once GCP auth filter support is stable.
bool XdsGcpAuthFilterEnabled() {
auto value = GetEnv("GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER");
if (!value.has_value()) return false;
bool parsed_value;
bool parse_succeeded = gpr_parse_bool_value(value->c_str(), &parsed_value);
return parse_succeeded && parsed_value;
}
namespace {
std::unique_ptr<XdsMetadataValue> ParseGcpAuthnAudience(
const XdsResourceType::DecodeContext& context, XdsExtension extension,
ValidationErrors* errors) {
absl::string_view* serialized_proto =
absl::get_if<absl::string_view>(&extension.value);
if (serialized_proto == nullptr) {
errors->AddError("could not parse audience metadata");
return nullptr;
}
auto* proto = envoy_extensions_filters_http_gcp_authn_v3_Audience_parse(
serialized_proto->data(), serialized_proto->size(), context.arena);
if (proto == nullptr) {
errors->AddError("could not parse audience metadata");
return nullptr;
}
if (GRPC_TRACE_FLAG_ENABLED_OBJ(*context.tracer) && ABSL_VLOG_IS_ON(2)) {
const upb_MessageDef* msg_type =
envoy_extensions_filters_http_gcp_authn_v3_Audience_getmsgdef(
context.symtab);
char buf[10240];
upb_TextEncode(reinterpret_cast<const upb_Message*>(proto), msg_type,
nullptr, 0, buf, sizeof(buf));
VLOG(2) << "[xds_client " << context.client
<< "] cluster metadata Audience: " << buf;
}
absl::string_view url = UpbStringToAbsl(
envoy_extensions_filters_http_gcp_authn_v3_Audience_url(proto));
if (url.empty()) {
ValidationErrors::ScopedField field(errors, ".url");
errors->AddError("must be non-empty");
return nullptr;
}
return std::make_unique<XdsGcpAuthnAudienceMetadataValue>(url);
}
} // namespace
XdsMetadataMap ParseXdsMetadataMap(
const XdsResourceType::DecodeContext& context,
const envoy_config_core_v3_Metadata* metadata, ValidationErrors* errors) {
XdsMetadataMap metadata_map;
if (metadata == nullptr) return metadata_map; // Not present == empty.
// First, try typed_filter_metadata.
size_t iter = kUpb_Map_Begin;
const envoy_config_core_v3_Metadata_TypedFilterMetadataEntry* typed_entry;
while (
(typed_entry = envoy_config_core_v3_Metadata_typed_filter_metadata_next(
metadata, &iter)) != nullptr) {
absl::string_view key = UpbStringToAbsl(
envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_key(
typed_entry));
ValidationErrors::ScopedField field(
errors, absl::StrCat(".typed_filter_metadata[", key, "]"));
auto extension = ExtractXdsExtension(
context,
envoy_config_core_v3_Metadata_TypedFilterMetadataEntry_value(
typed_entry),
errors);
if (!extension.has_value()) continue;
// TODO(roth): If we ever need to support another type here, refactor
// this into a separate registry.
if (XdsGcpAuthFilterEnabled() &&
extension->type == XdsGcpAuthnAudienceMetadataValue::Type()) {
auto metadata_value =
ParseGcpAuthnAudience(context, std::move(*extension), errors);
if (metadata_value != nullptr) {
metadata_map.Insert(key, std::move(metadata_value));
}
}
}
// Then, try filter_metadata.
iter = kUpb_Map_Begin;
const envoy_config_core_v3_Metadata_FilterMetadataEntry* entry;
while ((entry = envoy_config_core_v3_Metadata_filter_metadata_next(
metadata, &iter)) != nullptr) {
absl::string_view key = UpbStringToAbsl(
envoy_config_core_v3_Metadata_FilterMetadataEntry_key(entry));
auto json = ParseProtobufStructToJson(
context,
envoy_config_core_v3_Metadata_FilterMetadataEntry_value(entry));
if (!json.ok()) {
ValidationErrors::ScopedField field(
errors, absl::StrCat(".filter_metadata[", key, "]"));
errors->AddError(json.status().message());
}
// Add only if not already added from typed_filter_metadata.
else if (metadata_map.Find(key) == nullptr) {
metadata_map.Insert(
key, std::make_unique<XdsStructMetadataValue>(std::move(*json)));
}
}
return metadata_map;
}
} // namespace grpc_core

@ -0,0 +1,36 @@
//
// Copyright 2024 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_SRC_CORE_XDS_GRPC_XDS_METADATA_PARSER_H
#define GRPC_SRC_CORE_XDS_GRPC_XDS_METADATA_PARSER_H
#include "envoy/config/core/v3/base.upb.h"
#include "src/core/lib/gprpp/validation_errors.h"
#include "src/core/xds/grpc/xds_metadata.h"
#include "src/core/xds/xds_client/xds_resource_type.h"
namespace grpc_core {
bool XdsGcpAuthFilterEnabled();
XdsMetadataMap ParseXdsMetadataMap(
const XdsResourceType::DecodeContext& context,
const envoy_config_core_v3_Metadata* metadata, ValidationErrors* errors);
} // namespace grpc_core
#endif // GRPC_SRC_CORE_XDS_GRPC_XDS_METADATA_PARSER_H

@ -474,18 +474,13 @@ XdsRouteConfigResource::RetryPolicy RetryPolicyParse(
}
}
}
const google_protobuf_UInt32Value* num_retries =
envoy_config_route_v3_RetryPolicy_num_retries(retry_policy_proto);
if (num_retries != nullptr) {
uint32_t num_retries_value = google_protobuf_UInt32Value_value(num_retries);
if (num_retries_value == 0) {
ValidationErrors::ScopedField field(errors, ".num_retries");
errors->AddError("must be greater than 0");
} else {
retry_policy.num_retries = num_retries_value;
}
} else {
retry_policy.num_retries = 1;
retry_policy.num_retries =
ParseUInt32Value(
envoy_config_route_v3_RetryPolicy_num_retries(retry_policy_proto))
.value_or(1);
if (retry_policy.num_retries == 0) {
ValidationErrors::ScopedField field(errors, ".num_retries");
errors->AddError("must be greater than 0");
}
const envoy_config_route_v3_RetryPolicy_RetryBackOff* backoff =
envoy_config_route_v3_RetryPolicy_retry_back_off(retry_policy_proto);
@ -692,14 +687,14 @@ absl::optional<XdsRouteConfigResource::Route::RouteAction> RouteActionParse(
errors->AddError("must be non-empty");
}
// weight
const google_protobuf_UInt32Value* weight_proto =
auto weight = ParseUInt32Value(
envoy_config_route_v3_WeightedCluster_ClusterWeight_weight(
cluster_proto);
if (weight_proto == nullptr) {
cluster_proto));
if (!weight.has_value()) {
ValidationErrors::ScopedField field(errors, ".weight");
errors->AddError("field not present");
} else {
cluster.weight = google_protobuf_UInt32Value_value(weight_proto);
cluster.weight = *weight;
if (cluster.weight == 0) continue;
total_weight += cluster.weight;
}

@ -351,6 +351,14 @@ grpc_proto_library(
],
)
grpc_proto_library(
name = "gcp_authn_proto",
srcs = [
"gcp_authn.proto",
],
well_known_protos = True,
)
grpc_proto_library(
name = "metadata_proto",
srcs = [

@ -0,0 +1,45 @@
// Copyright 2024 The 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.
// Local copy of Envoy xDS proto file, used for testing only.
syntax = "proto3";
package envoy.extensions.filters.http.gcp_authn.v3;
import "google/protobuf/wrappers.proto";
// [#protodoc-title: GCP authentication]
// GCP authentication :ref:`configuration overview <config_http_filters_gcp_authn>`.
// [#extension: envoy.filters.http.gcp_authn]
// Filter configuration.
// [#next-free-field: 7]
message GcpAuthnFilterConfig {
// Token cache configuration. This field is optional.
TokenCacheConfig cache_config = 3;
}
// Audience is the URL of the receiving service that performs token authentication.
// It will be provided to the filter through cluster's typed_filter_metadata.
message Audience {
string url = 1;
}
// Token Cache configuration.
message TokenCacheConfig {
// The number of cache entries. The maximum number of entries is INT64_MAX as it is constrained by underlying cache implementation.
// Default value 0 (i.e., proto3 defaults) disables the cache by default. Other default values will enable the cache.
google.protobuf.UInt64Value cache_size = 1;
}

@ -153,6 +153,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-gen/envoy/extensions/clusters/aggregate/v3/cluster.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/router/v3/router.upb_minitable.c',
'src/core/ext/upb-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upb_minitable.c',
@ -318,6 +319,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upbdefs-gen/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
'src/core/ext/upbdefs-gen/envoy/extensions/filters/http/stateful_session/v3/stateful_session.upbdefs.c',
@ -855,6 +857,8 @@ CORE_SOURCE_FILES = [
'src/core/xds/grpc/xds_lb_policy_registry.cc',
'src/core/xds/grpc/xds_listener.cc',
'src/core/xds/grpc/xds_listener_parser.cc',
'src/core/xds/grpc/xds_metadata.cc',
'src/core/xds/grpc/xds_metadata_parser.cc',
'src/core/xds/grpc/xds_route_config.cc',
'src/core/xds/grpc/xds_route_config_parser.cc',
'src/core/xds/grpc/xds_routing.cc',

@ -230,6 +230,24 @@ grpc_cc_test(
],
)
grpc_cc_test(
name = "xds_metadata_test",
srcs = ["xds_metadata_test.cc"],
external_deps = ["gtest"],
language = "C++",
uses_event_engine = False,
uses_polling = False,
deps = [
"//:gpr",
"//:grpc",
"//src/core:grpc_xds_client",
"//src/proto/grpc/testing/xds/v3:base_proto",
"//src/proto/grpc/testing/xds/v3:gcp_authn_proto",
"//test/core/test_util:grpc_test_util",
"//test/core/test_util:scoped_env_var",
],
)
grpc_cc_test(
name = "xds_http_filters_test",
srcs = ["xds_http_filters_test.cc"],
@ -315,6 +333,7 @@ grpc_cc_test(
"//src/core:xds_health_status",
"//src/proto/grpc/testing/xds/v3:aggregate_cluster_proto",
"//src/proto/grpc/testing/xds/v3:cluster_proto",
"//src/proto/grpc/testing/xds/v3:gcp_authn_proto",
"//src/proto/grpc/testing/xds/v3:http_protocol_options_proto",
"//src/proto/grpc/testing/xds/v3:round_robin_proto",
"//src/proto/grpc/testing/xds/v3:tls_proto",

@ -58,6 +58,7 @@
#include "src/proto/grpc/testing/xds/v3/config_source.pb.h"
#include "src/proto/grpc/testing/xds/v3/endpoint.pb.h"
#include "src/proto/grpc/testing/xds/v3/extension.pb.h"
#include "src/proto/grpc/testing/xds/v3/gcp_authn.pb.h"
#include "src/proto/grpc/testing/xds/v3/health_check.pb.h"
#include "src/proto/grpc/testing/xds/v3/http_protocol_options.pb.h"
#include "src/proto/grpc/testing/xds/v3/outlier_detection.pb.h"
@ -70,6 +71,7 @@
using envoy::config::cluster::v3::Cluster;
using envoy::extensions::clusters::aggregate::v3::ClusterConfig;
using envoy::extensions::filters::http::gcp_authn::v3::Audience;
using envoy::extensions::load_balancing_policies::round_robin::v3::RoundRobin;
using envoy::extensions::load_balancing_policies::wrr_locality::v3::WrrLocality;
using envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext;
@ -84,10 +86,9 @@ class XdsClusterTest : public ::testing::Test {
protected:
XdsClusterTest()
: xds_client_(MakeXdsClient()),
decode_context_{xds_client_.get(),
*xds_client_->bootstrap().servers().front(),
&xds_cluster_resource_type_test_trace,
upb_def_pool_.ptr(), upb_arena_.ptr()} {}
decode_context_{
xds_client_.get(), *xds_client_->bootstrap().servers().front(),
&xds_unittest_trace, upb_def_pool_.ptr(), upb_arena_.ptr()} {}
static RefCountedPtr<XdsClient> MakeXdsClient() {
grpc_error_handle error;
@ -1652,23 +1653,13 @@ MATCHER_P(JsonEq, json_str, "") {
return ok;
}
TEST_F(MetadataTest, MetadataSet) {
TEST_F(MetadataTest, UntypedMetadata) {
Cluster cluster;
cluster.set_type(cluster.EDS);
cluster.mutable_eds_cluster_config()->mutable_eds_config()->mutable_self();
auto& filter_map = *cluster.mutable_metadata()->mutable_filter_metadata();
auto& label_map = *filter_map["filter_key"].mutable_fields();
*label_map["string_value"].mutable_string_value() = "abc";
label_map["bool_value"].set_bool_value(true);
label_map["number_value"].set_number_value(3.14);
label_map["null_value"].set_null_value(::google::protobuf::NULL_VALUE);
auto& list_value_values =
*label_map["list_value"].mutable_list_value()->mutable_values();
*list_value_values.Add()->mutable_string_value() = "efg";
list_value_values.Add()->set_number_value(3.14);
auto& struct_value_fields =
*label_map["struct_value"].mutable_struct_value()->mutable_fields();
struct_value_fields["bool_value"].set_bool_value(false);
std::string serialized_resource;
ASSERT_TRUE(cluster.SerializeToString(&serialized_resource));
auto* resource_type = XdsClusterResourceType::Get();
@ -1677,31 +1668,41 @@ TEST_F(MetadataTest, MetadataSet) {
ASSERT_TRUE(decode_result.resource.ok()) << decode_result.resource.status();
auto& resource =
static_cast<const XdsClusterResource&>(**decode_result.resource);
EXPECT_THAT(resource.metadata,
::testing::ElementsAre(::testing::Pair(
"filter_key", JsonEq("{"
"\"bool_value\":true,"
"\"list_value\":[\"efg\",3.14],"
"\"null_value\":null,"
"\"number_value\":3.14,"
"\"string_value\":\"abc\","
"\"struct_value\":{\"bool_value\":false}"
"}"))));
}
TEST_F(MetadataTest, MetadataUnset) {
ASSERT_EQ(resource.metadata.size(), 1);
auto* entry = resource.metadata.Find("filter_key");
ASSERT_NE(entry, nullptr);
ASSERT_EQ(entry->type(), XdsStructMetadataValue::Type());
EXPECT_THAT(DownCast<const XdsStructMetadataValue*>(entry)->json(),
JsonEq("{\"string_value\":\"abc\"}"));
}
// Test just one possible error from metadata validation, to make sure
// they're being passed through. A complete set of tests for metadata
// validation is in xds_metadata_test.cc.
TEST_F(MetadataTest, MetadataUnparseable) {
ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER");
Cluster cluster;
cluster.set_type(cluster.EDS);
cluster.mutable_eds_cluster_config()->mutable_eds_config()->mutable_self();
auto& filter_map =
*cluster.mutable_metadata()->mutable_typed_filter_metadata();
auto& entry = filter_map["filter_key"];
entry.PackFrom(Audience());
entry.set_value(std::string("\0", 1));
std::string serialized_resource;
ASSERT_TRUE(cluster.SerializeToString(&serialized_resource));
auto* resource_type = XdsClusterResourceType::Get();
auto decode_result =
resource_type->Decode(decode_context_, serialized_resource);
ASSERT_TRUE(decode_result.resource.ok()) << decode_result.resource.status();
auto& resource =
static_cast<const XdsClusterResource&>(**decode_result.resource);
EXPECT_THAT(resource.metadata, ::testing::ElementsAre());
EXPECT_EQ(decode_result.resource.status().code(),
absl::StatusCode::kInvalidArgument);
EXPECT_EQ(decode_result.resource.status().message(),
"errors validating Cluster resource: ["
"field:metadata.typed_filter_metadata[filter_key].value["
"envoy.extensions.filters.http.gcp_authn.v3.Audience] "
"error:could not parse audience metadata]")
<< decode_result.resource.status();
}
} // namespace

@ -72,10 +72,9 @@ class XdsCommonTypesTest : public ::testing::Test {
protected:
XdsCommonTypesTest()
: xds_client_(MakeXdsClient()),
decode_context_{xds_client_.get(),
*xds_client_->bootstrap().servers().front(),
&xds_common_types_test_trace, upb_def_pool_.ptr(),
upb_arena_.ptr()} {}
decode_context_{
xds_client_.get(), *xds_client_->bootstrap().servers().front(),
&xds_unittest_trace, upb_def_pool_.ptr(), upb_arena_.ptr()} {}
static RefCountedPtr<XdsClient> MakeXdsClient() {
auto bootstrap = GrpcXdsBootstrap::Create(

@ -69,10 +69,9 @@ class XdsEndpointTest : public ::testing::Test {
protected:
XdsEndpointTest()
: xds_client_(MakeXdsClient()),
decode_context_{xds_client_.get(),
*xds_client_->bootstrap().servers().front(),
&xds_endpoint_resource_type_test_trace,
upb_def_pool_.ptr(), upb_arena_.ptr()} {}
decode_context_{
xds_client_.get(), *xds_client_->bootstrap().servers().front(),
&xds_unittest_trace, upb_def_pool_.ptr(), upb_arena_.ptr()} {}
static RefCountedPtr<XdsClient> MakeXdsClient() {
grpc_error_handle error;

@ -84,10 +84,9 @@ class XdsListenerTest : public ::testing::Test {
protected:
XdsListenerTest()
: xds_client_(MakeXdsClient()),
decode_context_{xds_client_.get(),
*xds_client_->bootstrap().servers().front(),
&xds_listener_resource_type_test_trace,
upb_def_pool_.ptr(), upb_arena_.ptr()} {}
decode_context_{
xds_client_.get(), *xds_client_->bootstrap().servers().front(),
&xds_unittest_trace, upb_def_pool_.ptr(), upb_arena_.ptr()} {}
static RefCountedPtr<XdsClient> MakeXdsClient() {
grpc_error_handle error;

@ -0,0 +1,274 @@
//
// Copyright 2022 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.
//
#include "src/core/xds/grpc/xds_metadata.h"
#include <string>
#include <utility>
#include <google/protobuf/any.pb.h>
#include <google/protobuf/struct.pb.h>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_format.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/ref_counted_ptr.h"
#include "src/core/util/json/json.h"
#include "src/core/util/json/json_writer.h"
#include "src/core/xds/grpc/xds_bootstrap_grpc.h"
#include "src/core/xds/grpc/xds_metadata_parser.h"
#include "src/core/xds/xds_client/xds_bootstrap.h"
#include "src/core/xds/xds_client/xds_client.h"
#include "src/core/xds/xds_client/xds_resource_type.h"
#include "src/proto/grpc/testing/xds/v3/base.pb.h"
#include "src/proto/grpc/testing/xds/v3/gcp_authn.pb.h"
#include "test/core/test_util/scoped_env_var.h"
#include "test/core/test_util/test_config.h"
using envoy::config::core::v3::Metadata;
using envoy::extensions::filters::http::gcp_authn::v3::Audience;
namespace grpc_core {
namespace testing {
namespace {
class XdsMetadataTest : public ::testing::Test {
protected:
XdsMetadataTest()
: xds_client_(MakeXdsClient()),
decode_context_{
xds_client_.get(), *xds_client_->bootstrap().servers().front(),
&xds_unittest_trace, upb_def_pool_.ptr(), upb_arena_.ptr()} {}
static RefCountedPtr<XdsClient> MakeXdsClient() {
auto bootstrap = GrpcXdsBootstrap::Create(
"{\n"
" \"xds_servers\": [\n"
" {\n"
" \"server_uri\": \"xds.example.com\",\n"
" \"channel_creds\": [\n"
" {\"type\": \"google_default\"}\n"
" ]\n"
" }\n"
" ]\n"
"}");
if (!bootstrap.ok()) {
Crash(absl::StrFormat("Error parsing bootstrap: %s",
bootstrap.status().ToString().c_str()));
}
return MakeRefCounted<XdsClient>(std::move(*bootstrap),
/*transport_factory=*/nullptr,
/*event_engine=*/nullptr,
/*metrics_reporter=*/nullptr, "foo agent",
"foo version");
}
// For convenience, tests build protos using the protobuf API and then
// use this function to convert it to a upb object, which can be
// passed to ParseXdsMetadataMap() for validation.
const envoy_config_core_v3_Metadata* ConvertToUpb(Metadata proto) {
// Serialize the protobuf proto.
std::string serialized_proto;
if (!proto.SerializeToString(&serialized_proto)) {
EXPECT_TRUE(false) << "protobuf serialization failed";
return nullptr;
}
// Deserialize as upb proto.
const auto* upb_proto = envoy_config_core_v3_Metadata_parse(
serialized_proto.data(), serialized_proto.size(), upb_arena_.ptr());
if (upb_proto == nullptr) {
EXPECT_TRUE(false) << "upb parsing failed";
return nullptr;
}
return upb_proto;
}
absl::StatusOr<XdsMetadataMap> Parse(
const envoy_config_core_v3_Metadata* upb_proto) {
ValidationErrors errors;
XdsMetadataMap metadata_map =
ParseXdsMetadataMap(decode_context_, upb_proto, &errors);
if (!errors.ok()) {
return errors.status(absl::StatusCode::kInvalidArgument,
"validation failed");
}
return metadata_map;
}
absl::StatusOr<XdsMetadataMap> Decode(Metadata proto) {
const envoy_config_core_v3_Metadata* upb_proto =
ConvertToUpb(std::move(proto));
return Parse(upb_proto);
}
RefCountedPtr<XdsClient> xds_client_;
upb::DefPool upb_def_pool_;
upb::Arena upb_arena_;
XdsResourceType::DecodeContext decode_context_;
};
MATCHER_P(JsonEq, json_str, "") {
std::string actual = JsonDump(arg);
bool ok = ::testing::ExplainMatchResult(json_str, actual, result_listener);
if (!ok) *result_listener << "Actual: " << actual;
return ok;
}
TEST_F(XdsMetadataTest, UntypedMetadata) {
Metadata metadata_proto;
auto& filter_map = *metadata_proto.mutable_filter_metadata();
auto& label_map = *filter_map["filter_key"].mutable_fields();
*label_map["string_value"].mutable_string_value() = "abc";
label_map["bool_value"].set_bool_value(true);
label_map["number_value"].set_number_value(3.14);
label_map["null_value"].set_null_value(::google::protobuf::NULL_VALUE);
auto& list_value_values =
*label_map["list_value"].mutable_list_value()->mutable_values();
*list_value_values.Add()->mutable_string_value() = "efg";
list_value_values.Add()->set_number_value(3.14);
auto& struct_value_fields =
*label_map["struct_value"].mutable_struct_value()->mutable_fields();
struct_value_fields["bool_value"].set_bool_value(false);
// Decode.
auto metadata_map = Decode(std::move(metadata_proto));
ASSERT_TRUE(metadata_map.ok()) << metadata_map.status();
ASSERT_EQ(metadata_map->size(), 1);
auto* entry = metadata_map->Find("filter_key");
ASSERT_NE(entry, nullptr);
ASSERT_EQ(XdsStructMetadataValue::Type(), entry->type());
EXPECT_THAT(DownCast<const XdsStructMetadataValue*>(entry)->json(),
JsonEq("{"
"\"bool_value\":true,"
"\"list_value\":[\"efg\",3.14],"
"\"null_value\":null,"
"\"number_value\":3.14,"
"\"string_value\":\"abc\","
"\"struct_value\":{\"bool_value\":false}"
"}"));
}
TEST_F(XdsMetadataTest, TypedMetadataTakesPrecendenceOverUntyped) {
ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER");
Metadata metadata_proto;
auto& filter_map = *metadata_proto.mutable_filter_metadata();
auto& label_map = *filter_map["filter_key"].mutable_fields();
*label_map["string_value"].mutable_string_value() = "abc";
Audience audience_proto;
audience_proto.set_url("foo");
auto& typed_filter_map = *metadata_proto.mutable_typed_filter_metadata();
typed_filter_map["filter_key"].PackFrom(audience_proto);
// Decode.
auto metadata_map = Decode(std::move(metadata_proto));
ASSERT_TRUE(metadata_map.ok()) << metadata_map.status();
ASSERT_EQ(metadata_map->size(), 1);
auto* entry = metadata_map->Find("filter_key");
ASSERT_NE(entry, nullptr);
ASSERT_EQ(XdsGcpAuthnAudienceMetadataValue::Type(), entry->type());
EXPECT_EQ(DownCast<const XdsGcpAuthnAudienceMetadataValue*>(entry)->url(),
"foo");
}
TEST_F(XdsMetadataTest, AudienceMetadata) {
ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER");
Audience audience_proto;
audience_proto.set_url("foo");
Metadata metadata_proto;
auto& filter_map = *metadata_proto.mutable_typed_filter_metadata();
filter_map["filter_key"].PackFrom(audience_proto);
// Decode.
auto metadata_map = Decode(std::move(metadata_proto));
ASSERT_TRUE(metadata_map.ok()) << metadata_map.status();
ASSERT_EQ(metadata_map->size(), 1);
auto* entry = metadata_map->Find("filter_key");
ASSERT_NE(entry, nullptr);
ASSERT_EQ(XdsGcpAuthnAudienceMetadataValue::Type(), entry->type());
EXPECT_EQ(DownCast<const XdsGcpAuthnAudienceMetadataValue*>(entry)->url(),
"foo");
}
TEST_F(XdsMetadataTest, AudienceMetadataUnparseable) {
ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER");
Metadata metadata_proto;
auto& filter_map = *metadata_proto.mutable_typed_filter_metadata();
auto& entry = filter_map["filter_key"];
entry.PackFrom(Audience());
entry.set_value(std::string("\0", 1));
// Decode.
auto metadata_map = Decode(std::move(metadata_proto));
EXPECT_EQ(metadata_map.status().code(), absl::StatusCode::kInvalidArgument);
EXPECT_EQ(metadata_map.status().message(),
"validation failed: ["
"field:typed_filter_metadata[filter_key].value["
"envoy.extensions.filters.http.gcp_authn.v3.Audience] "
"error:could not parse audience metadata]")
<< metadata_map.status();
}
TEST_F(XdsMetadataTest, AudienceMetadataMissingUrl) {
ScopedExperimentalEnvVar env_var(
"GRPC_EXPERIMENTAL_XDS_GCP_AUTHENTICATION_FILTER");
Metadata metadata_proto;
auto& filter_map = *metadata_proto.mutable_typed_filter_metadata();
filter_map["filter_key"].PackFrom(Audience());
// Decode.
auto metadata_map = Decode(std::move(metadata_proto));
EXPECT_EQ(metadata_map.status().code(), absl::StatusCode::kInvalidArgument);
EXPECT_EQ(metadata_map.status().message(),
"validation failed: ["
"field:typed_filter_metadata[filter_key].value["
"envoy.extensions.filters.http.gcp_authn.v3.Audience].url "
"error:must be non-empty]")
<< metadata_map.status();
}
TEST_F(XdsMetadataTest, AudienceIgnoredIfNotEnabled) {
Audience audience_proto;
audience_proto.set_url("foo");
Metadata metadata_proto;
auto& filter_map = *metadata_proto.mutable_typed_filter_metadata();
filter_map["filter_key"].PackFrom(audience_proto);
// Decode.
auto metadata_map = Decode(std::move(metadata_proto));
ASSERT_TRUE(metadata_map.ok()) << metadata_map.status();
EXPECT_EQ(metadata_map->size(), 0);
}
TEST_F(XdsMetadataTest, MetadataUnset) {
auto metadata_map = Parse(nullptr);
ASSERT_TRUE(metadata_map.ok()) << metadata_map.status();
EXPECT_EQ(metadata_map->size(), 0);
}
} // namespace
} // namespace testing
} // namespace grpc_core
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
grpc::testing::TestEnvironment env(&argc, argv);
grpc_init();
int ret = RUN_ALL_TESTS();
grpc_shutdown();
return ret;
}

@ -81,10 +81,9 @@ class XdsRouteConfigTest : public ::testing::Test {
protected:
explicit XdsRouteConfigTest(bool trusted_xds_server = false)
: xds_client_(MakeXdsClient(trusted_xds_server)),
decode_context_{xds_client_.get(),
*xds_client_->bootstrap().servers().front(),
&xds_route_config_resource_type_test_trace,
upb_def_pool_.ptr(), upb_arena_.ptr()} {}
decode_context_{
xds_client_.get(), *xds_client_->bootstrap().servers().front(),
&xds_unittest_trace, upb_def_pool_.ptr(), upb_arena_.ptr()} {}
static RefCountedPtr<XdsClient> MakeXdsClient(bool trusted_xds_server) {
auto bootstrap = GrpcXdsBootstrap::Create(

@ -1476,6 +1476,9 @@ src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitabl
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h \
@ -1903,6 +1906,8 @@ src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.
src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
@ -3015,6 +3020,10 @@ src/core/xds/grpc/xds_listener.cc \
src/core/xds/grpc/xds_listener.h \
src/core/xds/grpc/xds_listener_parser.cc \
src/core/xds/grpc/xds_listener_parser.h \
src/core/xds/grpc/xds_metadata.cc \
src/core/xds/grpc/xds_metadata.h \
src/core/xds/grpc/xds_metadata_parser.cc \
src/core/xds/grpc/xds_metadata_parser.h \
src/core/xds/grpc/xds_route_config.cc \
src/core/xds/grpc/xds_route_config.h \
src/core/xds/grpc/xds_route_config_parser.cc \

@ -1243,6 +1243,9 @@ src/core/ext/upb-gen/envoy/extensions/filters/common/fault/v3/fault.upb_minitabl
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/fault/v3/fault.upb_minitable.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb.h \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.c \
src/core/ext/upb-gen/envoy/extensions/filters/http/rbac/v3/rbac.upb_minitable.h \
@ -1670,6 +1673,8 @@ src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.
src/core/ext/upbdefs-gen/envoy/extensions/filters/common/fault/v3/fault.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/fault/v3/fault.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.c \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/rbac/v3/rbac.upbdefs.h \
src/core/ext/upbdefs-gen/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
@ -2793,6 +2798,10 @@ src/core/xds/grpc/xds_listener.cc \
src/core/xds/grpc/xds_listener.h \
src/core/xds/grpc/xds_listener_parser.cc \
src/core/xds/grpc/xds_listener_parser.h \
src/core/xds/grpc/xds_metadata.cc \
src/core/xds/grpc/xds_metadata.h \
src/core/xds/grpc/xds_metadata_parser.cc \
src/core/xds/grpc/xds_metadata_parser.h \
src/core/xds/grpc/xds_route_config.cc \
src/core/xds/grpc/xds_route_config.h \
src/core/xds/grpc/xds_route_config_parser.cc \

@ -12247,6 +12247,30 @@
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,
"ci_platforms": [
"linux",
"mac",
"posix",
"windows"
],
"cpu_cost": 1.0,
"exclude_configs": [],
"exclude_iomgrs": [],
"flaky": false,
"gtest": true,
"language": "c++",
"name": "xds_metadata_test",
"platforms": [
"linux",
"mac",
"posix",
"windows"
],
"uses_polling": false
},
{
"args": [],
"benchmark": false,

Loading…
Cancel
Save