diff --git a/BUILD b/BUILD index f1efe67fdd1..cffec640d92 100644 --- a/BUILD +++ b/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"], diff --git a/CMakeLists.txt b/CMakeLists.txt index ff82bc71644..3e9f6efd927 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Makefile b/Makefile index 4da690fad14..aff525ee1de 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/Package.swift b/Package.swift index c961e86c733..6b6efd5b851 100644 --- a/Package.swift +++ b/Package.swift @@ -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", diff --git a/build_autogenerated.yaml b/build_autogenerated.yaml index 74a7ec764a5..cfbb244d513 100644 --- a/build_autogenerated.yaml +++ b/build_autogenerated.yaml @@ -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 diff --git a/config.m4 b/config.m4 index 00e99a729af..d788623260b 100644 --- a/config.m4 +++ b/config.m4 @@ -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) diff --git a/config.w32 b/config.w32 index e7bc1d8aac8..44f4cda251d 100644 --- a/config.w32 +++ b/config.w32 @@ -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"); diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index b38dd523470..e88102ca5d4 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -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', diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index a623cc501e5..308b9a5a2b7 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -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', diff --git a/grpc.gemspec b/grpc.gemspec index 90311d3ce38..d4f2c1aeca7 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -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 ) diff --git a/package.xml b/package.xml index 4493c88e966..83c86c5693d 100644 --- a/package.xml +++ b/package.xml @@ -453,6 +453,9 @@ + + + @@ -880,6 +883,8 @@ + + @@ -1991,6 +1996,10 @@ + + + + diff --git a/src/core/BUILD b/src/core/BUILD index 62dfec0eb41..07dec2bba1d 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -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"], diff --git a/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h b/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h new file mode 100644 index 00000000000..d98d03a9c10 --- /dev/null +++ b/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb.h @@ -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_ */ diff --git a/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c b/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c new file mode 100644 index 00000000000..c81951d563d --- /dev/null +++ b/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.c @@ -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 +#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" + diff --git a/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h b/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h new file mode 100644 index 00000000000..ae92576dbb4 --- /dev/null +++ b/src/core/ext/upb-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upb_minitable.h @@ -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_ */ diff --git a/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c b/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c new file mode 100644 index 00000000000..46edcb75a25 --- /dev/null +++ b/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.c @@ -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) +}; diff --git a/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h b/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h new file mode 100644 index 00000000000..54b22313e30 --- /dev/null +++ b/src/core/ext/upbdefs-gen/envoy/extensions/filters/http/gcp_authn/v3/gcp_authn.upbdefs.h @@ -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_ */ diff --git a/src/core/lib/debug/trace_flags.cc b/src/core/lib/debug/trace_flags.cc index 8f7183782c8..85b5f6f9ee2 100644 --- a/src/core/lib/debug/trace_flags.cc +++ b/src/core/lib/debug/trace_flags.cc @@ -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& GetAllTraceFlags() { @@ -215,18 +207,10 @@ const absl::flat_hash_map& 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}, diff --git a/src/core/lib/debug/trace_flags.h b/src/core/lib/debug/trace_flags.h index 9aa4df691f0..f185adb65ec 100644 --- a/src/core/lib/debug/trace_flags.h +++ b/src/core/lib/debug/trace_flags.h @@ -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 diff --git a/src/core/lib/debug/trace_flags.yaml b/src/core/lib/debug/trace_flags.yaml index 64c665af799..11889710dcb 100644 --- a/src/core/lib/debug/trace_flags.yaml +++ b/src/core/lib/debug/trace_flags.yaml @@ -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. diff --git a/src/core/load_balancing/xds/xds_cluster_impl.cc b/src/core/load_balancing/xds/xds_cluster_impl.cc index a53094da485..e66330a21da 100644 --- a/src/core/load_balancing/xds/xds_cluster_impl.cc +++ b/src/core/load_balancing/xds/xds_cluster_impl.cc @@ -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(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 diff --git a/src/core/xds/grpc/xds_cluster.cc b/src/core/xds/grpc/xds_cluster.cc index eae5a95d398..1f0c6b05cbf 100644 --- a/src/core/xds/grpc/xds_cluster.cc +++ b/src/core/xds/grpc/xds_cluster.cc @@ -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 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, ", "), "}"); } diff --git a/src/core/xds/grpc/xds_cluster.h b/src/core/xds/grpc/xds_cluster.h index a0d087d8196..7021b61b300 100644 --- a/src/core/xds/grpc/xds_cluster.h +++ b/src/core/xds/grpc/xds_cluster.h @@ -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 metadata; + XdsMetadataMap metadata; bool operator==(const XdsClusterResource& other) const { return type == other.type && lb_policy_config == other.lb_policy_config && diff --git a/src/core/xds/grpc/xds_cluster_parser.cc b/src/core/xds/grpc/xds_cluster_parser.cc index 2d06762b5a8..bcf07881f4c 100644 --- a/src/core/xds/grpc/xds_cluster_parser.cc +++ b/src/core/xds/grpc/xds_cluster_parser.cc @@ -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> 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> 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> 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()) { diff --git a/src/core/xds/grpc/xds_common_types_parser.h b/src/core/xds/grpc/xds_common_types_parser.h index b73a04ec99a..4d145394166 100644 --- a/src/core/xds/grpc/xds_common_types_parser.h +++ b/src/core/xds/grpc/xds_common_types_parser.h @@ -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 ParseUInt64Value( + const google_protobuf_UInt64Value* proto) { + if (proto == nullptr) return absl::nullopt; + return google_protobuf_UInt64Value_value(proto); +} + +inline absl::optional 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* diff --git a/src/core/xds/grpc/xds_endpoint_parser.cc b/src/core/xds/grpc/xds_endpoint_parser.cc index 63fb15eda89..011a739c4a1 100644 --- a/src/core/xds/grpc/xds_endpoint_parser.cc +++ b/src/core/xds/grpc/xds_endpoint_parser.cc @@ -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 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 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 = diff --git a/src/core/xds/grpc/xds_http_fault_filter.cc b/src/core/xds/grpc/xds_http_fault_filter.cc index 846a4b490d4..e46eeb79f1b 100644 --- a/src/core/xds/grpc/xds_http_fault_filter.cc +++ b/src/core/xds/grpc/xds_http_fault_filter.cc @@ -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))}; diff --git a/src/core/xds/grpc/xds_http_rbac_filter.cc b/src/core/xds/grpc/xds_http_rbac_filter.cc index 3fadf5d2ebf..64a793abad7 100644 --- a/src/core/xds/grpc/xds_http_rbac_filter.cc +++ b/src/core/xds/grpc/xds_http_rbac_filter.cc @@ -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)); } diff --git a/src/core/xds/grpc/xds_lb_policy_registry.cc b/src/core/xds/grpc/xds_lb_policy_registry.cc index 6aa25a9b694..67b98058272 100644 --- a/src/core/xds/grpc/xds_lb_policy_registry.cc +++ b/src/core/xds/grpc/xds_lb_policy_registry.cc @@ -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]"); diff --git a/src/core/xds/grpc/xds_listener_parser.cc b/src/core/xds/grpc/xds_listener_parser.cc index 1c8ef65c5cf..b536472a80f 100644 --- a/src/core/xds/grpc/xds_listener_parser.cc +++ b/src/core/xds/grpc/xds_listener_parser.cc @@ -478,11 +478,11 @@ absl::optional 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(cidr_range.address.addr)) ->sa_family == GRPC_AF_INET ? uint32_t{32} @@ -499,12 +499,11 @@ absl::optional 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; diff --git a/src/core/xds/grpc/xds_metadata.cc b/src/core/xds/grpc/xds_metadata.cc new file mode 100644 index 00000000000..b14ad78896a --- /dev/null +++ b/src/core/xds/grpc/xds_metadata.cc @@ -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 +#include +#include +#include + +#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 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 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 diff --git a/src/core/xds/grpc/xds_metadata.h b/src/core/xds/grpc/xds_metadata.h new file mode 100644 index 00000000000..4e784d90d25 --- /dev/null +++ b/src/core/xds/grpc/xds_metadata.h @@ -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 +#include +#include + +#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 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> 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(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(other).url_; + } + + std::string url_; +}; + +} // namespace grpc_core + +#endif // GRPC_SRC_CORE_XDS_GRPC_XDS_METADATA_H diff --git a/src/core/xds/grpc/xds_metadata_parser.cc b/src/core/xds/grpc/xds_metadata_parser.cc new file mode 100644 index 00000000000..90f11a79cae --- /dev/null +++ b/src/core/xds/grpc/xds_metadata_parser.cc @@ -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 +#include + +#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 ParseGcpAuthnAudience( + const XdsResourceType::DecodeContext& context, XdsExtension extension, + ValidationErrors* errors) { + absl::string_view* serialized_proto = + absl::get_if(&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(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(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(std::move(*json))); + } + } + return metadata_map; +} + +} // namespace grpc_core diff --git a/src/core/xds/grpc/xds_metadata_parser.h b/src/core/xds/grpc/xds_metadata_parser.h new file mode 100644 index 00000000000..f3d0a522ab1 --- /dev/null +++ b/src/core/xds/grpc/xds_metadata_parser.h @@ -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 diff --git a/src/core/xds/grpc/xds_route_config_parser.cc b/src/core/xds/grpc/xds_route_config_parser.cc index 45096c5b999..d6ac0f858a7 100644 --- a/src/core/xds/grpc/xds_route_config_parser.cc +++ b/src/core/xds/grpc/xds_route_config_parser.cc @@ -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 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; } diff --git a/src/proto/grpc/testing/xds/v3/BUILD b/src/proto/grpc/testing/xds/v3/BUILD index 073c24dd017..15b8e0796c0 100644 --- a/src/proto/grpc/testing/xds/v3/BUILD +++ b/src/proto/grpc/testing/xds/v3/BUILD @@ -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 = [ diff --git a/src/proto/grpc/testing/xds/v3/gcp_authn.proto b/src/proto/grpc/testing/xds/v3/gcp_authn.proto new file mode 100644 index 00000000000..e24500fe5cd --- /dev/null +++ b/src/proto/grpc/testing/xds/v3/gcp_authn.proto @@ -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 `. +// [#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; +} diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 65b4ee11368..1bd00485826 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -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', diff --git a/test/core/xds/BUILD b/test/core/xds/BUILD index 09a6553037a..f91ac8e1009 100644 --- a/test/core/xds/BUILD +++ b/test/core/xds/BUILD @@ -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", diff --git a/test/core/xds/xds_cluster_resource_type_test.cc b/test/core/xds/xds_cluster_resource_type_test.cc index 57d2eb7c51b..23ce91782d3 100644 --- a/test/core/xds/xds_cluster_resource_type_test.cc +++ b/test/core/xds/xds_cluster_resource_type_test.cc @@ -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 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(**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(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(**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 diff --git a/test/core/xds/xds_common_types_test.cc b/test/core/xds/xds_common_types_test.cc index b19a885a79e..d940015cc8f 100644 --- a/test/core/xds/xds_common_types_test.cc +++ b/test/core/xds/xds_common_types_test.cc @@ -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 MakeXdsClient() { auto bootstrap = GrpcXdsBootstrap::Create( diff --git a/test/core/xds/xds_endpoint_resource_type_test.cc b/test/core/xds/xds_endpoint_resource_type_test.cc index 82fc99cd94b..bd365c63836 100644 --- a/test/core/xds/xds_endpoint_resource_type_test.cc +++ b/test/core/xds/xds_endpoint_resource_type_test.cc @@ -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 MakeXdsClient() { grpc_error_handle error; diff --git a/test/core/xds/xds_listener_resource_type_test.cc b/test/core/xds/xds_listener_resource_type_test.cc index 6106a8cda7e..39419318b74 100644 --- a/test/core/xds/xds_listener_resource_type_test.cc +++ b/test/core/xds/xds_listener_resource_type_test.cc @@ -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 MakeXdsClient() { grpc_error_handle error; diff --git a/test/core/xds/xds_metadata_test.cc b/test/core/xds/xds_metadata_test.cc new file mode 100644 index 00000000000..ad489b45464 --- /dev/null +++ b/test/core/xds/xds_metadata_test.cc @@ -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 +#include + +#include +#include + +#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 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(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 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 Decode(Metadata proto) { + const envoy_config_core_v3_Metadata* upb_proto = + ConvertToUpb(std::move(proto)); + return Parse(upb_proto); + } + + RefCountedPtr 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(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(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(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; +} diff --git a/test/core/xds/xds_route_config_resource_type_test.cc b/test/core/xds/xds_route_config_resource_type_test.cc index 0cfccea682a..de1bb3e245f 100644 --- a/test/core/xds/xds_route_config_resource_type_test.cc +++ b/test/core/xds/xds_route_config_resource_type_test.cc @@ -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 MakeXdsClient(bool trusted_xds_server) { auto bootstrap = GrpcXdsBootstrap::Create( diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index c1790c49ad1..688e4b2b5e6 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -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 \ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 32375b76278..da4ee1e889d 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -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 \ diff --git a/tools/run_tests/generated/tests.json b/tools/run_tests/generated/tests.json index d4d85942684..df179bbb3da 100644 --- a/tools/run_tests/generated/tests.json +++ b/tools/run_tests/generated/tests.json @@ -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,