Second attempt: xDS HTTP filter support for gRPC client (#25558)

* Revert "Revert "xDS HTTP filter support for gRPC client" (#25555)"

This reverts commit 785a128a83.

* xds_end2end_test: avoid flakes from lingering shutdown from previous test
pull/25572/head
Mark D. Roth 4 years ago committed by GitHub
parent bc69f0aec1
commit 49601b0334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 47
      BUILD
  2. 10
      BUILD.gn
  3. 12
      CMakeLists.txt
  4. 10
      Makefile
  5. 11
      build_autogenerated.yaml
  6. 9
      config.m4
  7. 15
      config.w32
  8. 10
      gRPC-C++.podspec
  9. 15
      gRPC-Core.podspec
  10. 10
      grpc.gemspec
  11. 5
      grpc.gyp
  12. 10
      package.xml
  13. 3
      src/core/ext/filters/client_channel/client_channel.cc
  14. 8
      src/core/ext/filters/client_channel/config_selector.h
  15. 13
      src/core/ext/filters/client_channel/dynamic_filters.cc
  16. 259
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  17. 41
      src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
  18. 113
      src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
  19. 33
      src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
  20. 77
      src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
  21. 76
      src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
  22. 35
      src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h
  23. 44
      src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
  24. 35
      src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
  25. 580
      src/core/ext/xds/xds_api.cc
  26. 52
      src/core/ext/xds/xds_api.h
  27. 10
      src/core/ext/xds/xds_client.cc
  28. 107
      src/core/ext/xds/xds_http_filters.cc
  29. 124
      src/core/ext/xds/xds_http_filters.h
  30. 12
      src/core/lib/channel/channel_stack.cc
  31. 7
      src/core/lib/channel/channel_stack.h
  32. 57
      src/core/lib/surface/lame_client.cc
  33. 7
      src/core/lib/surface/lame_client.h
  34. 8
      src/proto/grpc/testing/xds/v3/BUILD
  35. 22
      src/proto/grpc/testing/xds/v3/http_connection_manager.proto
  36. 32
      src/proto/grpc/testing/xds/v3/route.proto
  37. 28
      src/proto/grpc/testing/xds/v3/router.proto
  38. 5
      src/python/grpcio/grpc_core_dependencies.py
  39. 1
      test/cpp/end2end/BUILD
  40. 559
      test/cpp/end2end/xds_end2end_test.cc
  41. 2
      tools/codegen/core/gen_upb_api.sh
  42. 10
      tools/doxygen/Doxyfile.c++.internal
  43. 10
      tools/doxygen/Doxyfile.core.internal

47
BUILD

@ -1375,6 +1375,7 @@ grpc_cc_library(
"src/core/ext/xds/xds_certificate_provider.cc",
"src/core/ext/xds/xds_client.cc",
"src/core/ext/xds/xds_client_stats.cc",
"src/core/ext/xds/xds_http_filters.cc",
"src/core/lib/security/credentials/xds/xds_credentials.cc",
],
hdrs = [
@ -1388,6 +1389,7 @@ grpc_cc_library(
"src/core/ext/xds/xds_channel_args.h",
"src/core/ext/xds/xds_client.h",
"src/core/ext/xds/xds_client_stats.h",
"src/core/ext/xds/xds_http_filters.h",
"src/core/lib/security/credentials/xds/xds_credentials.h",
],
external_deps = [
@ -1405,6 +1407,8 @@ grpc_cc_library(
"grpc_client_channel",
"grpc_secure",
"grpc_transport_chttp2_client_secure",
"udpa_type_upb",
"udpa_type_upbdefs",
],
)
@ -2646,6 +2650,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c",
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c",
"src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c",
@ -2679,6 +2684,7 @@ grpc_cc_library(
"src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h",
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
"src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h",
@ -2729,6 +2735,7 @@ grpc_cc_library(
"src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c",
@ -2761,6 +2768,7 @@ grpc_cc_library(
"src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h",
@ -3193,6 +3201,45 @@ grpc_cc_library(
],
)
grpc_cc_library(
name = "udpa_type_upb",
srcs = [
"src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c",
],
hdrs = [
"src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h",
],
external_deps = [
"upb_lib",
"upb_lib_descriptor",
],
language = "c++",
deps = [
":google_api_upb",
":proto_gen_validate_upb",
],
)
grpc_cc_library(
name = "udpa_type_upbdefs",
srcs = [
"src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c",
],
hdrs = [
"src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h",
],
external_deps = [
"upb_lib",
"upb_lib_descriptor_reflection",
"upb_textformat_lib",
],
language = "c++",
deps = [
":google_api_upbdefs",
":proto_gen_validate_upbdefs",
],
)
# Once upb code-gen issue is resolved, replace grpc_health_upb with this.
# grpc_upb_proto_library(
# name = "grpc_health_upb",

@ -462,6 +462,8 @@ config("grpc_config") {
"src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c",
"src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h",
"src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c",
"src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c",
"src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h",
"src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c",
@ -556,6 +558,8 @@ config("grpc_config") {
"src/core/ext/upb-generated/udpa/annotations/versioning.upb.h",
"src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c",
"src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h",
"src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c",
"src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h",
"src/core/ext/upb-generated/validate/validate.upb.c",
"src/core/ext/upb-generated/validate/validate.upb.h",
"src/core/ext/upb-generated/xds/core/v3/authority.upb.c",
@ -634,6 +638,8 @@ config("grpc_config") {
"src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c",
"src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h",
"src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c",
@ -712,6 +718,8 @@ config("grpc_config") {
"src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h",
"src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c",
"src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h",
"src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c",
"src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h",
"src/core/ext/upbdefs-generated/validate/validate.upbdefs.c",
"src/core/ext/upbdefs-generated/validate/validate.upbdefs.h",
"src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c",
@ -744,6 +752,8 @@ config("grpc_config") {
"src/core/ext/xds/xds_client.h",
"src/core/ext/xds/xds_client_stats.cc",
"src/core/ext/xds/xds_client_stats.h",
"src/core/ext/xds/xds_http_filters.cc",
"src/core/ext/xds/xds_http_filters.h",
"src/core/ext/xds/xds_server_config_fetcher.cc",
"src/core/lib/avl/avl.cc",
"src/core/lib/avl/avl.h",

@ -502,6 +502,9 @@ protobuf_generate_grpc_cpp(
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/route.proto
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/router.proto
)
protobuf_generate_grpc_cpp(
src/proto/grpc/testing/xds/v3/string.proto
)
@ -1589,6 +1592,7 @@ add_library(grpc
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@ -1636,6 +1640,7 @@ add_library(grpc
src/core/ext/upb-generated/udpa/annotations/status.upb.c
src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
src/core/ext/upb-generated/validate/validate.upb.c
src/core/ext/upb-generated/xds/core/v3/authority.upb.c
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
@ -1675,6 +1680,7 @@ add_library(grpc
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
@ -1714,6 +1720,7 @@ add_library(grpc
src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
@ -1729,6 +1736,7 @@ add_library(grpc
src/core/ext/xds/xds_certificate_provider.cc
src/core/ext/xds/xds_client.cc
src/core/ext/xds/xds_client_stats.cc
src/core/ext/xds/xds_http_filters.cc
src/core/ext/xds/xds_server_config_fetcher.cc
src/core/lib/avl/avl.cc
src/core/lib/backoff/backoff.cc
@ -15710,6 +15718,10 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/route.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/route.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/route.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/router.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/router.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/router.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/router.grpc.pb.h
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/string.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/string.grpc.pb.cc
${_gRPC_PROTO_GENS_DIR}/src/proto/grpc/testing/xds/v3/string.pb.h

@ -1172,6 +1172,7 @@ LIBGRPC_SRC = \
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c \
@ -1219,6 +1220,7 @@ LIBGRPC_SRC = \
src/core/ext/upb-generated/udpa/annotations/status.upb.c \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c \
@ -1258,6 +1260,7 @@ LIBGRPC_SRC = \
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c \
@ -1297,6 +1300,7 @@ LIBGRPC_SRC = \
src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c \
@ -1312,6 +1316,7 @@ LIBGRPC_SRC = \
src/core/ext/xds/xds_certificate_provider.cc \
src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client_stats.cc \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
@ -2693,6 +2698,7 @@ src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c: $(OPENS
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c: $(OPENSSL_DEP)
@ -2726,6 +2732,7 @@ src/core/ext/upb-generated/udpa/annotations/security.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/udpa/annotations/sensitive.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/udpa/annotations/status.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/udpa/annotations/versioning.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/xds/core/v3/authority.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c: $(OPENSSL_DEP)
src/core/ext/upb-generated/xds/core/v3/context_params.upb.c: $(OPENSSL_DEP)
@ -2764,6 +2771,7 @@ src/core/ext/upbdefs-generated/envoy/config/route/v3/route_components.upbdefs.c:
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c: $(OPENSSL_DEP)
@ -2803,6 +2811,7 @@ src/core/ext/upbdefs-generated/udpa/annotations/security.upbdefs.c: $(OPENSSL_DE
src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c: $(OPENSSL_DEP)
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c: $(OPENSSL_DEP)
@ -2818,6 +2827,7 @@ src/core/ext/xds/xds_bootstrap.cc: $(OPENSSL_DEP)
src/core/ext/xds/xds_certificate_provider.cc: $(OPENSSL_DEP)
src/core/ext/xds/xds_client.cc: $(OPENSSL_DEP)
src/core/ext/xds/xds_client_stats.cc: $(OPENSSL_DEP)
src/core/ext/xds/xds_http_filters.cc: $(OPENSSL_DEP)
src/core/ext/xds/xds_server_config_fetcher.cc: $(OPENSSL_DEP)
src/core/lib/http/httpcli_security_connector.cc: $(OPENSSL_DEP)
src/core/lib/security/authorization/authorization_engine.cc: $(OPENSSL_DEP)

@ -500,6 +500,7 @@ libs:
- src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h
- src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h
- src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h
- src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h
@ -547,6 +548,7 @@ libs:
- src/core/ext/upb-generated/udpa/annotations/status.upb.h
- src/core/ext/upb-generated/udpa/annotations/versioning.upb.h
- src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h
- src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h
- src/core/ext/upb-generated/validate/validate.upb.h
- src/core/ext/upb-generated/xds/core/v3/authority.upb.h
- src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h
@ -586,6 +588,7 @@ libs:
- src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h
@ -625,6 +628,7 @@ libs:
- src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h
- src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h
- src/core/ext/upbdefs-generated/validate/validate.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h
- src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h
@ -642,6 +646,7 @@ libs:
- src/core/ext/xds/xds_channel_args.h
- src/core/ext/xds/xds_client.h
- src/core/ext/xds/xds_client_stats.h
- src/core/ext/xds/xds_http_filters.h
- src/core/lib/avl/avl.h
- src/core/lib/backoff/backoff.h
- src/core/lib/channel/channel_args.h
@ -1006,6 +1011,7 @@ libs:
- src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c
- src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c
- src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c
- src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c
- src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c
- src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c
@ -1053,6 +1059,7 @@ libs:
- src/core/ext/upb-generated/udpa/annotations/status.upb.c
- src/core/ext/upb-generated/udpa/annotations/versioning.upb.c
- src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c
- src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c
- src/core/ext/upb-generated/validate/validate.upb.c
- src/core/ext/upb-generated/xds/core/v3/authority.upb.c
- src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c
@ -1092,6 +1099,7 @@ libs:
- src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c
- src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c
@ -1131,6 +1139,7 @@ libs:
- src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c
- src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c
- src/core/ext/upbdefs-generated/validate/validate.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c
- src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c
@ -1146,6 +1155,7 @@ libs:
- src/core/ext/xds/xds_certificate_provider.cc
- src/core/ext/xds/xds_client.cc
- src/core/ext/xds/xds_client_stats.cc
- src/core/ext/xds/xds_http_filters.cc
- src/core/ext/xds/xds_server_config_fetcher.cc
- src/core/lib/avl/avl.cc
- src/core/lib/backoff/backoff.cc
@ -8014,6 +8024,7 @@ targets:
- src/proto/grpc/testing/xds/v3/range.proto
- src/proto/grpc/testing/xds/v3/regex.proto
- src/proto/grpc/testing/xds/v3/route.proto
- src/proto/grpc/testing/xds/v3/router.proto
- src/proto/grpc/testing/xds/v3/string.proto
- src/proto/grpc/testing/xds/v3/tls.proto
- test/cpp/end2end/test_service_impl.cc

@ -177,6 +177,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c \
@ -225,6 +226,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upb-generated/udpa/annotations/status.upb.c \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c \
@ -264,6 +266,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c \
@ -304,6 +307,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c \
@ -319,6 +323,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/xds/xds_certificate_provider.cc \
src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client_stats.cc \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/avl/avl.cc \
src/core/lib/backoff/backoff.cc \
@ -1053,6 +1058,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/route/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/config/trace/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/envoy/service/cluster/v3)
@ -1074,6 +1080,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/src/proto/grpc/lb/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/annotations)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/data/orca/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/udpa/type/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/validate)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upb-generated/xds/core/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/annotations)
@ -1085,6 +1092,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/route/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/config/trace/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/envoy/service/cluster/v3)
@ -1101,6 +1109,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/google/protobuf)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/google/rpc)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/udpa/annotations)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/udpa/type/v1)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/validate)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/upbdefs-generated/xds/core/v3)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/xds)

@ -144,6 +144,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-generated\\envoy\\config\\route\\v3\\scoped_route.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\config\\trace\\v3\\http_tracer.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\router\\v3\\router.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3\\http_connection_manager.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\cert.upb.c " +
"src\\core\\ext\\upb-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\common.upb.c " +
@ -192,6 +193,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upb-generated\\udpa\\annotations\\status.upb.c " +
"src\\core\\ext\\upb-generated\\udpa\\annotations\\versioning.upb.c " +
"src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1\\orca_load_report.upb.c " +
"src\\core\\ext\\upb-generated\\udpa\\type\\v1\\typed_struct.upb.c " +
"src\\core\\ext\\upb-generated\\validate\\validate.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\authority.upb.c " +
"src\\core\\ext\\upb-generated\\xds\\core\\v3\\collection_entry.upb.c " +
@ -231,6 +233,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\route\\v3\\scoped_route.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\config\\trace\\v3\\http_tracer.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate\\v3\\cluster.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\router\\v3\\router.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3\\http_connection_manager.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\cert.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\transport_sockets\\tls\\v3\\common.upbdefs.c " +
@ -271,6 +274,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\sensitive.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\status.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\annotations\\versioning.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\udpa\\type\\v1\\typed_struct.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\validate\\validate.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\authority.upbdefs.c " +
"src\\core\\ext\\upbdefs-generated\\xds\\core\\v3\\collection_entry.upbdefs.c " +
@ -286,6 +290,7 @@ if (PHP_GRPC != "no") {
"src\\core\\ext\\xds\\xds_certificate_provider.cc " +
"src\\core\\ext\\xds\\xds_client.cc " +
"src\\core\\ext\\xds\\xds_client_stats.cc " +
"src\\core\\ext\\xds\\xds_http_filters.cc " +
"src\\core\\ext\\xds\\xds_server_config_fetcher.cc " +
"src\\core\\lib\\avl\\avl.cc " +
"src\\core\\lib\\backoff\\backoff.cc " +
@ -1071,6 +1076,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\clusters\\aggregate\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\router");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\http\\router\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network\\http_connection_manager");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3");
@ -1117,6 +1125,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\data\\orca\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\type");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\udpa\\type\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\validate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upb-generated\\xds\\core");
@ -1144,6 +1154,9 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\clusters\\aggregate\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\router");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\http\\router\\v3");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network\\http_connection_manager");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\envoy\\extensions\\filters\\network\\http_connection_manager\\v3");
@ -1177,6 +1190,8 @@ if (PHP_GRPC != "no") {
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\google\\rpc");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa\\annotations");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa\\type");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\udpa\\type\\v1");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\validate");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds");
FSO.CreateFolder(base_dir+"\\ext\\grpc\\src\\core\\ext\\upbdefs-generated\\xds\\core");

@ -315,6 +315,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
@ -363,6 +364,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
@ -402,6 +404,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
@ -442,6 +445,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
@ -459,6 +463,7 @@ Pod::Spec.new do |s|
'src/core/ext/xds/xds_channel_args.h',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.h',
'src/core/ext/xds/xds_http_filters.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',
@ -936,6 +941,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
@ -984,6 +990,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
@ -1023,6 +1030,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
@ -1063,6 +1071,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
@ -1080,6 +1089,7 @@ Pod::Spec.new do |s|
'src/core/ext/xds/xds_channel_args.h',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.h',
'src/core/ext/xds/xds_http_filters.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',

@ -442,6 +442,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
@ -538,6 +540,8 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.c',
@ -616,6 +620,8 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c',
@ -696,6 +702,8 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c',
@ -728,6 +736,8 @@ Pod::Spec.new do |s|
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.cc',
'src/core/ext/xds/xds_client_stats.h',
'src/core/ext/xds/xds_http_filters.cc',
'src/core/ext/xds/xds_http_filters.h',
'src/core/ext/xds/xds_server_config_fetcher.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/avl/avl.h',
@ -1472,6 +1482,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.h',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h',
@ -1520,6 +1531,7 @@ Pod::Spec.new do |s|
'src/core/ext/upb-generated/udpa/annotations/status.upb.h',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.h',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h',
'src/core/ext/upb-generated/validate/validate.upb.h',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.h',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h',
@ -1559,6 +1571,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.h',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.h',
@ -1599,6 +1612,7 @@ Pod::Spec.new do |s|
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.h',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.h',
@ -1616,6 +1630,7 @@ Pod::Spec.new do |s|
'src/core/ext/xds/xds_channel_args.h',
'src/core/ext/xds/xds_client.h',
'src/core/ext/xds/xds_client_stats.h',
'src/core/ext/xds/xds_http_filters.h',
'src/core/lib/avl/avl.h',
'src/core/lib/backoff/backoff.h',
'src/core/lib/channel/channel_args.h',

@ -357,6 +357,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h )
s.files += %w( src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c )
@ -453,6 +455,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upb-generated/udpa/annotations/versioning.upb.h )
s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c )
s.files += %w( src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h )
s.files += %w( src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c )
s.files += %w( src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.c )
s.files += %w( src/core/ext/upb-generated/validate/validate.upb.h )
s.files += %w( src/core/ext/upb-generated/xds/core/v3/authority.upb.c )
@ -531,6 +535,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c )
@ -611,6 +617,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/validate/validate.upbdefs.c )
s.files += %w( src/core/ext/upbdefs-generated/validate/validate.upbdefs.h )
s.files += %w( src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c )
@ -643,6 +651,8 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/xds/xds_client.h )
s.files += %w( src/core/ext/xds/xds_client_stats.cc )
s.files += %w( src/core/ext/xds/xds_client_stats.h )
s.files += %w( src/core/ext/xds/xds_http_filters.cc )
s.files += %w( src/core/ext/xds/xds_http_filters.h )
s.files += %w( src/core/ext/xds/xds_server_config_fetcher.cc )
s.files += %w( src/core/lib/avl/avl.cc )
s.files += %w( src/core/lib/avl/avl.h )

@ -591,6 +591,7 @@
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c',
@ -638,6 +639,7 @@
'src/core/ext/upb-generated/udpa/annotations/status.upb.c',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.c',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c',
@ -677,6 +679,7 @@
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c',
@ -716,6 +719,7 @@
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c',
@ -731,6 +735,7 @@
'src/core/ext/xds/xds_certificate_provider.cc',
'src/core/ext/xds/xds_client.cc',
'src/core/ext/xds/xds_client_stats.cc',
'src/core/ext/xds/xds_http_filters.cc',
'src/core/ext/xds/xds_server_config_fetcher.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',

@ -337,6 +337,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c" role="src" />
@ -433,6 +435,8 @@
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/annotations/versioning.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/validate/validate.upb.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upb-generated/xds/core/v3/authority.upb.c" role="src" />
@ -511,6 +515,8 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c" role="src" />
@ -591,6 +597,8 @@
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/validate/validate.upbdefs.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/validate/validate.upbdefs.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c" role="src" />
@ -623,6 +631,8 @@
<file baseinstalldir="/" name="src/core/ext/xds/xds_client.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_client_stats.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_client_stats.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_http_filters.cc" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_http_filters.h" role="src" />
<file baseinstalldir="/" name="src/core/ext/xds/xds_server_config_fetcher.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/avl/avl.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/avl/avl.h" role="src" />

@ -2297,7 +2297,7 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
server_name_, retry_throttle_config.value().max_milli_tokens,
retry_throttle_config.value().milli_token_ratio);
}
// Construct per-LB filter stack.
// Construct dynamic filter stack.
std::vector<const grpc_channel_filter*> filters =
config_selector->GetFilters();
filters.push_back(&kDynamicTerminationFilterVtable);
@ -2312,6 +2312,7 @@ void ChannelData::UpdateServiceConfigInDataPlaneLocked() {
}
grpc_channel_args* new_args = grpc_channel_args_copy_and_add(
channel_args_, args_to_add.data(), args_to_add.size());
new_args = config_selector->ModifyChannelArgs(new_args);
RefCountedPtr<DynamicFilters> dynamic_filters =
DynamicFilters::Create(new_args, std::move(filters));
GPR_ASSERT(dynamic_filters != nullptr);

@ -82,8 +82,16 @@ class ConfigSelector : public RefCounted<ConfigSelector> {
return cs1->Equals(cs2);
}
// The channel will call this when the resolver returns a new ConfigSelector
// to determine what set of dynamic filters will be configured.
virtual std::vector<const grpc_channel_filter*> GetFilters() { return {}; }
// Modifies channel args to be passed to the dynamic filter stack.
// Takes ownership of argument. Caller takes ownership of result.
virtual grpc_channel_args* ModifyChannelArgs(grpc_channel_args* args) {
return args;
}
virtual CallConfig GetCallConfig(GetCallConfigArgs args) = 0;
grpc_arg MakeChannelArg() const;

@ -18,6 +18,7 @@
#include "src/core/ext/filters/client_channel/dynamic_filters.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/surface/lame_client.h"
@ -160,12 +161,16 @@ RefCountedPtr<DynamicFilters> DynamicFilters::Create(
// Attempt to create channel stack from requested filters.
auto p = CreateChannelStack(args, std::move(filters));
if (p.second != GRPC_ERROR_NONE) {
// Initial pass failed. Create with lame filter.
// Channel stack creation failed with requested filters.
// Create with lame filter instead.
grpc_error* error = p.second;
p = CreateChannelStack(args, {&grpc_lame_filter});
grpc_arg error_arg = MakeLameClientErrorArg(error);
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args, &error_arg, 1);
GRPC_ERROR_UNREF(error);
p = CreateChannelStack(new_args, {&grpc_lame_filter});
GPR_ASSERT(p.second == GRPC_ERROR_NONE);
grpc_channel_element* elem = grpc_channel_stack_element(p.first, 0);
SetLameFilterError(elem, error);
grpc_channel_args_destroy(new_args);
}
return MakeRefCounted<DynamicFilters>(p.first);
}

@ -26,9 +26,11 @@
#include "src/core/ext/filters/client_channel/config_selector.h"
#include "src/core/ext/filters/client_channel/resolver_registry.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/ext/xds/xds_http_filters.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/surface/lame_client.h"
#include "src/core/lib/transport/timeout_encoding.h"
namespace grpc_core {
@ -135,9 +137,7 @@ class XdsResolver : public Resolver {
class XdsConfigSelector : public ConfigSelector {
public:
XdsConfigSelector(RefCountedPtr<XdsResolver> resolver,
const std::vector<XdsApi::Route>& routes,
grpc_error* error);
XdsConfigSelector(RefCountedPtr<XdsResolver> resolver, grpc_error** error);
~XdsConfigSelector() override;
const char* name() const override { return "XdsConfigSelector"; }
@ -151,26 +151,41 @@ class XdsResolver : public Resolver {
CallConfig GetCallConfig(GetCallConfigArgs args) override;
std::vector<const grpc_channel_filter*> GetFilters() override {
return filters_;
}
grpc_channel_args* ModifyChannelArgs(grpc_channel_args* args) override;
private:
struct Route {
struct ClusterWeightState {
uint32_t range_end;
absl::string_view cluster;
RefCountedPtr<ServiceConfig> method_config;
bool operator==(const ClusterWeightState& other) const;
};
XdsApi::Route route;
absl::InlinedVector<std::pair<uint32_t, absl::string_view>, 2>
weighted_cluster_state;
RefCountedPtr<ServiceConfig> method_config;
bool operator==(const Route& other) const {
return route == other.route &&
weighted_cluster_state == other.weighted_cluster_state;
}
absl::InlinedVector<ClusterWeightState, 2> weighted_cluster_state;
bool operator==(const Route& other) const;
};
using RouteTable = std::vector<Route>;
void MaybeAddCluster(const std::string& name);
grpc_error* CreateMethodConfig(RefCountedPtr<ServiceConfig>* method_config,
const XdsApi::Route& route);
grpc_error* CreateMethodConfig(
const XdsApi::Route& route,
const XdsApi::Route::ClusterWeight* cluster_weight,
RefCountedPtr<ServiceConfig>* method_config);
RefCountedPtr<XdsResolver> resolver_;
RouteTable route_table_;
std::map<absl::string_view, RefCountedPtr<ClusterState>> clusters_;
std::vector<const grpc_channel_filter*> filters_;
grpc_error* filter_error_ = GRPC_ERROR_NONE;
};
void OnListenerUpdate(XdsApi::LdsUpdate listener);
@ -187,13 +202,20 @@ class XdsResolver : public Resolver {
std::string server_name_;
const grpc_channel_args* args_;
grpc_pollset_set* interested_parties_;
RefCountedPtr<XdsClient> xds_client_;
XdsClient::ListenerWatcherInterface* listener_watcher_ = nullptr;
// This will not contain the RouteConfiguration, even if it comes with the
// LDS response; instead, the relevant VirtualHost from the
// RouteConfiguration will be saved in current_virtual_host_.
XdsApi::LdsUpdate current_listener_;
std::string route_config_name_;
XdsClient::RouteConfigWatcherInterface* route_config_watcher_ = nullptr;
XdsApi::RdsUpdate::VirtualHost current_virtual_host_;
ClusterState::ClusterStateMap cluster_state_map_;
std::vector<XdsApi::Route> current_update_;
XdsApi::Duration http_max_stream_duration_;
};
//
@ -260,13 +282,35 @@ void XdsResolver::Notifier::RunInWorkSerializer(grpc_error* error) {
delete this;
}
//
// XdsResolver::XdsConfigSelector::Route
//
bool MethodConfigsEqual(const ServiceConfig* sc1, const ServiceConfig* sc2) {
if (sc1 == nullptr) return sc2 == nullptr;
if (sc2 == nullptr) return false;
return sc1->json_string() == sc2->json_string();
}
bool XdsResolver::XdsConfigSelector::Route::ClusterWeightState::operator==(
const ClusterWeightState& other) const {
return range_end == other.range_end && cluster == other.cluster &&
MethodConfigsEqual(method_config.get(), other.method_config.get());
}
bool XdsResolver::XdsConfigSelector::Route::operator==(
const Route& other) const {
return route == other.route &&
weighted_cluster_state == other.weighted_cluster_state &&
MethodConfigsEqual(method_config.get(), other.method_config.get());
}
//
// XdsResolver::XdsConfigSelector
//
XdsResolver::XdsConfigSelector::XdsConfigSelector(
RefCountedPtr<XdsResolver> resolver,
const std::vector<XdsApi::Route>& routes, grpc_error* error)
RefCountedPtr<XdsResolver> resolver, grpc_error** error)
: resolver_(std::move(resolver)) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] creating XdsConfigSelector %p",
@ -281,8 +325,8 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
// weighted_cluster_state field points to the memory in the route field, so
// moving the entry in a reallocation will cause the string_view to point to
// invalid data.
route_table_.reserve(routes.size());
for (auto& route : routes) {
route_table_.reserve(resolver_->current_virtual_host_.routes.size());
for (auto& route : resolver_->current_virtual_host_.routes) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] XdsConfigSelector %p: route: %s",
resolver_.get(), this, route.ToString().c_str());
@ -294,27 +338,95 @@ XdsResolver::XdsConfigSelector::XdsConfigSelector(
// one.
if (!route.max_stream_duration.has_value()) {
route_entry.route.max_stream_duration =
resolver_->http_max_stream_duration_;
resolver_->current_listener_.http_max_stream_duration;
}
error = CreateMethodConfig(&route_entry.method_config, route_entry.route);
if (route.weighted_clusters.empty()) {
*error = CreateMethodConfig(route_entry.route, nullptr,
&route_entry.method_config);
MaybeAddCluster(route.cluster_name);
} else {
uint32_t end = 0;
for (const auto& weighted_cluster : route_entry.route.weighted_clusters) {
MaybeAddCluster(weighted_cluster.name);
Route::ClusterWeightState cluster_weight_state;
*error = CreateMethodConfig(route_entry.route, &weighted_cluster,
&cluster_weight_state.method_config);
if (*error != GRPC_ERROR_NONE) return;
end += weighted_cluster.weight;
route_entry.weighted_cluster_state.emplace_back(end,
weighted_cluster.name);
cluster_weight_state.range_end = end;
cluster_weight_state.cluster = weighted_cluster.name;
route_entry.weighted_cluster_state.push_back(
std::move(cluster_weight_state));
MaybeAddCluster(weighted_cluster.name);
}
}
}
// Populate filter list.
if (XdsFaultInjectionEnabled()) {
bool found_router = false;
for (const auto& http_filter : resolver_->current_listener_.http_filters) {
// Stop at the router filter. It's a no-op for us, and we ignore
// anything that may come after it, for compatibility with Envoy.
if (http_filter.config.config_proto_type_name ==
kXdsHttpRouterFilterConfigName) {
found_router = true;
break;
}
// Find filter. This is guaranteed to succeed, because it's checked
// at config validation time in the XdsApi code.
const XdsHttpFilterImpl* filter_impl =
XdsHttpFilterRegistry::GetFilterForType(
http_filter.config.config_proto_type_name);
GPR_ASSERT(filter_impl != nullptr);
// Add C-core filter to list.
filters_.push_back(filter_impl->channel_filter());
}
// For compatibility with Envoy, if the router filter is not
// configured, we fail all RPCs.
if (!found_router) {
filter_error_ = grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"no xDS HTTP router filter configured"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_UNAVAILABLE);
filters_.push_back(&grpc_lame_filter);
}
}
}
XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] destroying XdsConfigSelector %p",
resolver_.get(), this);
}
clusters_.clear();
resolver_->MaybeRemoveUnusedClusters();
GRPC_ERROR_UNREF(filter_error_);
}
const XdsHttpFilterImpl::FilterConfig* FindFilterConfigOverride(
const std::string& instance_name,
const XdsApi::RdsUpdate::VirtualHost& vhost, const XdsApi::Route& route,
const XdsApi::Route::ClusterWeight* cluster_weight) {
// Check ClusterWeight, if any.
if (cluster_weight != nullptr) {
auto it = cluster_weight->typed_per_filter_config.find(instance_name);
if (it != cluster_weight->typed_per_filter_config.end()) return &it->second;
}
// Check Route.
auto it = route.typed_per_filter_config.find(instance_name);
if (it != route.typed_per_filter_config.end()) return &it->second;
// Check VirtualHost.
it = vhost.typed_per_filter_config.find(instance_name);
if (it != vhost.typed_per_filter_config.end()) return &it->second;
// Not found.
return nullptr;
}
grpc_error* XdsResolver::XdsConfigSelector::CreateMethodConfig(
RefCountedPtr<ServiceConfig>* method_config, const XdsApi::Route& route) {
grpc_error* error = GRPC_ERROR_NONE;
const XdsApi::Route& route,
const XdsApi::Route::ClusterWeight* cluster_weight,
RefCountedPtr<ServiceConfig>* method_config) {
std::vector<std::string> fields;
// Set timeout.
if (route.max_stream_duration.has_value() &&
(route.max_stream_duration->seconds != 0 ||
route.max_stream_duration->nanos != 0)) {
@ -322,6 +434,50 @@ grpc_error* XdsResolver::XdsConfigSelector::CreateMethodConfig(
route.max_stream_duration->seconds,
route.max_stream_duration->nanos));
}
// Handle xDS HTTP filters.
std::map<std::string, std::vector<std::string>> per_filter_configs;
grpc_channel_args* args = grpc_channel_args_copy(resolver_->args_);
for (const auto& http_filter : resolver_->current_listener_.http_filters) {
// Stop at the router filter. It's a no-op for us, and we ignore
// anything that may come after it, for compatibility with Envoy.
if (http_filter.config.config_proto_type_name ==
kXdsHttpRouterFilterConfigName) {
break;
}
// Find filter. This is guaranteed to succeed, because it's checked
// at config validation time in the XdsApi code.
const XdsHttpFilterImpl* filter_impl =
XdsHttpFilterRegistry::GetFilterForType(
http_filter.config.config_proto_type_name);
GPR_ASSERT(filter_impl != nullptr);
// Allow filter to add channel args that may affect service config
// parsing.
args = filter_impl->ModifyChannelArgs(args);
// Find config override, if any.
const XdsHttpFilterImpl::FilterConfig* config_override =
FindFilterConfigOverride(http_filter.name,
resolver_->current_virtual_host_, route,
cluster_weight);
// Generate service config for filter.
auto method_config_field =
filter_impl->GenerateServiceConfig(http_filter.config, config_override);
if (!method_config_field.ok()) {
return GRPC_ERROR_CREATE_FROM_COPIED_STRING(
absl::StrCat("failed to generate method config for HTTP filter ",
http_filter.name, ": ",
method_config_field.status().ToString())
.c_str());
}
per_filter_configs[method_config_field->service_config_field_name]
.push_back(method_config_field->element);
}
for (const auto& p : per_filter_configs) {
fields.emplace_back(absl::StrCat(" \"", p.first, "\": [\n",
absl::StrJoin(p.second, ",\n"),
"\n ]"));
}
// Construct service config.
grpc_error* error = GRPC_ERROR_NONE;
if (!fields.empty()) {
std::string json = absl::StrCat(
"{\n"
@ -333,19 +489,20 @@ grpc_error* XdsResolver::XdsConfigSelector::CreateMethodConfig(
absl::StrJoin(fields, ",\n"),
"\n } ]\n"
"}");
*method_config =
ServiceConfig::Create(resolver_->args_, json.c_str(), &error);
*method_config = ServiceConfig::Create(args, json.c_str(), &error);
}
grpc_channel_args_destroy(args);
return error;
}
XdsResolver::XdsConfigSelector::~XdsConfigSelector() {
if (GRPC_TRACE_FLAG_ENABLED(grpc_xds_resolver_trace)) {
gpr_log(GPR_INFO, "[xds_resolver %p] destroying XdsConfigSelector %p",
resolver_.get(), this);
}
clusters_.clear();
resolver_->MaybeRemoveUnusedClusters();
grpc_channel_args* XdsResolver::XdsConfigSelector::ModifyChannelArgs(
grpc_channel_args* args) {
if (filter_error_ == GRPC_ERROR_NONE) return args;
grpc_arg error_arg = MakeLameClientErrorArg(filter_error_);
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add(args, &error_arg, 1);
grpc_channel_args_destroy(args);
return new_args;
}
void XdsResolver::XdsConfigSelector::MaybeAddCluster(const std::string& name) {
@ -437,13 +594,15 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
}
// Found a route match
absl::string_view cluster_name;
RefCountedPtr<ServiceConfig> method_config;
if (entry.route.weighted_clusters.empty()) {
cluster_name = entry.route.cluster_name;
method_config = entry.method_config;
} else {
const uint32_t key =
rand() %
entry.weighted_cluster_state[entry.weighted_cluster_state.size() - 1]
.first;
.range_end;
// Find the index in weighted clusters corresponding to key.
size_t mid = 0;
size_t start_index = 0;
@ -451,9 +610,9 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
size_t index = 0;
while (end_index > start_index) {
mid = (start_index + end_index) / 2;
if (entry.weighted_cluster_state[mid].first > key) {
if (entry.weighted_cluster_state[mid].range_end > key) {
end_index = mid;
} else if (entry.weighted_cluster_state[mid].first < key) {
} else if (entry.weighted_cluster_state[mid].range_end < key) {
start_index = mid + 1;
} else {
index = mid + 1;
@ -461,8 +620,9 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
}
}
if (index == 0) index = start_index;
GPR_ASSERT(entry.weighted_cluster_state[index].first > key);
cluster_name = entry.weighted_cluster_state[index].second;
GPR_ASSERT(entry.weighted_cluster_state[index].range_end > key);
cluster_name = entry.weighted_cluster_state[index].cluster;
method_config = entry.weighted_cluster_state[index].method_config;
}
auto it = clusters_.find(cluster_name);
GPR_ASSERT(it != clusters_.end());
@ -470,10 +630,10 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
static_cast<XdsResolver*>(resolver_->Ref().release());
ClusterState* cluster_state = it->second->Ref().release();
CallConfig call_config;
if (entry.method_config != nullptr) {
call_config.service_config = entry.method_config;
if (method_config != nullptr) {
call_config.method_configs =
entry.method_config->GetMethodParsedConfigVector(grpc_empty_slice());
method_config->GetMethodParsedConfigVector(grpc_empty_slice());
call_config.service_config = std::move(method_config);
}
call_config.call_attributes[kXdsClusterAttribute] = it->first;
call_config.on_call_committed = [resolver, cluster_state]() {
@ -577,10 +737,10 @@ void XdsResolver::OnListenerUpdate(XdsApi::LdsUpdate listener) {
xds_client_->WatchRouteConfigData(route_config_name_, std::move(watcher));
}
}
http_max_stream_duration_ = listener.http_max_stream_duration;
current_listener_ = std::move(listener);
if (route_config_name_.empty()) {
GPR_ASSERT(listener.rds_update.has_value());
OnRouteConfigUpdate(std::move(*listener.rds_update));
GPR_ASSERT(current_listener_.rds_update.has_value());
OnRouteConfigUpdate(std::move(*current_listener_.rds_update));
}
}
@ -598,8 +758,8 @@ void XdsResolver::OnRouteConfigUpdate(XdsApi::RdsUpdate rds_update) {
.c_str()));
return;
}
// Save the list of routes in the resolver.
current_update_ = std::move(vhost->routes);
// Save the virtual host in the resolver.
current_virtual_host_ = std::move(*vhost);
// Send a new result to the channel.
GenerateResult();
}
@ -618,7 +778,7 @@ void XdsResolver::OnResourceDoesNotExist() {
"[xds_resolver %p] LDS/RDS resource does not exist -- clearing "
"update and returning empty service config",
this);
current_update_.clear();
current_virtual_host_.routes.clear();
Result result;
result.service_config =
ServiceConfig::Create(args_, "{}", &result.service_config_error);
@ -660,12 +820,11 @@ grpc_error* XdsResolver::CreateServiceConfig(
}
void XdsResolver::GenerateResult() {
if (current_update_.empty()) return;
if (current_virtual_host_.routes.empty()) return;
// First create XdsConfigSelector, which may add new entries to the cluster
// state map, and then CreateServiceConfig for LB policies.
grpc_error* error = GRPC_ERROR_NONE;
auto config_selector =
MakeRefCounted<XdsConfigSelector>(Ref(), current_update_, error);
auto config_selector = MakeRefCounted<XdsConfigSelector>(Ref(), &error);
if (error != GRPC_ERROR_NONE) {
OnError(error);
return;

@ -0,0 +1,41 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/filters/http/router/v3/router.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/config/accesslog/v3/accesslog.upb.h"
#include "google/protobuf/wrappers.upb.h"
#include "udpa/annotations/status.upb.h"
#include "udpa/annotations/versioning.upb.h"
#include "validate/validate.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout *const envoy_extensions_filters_http_router_v3_Router_submsgs[2] = {
&envoy_config_accesslog_v3_AccessLog_msginit,
&google_protobuf_BoolValue_msginit,
};
static const upb_msglayout_field envoy_extensions_filters_http_router_v3_Router__fields[6] = {
{1, UPB_SIZE(4, 8), 1, 1, 11, 1},
{2, UPB_SIZE(1, 1), 0, 0, 8, 1},
{3, UPB_SIZE(8, 16), 0, 0, 11, 3},
{4, UPB_SIZE(2, 2), 0, 0, 8, 1},
{5, UPB_SIZE(12, 24), 0, 0, 9, 3},
{6, UPB_SIZE(3, 3), 0, 0, 8, 1},
};
const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit = {
&envoy_extensions_filters_http_router_v3_Router_submsgs[0],
&envoy_extensions_filters_http_router_v3_Router__fields[0],
UPB_SIZE(16, 32), 6, false, 255,
};
#include "upb/port_undef.inc"

@ -0,0 +1,113 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/filters/http/router/v3/router.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct envoy_extensions_filters_http_router_v3_Router;
typedef struct envoy_extensions_filters_http_router_v3_Router envoy_extensions_filters_http_router_v3_Router;
extern const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit;
struct envoy_config_accesslog_v3_AccessLog;
struct google_protobuf_BoolValue;
extern const upb_msglayout envoy_config_accesslog_v3_AccessLog_msginit;
extern const upb_msglayout google_protobuf_BoolValue_msginit;
/* envoy.extensions.filters.http.router.v3.Router */
UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_new(upb_arena *arena) {
return (envoy_extensions_filters_http_router_v3_Router *)_upb_msg_new(&envoy_extensions_filters_http_router_v3_Router_msginit, arena);
}
UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_parse(const char *buf, size_t size,
upb_arena *arena) {
envoy_extensions_filters_http_router_v3_Router *ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
return (ret && upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena)) ? ret : NULL;
}
UPB_INLINE envoy_extensions_filters_http_router_v3_Router *envoy_extensions_filters_http_router_v3_Router_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
envoy_extensions_filters_http_router_v3_Router *ret = envoy_extensions_filters_http_router_v3_Router_new(arena);
return (ret && _upb_decode(buf, size, ret, &envoy_extensions_filters_http_router_v3_Router_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *envoy_extensions_filters_http_router_v3_Router_serialize(const envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, arena, len);
}
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_dynamic_stats(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct google_protobuf_BoolValue*); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_start_child_span(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_has_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
UPB_INLINE const struct envoy_config_accesslog_v3_AccessLog* const* envoy_extensions_filters_http_router_v3_Router_upstream_log(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (const struct envoy_config_accesslog_v3_AccessLog* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_suppress_envoy_headers(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool); }
UPB_INLINE upb_strview const* envoy_extensions_filters_http_router_v3_Router_strict_check_headers(const envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) { return (upb_strview const*)_upb_array_accessor(msg, UPB_SIZE(12, 24), len); }
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_respect_expected_rq_timeout(const envoy_extensions_filters_http_router_v3_Router *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool); }
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, struct google_protobuf_BoolValue* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct google_protobuf_BoolValue*) = value;
}
UPB_INLINE struct google_protobuf_BoolValue* envoy_extensions_filters_http_router_v3_Router_mutable_dynamic_stats(envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena) {
struct google_protobuf_BoolValue* sub = (struct google_protobuf_BoolValue*)envoy_extensions_filters_http_router_v3_Router_dynamic_stats(msg);
if (sub == NULL) {
sub = (struct google_protobuf_BoolValue*)_upb_msg_new(&google_protobuf_BoolValue_msginit, arena);
if (!sub) return NULL;
envoy_extensions_filters_http_router_v3_Router_set_dynamic_stats(msg, sub);
}
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_start_child_span(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(1, 1), bool) = value;
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_mutable_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) {
return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog** envoy_extensions_filters_http_router_v3_Router_resize_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, size_t len, upb_arena *arena) {
return (struct envoy_config_accesslog_v3_AccessLog**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
}
UPB_INLINE struct envoy_config_accesslog_v3_AccessLog* envoy_extensions_filters_http_router_v3_Router_add_upstream_log(envoy_extensions_filters_http_router_v3_Router *msg, upb_arena *arena) {
struct envoy_config_accesslog_v3_AccessLog* sub = (struct envoy_config_accesslog_v3_AccessLog*)_upb_msg_new(&envoy_config_accesslog_v3_AccessLog_msginit, arena);
bool ok = _upb_array_append_accessor2(
msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
if (!ok) return NULL;
return sub;
}
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_suppress_envoy_headers(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(2, 2), bool) = value;
}
UPB_INLINE upb_strview* envoy_extensions_filters_http_router_v3_Router_mutable_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, size_t *len) {
return (upb_strview*)_upb_array_mutable_accessor(msg, UPB_SIZE(12, 24), len);
}
UPB_INLINE upb_strview* envoy_extensions_filters_http_router_v3_Router_resize_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, size_t len, upb_arena *arena) {
return (upb_strview*)_upb_array_resize_accessor2(msg, UPB_SIZE(12, 24), len, UPB_SIZE(3, 4), arena);
}
UPB_INLINE bool envoy_extensions_filters_http_router_v3_Router_add_strict_check_headers(envoy_extensions_filters_http_router_v3_Router *msg, upb_strview val, upb_arena *arena) {
return _upb_array_append_accessor2(msg, UPB_SIZE(12, 24), UPB_SIZE(3, 4), &val,
arena);
}
UPB_INLINE void envoy_extensions_filters_http_router_v3_Router_set_respect_expected_rq_timeout(envoy_extensions_filters_http_router_v3_Router *msg, bool value) {
*UPB_PTR_AT(msg, UPB_SIZE(3, 3), bool) = value;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPB_H_ */

@ -0,0 +1,33 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* udpa/type/v1/typed_struct.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include <stddef.h>
#include "upb/msg.h"
#include "udpa/type/v1/typed_struct.upb.h"
#include "validate/validate.upb.h"
#include "google/protobuf/struct.upb.h"
#include "upb/port_def.inc"
static const upb_msglayout *const udpa_type_v1_TypedStruct_submsgs[1] = {
&google_protobuf_Struct_msginit,
};
static const upb_msglayout_field udpa_type_v1_TypedStruct__fields[2] = {
{1, UPB_SIZE(4, 8), 0, 0, 9, 1},
{2, UPB_SIZE(12, 24), 1, 0, 11, 1},
};
const upb_msglayout udpa_type_v1_TypedStruct_msginit = {
&udpa_type_v1_TypedStruct_submsgs[0],
&udpa_type_v1_TypedStruct__fields[0],
UPB_SIZE(16, 32), 2, false, 255,
};
#include "upb/port_undef.inc"

@ -0,0 +1,77 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* udpa/type/v1/typed_struct.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
#define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_
#include "upb/msg.h"
#include "upb/decode.h"
#include "upb/decode_fast.h"
#include "upb/encode.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
struct udpa_type_v1_TypedStruct;
typedef struct udpa_type_v1_TypedStruct udpa_type_v1_TypedStruct;
extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
struct google_protobuf_Struct;
extern const upb_msglayout google_protobuf_Struct_msginit;
/* udpa.type.v1.TypedStruct */
UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_new(upb_arena *arena) {
return (udpa_type_v1_TypedStruct *)_upb_msg_new(&udpa_type_v1_TypedStruct_msginit, arena);
}
UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse(const char *buf, size_t size,
upb_arena *arena) {
udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
return (ret && upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena)) ? ret : NULL;
}
UPB_INLINE udpa_type_v1_TypedStruct *udpa_type_v1_TypedStruct_parse_ex(const char *buf, size_t size,
upb_arena *arena, int options) {
udpa_type_v1_TypedStruct *ret = udpa_type_v1_TypedStruct_new(arena);
return (ret && _upb_decode(buf, size, ret, &udpa_type_v1_TypedStruct_msginit, arena, options))
? ret : NULL;
}
UPB_INLINE char *udpa_type_v1_TypedStruct_serialize(const udpa_type_v1_TypedStruct *msg, upb_arena *arena, size_t *len) {
return upb_encode(msg, &udpa_type_v1_TypedStruct_msginit, arena, len);
}
UPB_INLINE upb_strview udpa_type_v1_TypedStruct_type_url(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview); }
UPB_INLINE bool udpa_type_v1_TypedStruct_has_value(const udpa_type_v1_TypedStruct *msg) { return _upb_hasbit(msg, 1); }
UPB_INLINE const struct google_protobuf_Struct* udpa_type_v1_TypedStruct_value(const udpa_type_v1_TypedStruct *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(12, 24), const struct google_protobuf_Struct*); }
UPB_INLINE void udpa_type_v1_TypedStruct_set_type_url(udpa_type_v1_TypedStruct *msg, upb_strview value) {
*UPB_PTR_AT(msg, UPB_SIZE(4, 8), upb_strview) = value;
}
UPB_INLINE void udpa_type_v1_TypedStruct_set_value(udpa_type_v1_TypedStruct *msg, struct google_protobuf_Struct* value) {
_upb_sethas(msg, 1);
*UPB_PTR_AT(msg, UPB_SIZE(12, 24), struct google_protobuf_Struct*) = value;
}
UPB_INLINE struct google_protobuf_Struct* udpa_type_v1_TypedStruct_mutable_value(udpa_type_v1_TypedStruct *msg, upb_arena *arena) {
struct google_protobuf_Struct* sub = (struct google_protobuf_Struct*)udpa_type_v1_TypedStruct_value(msg);
if (sub == NULL) {
sub = (struct google_protobuf_Struct*)_upb_msg_new(&google_protobuf_Struct_msginit, arena);
if (!sub) return NULL;
udpa_type_v1_TypedStruct_set_value(msg, sub);
}
return sub;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPB_H_ */

@ -0,0 +1,76 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/filters/http/router/v3/router.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include "upb/def.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
extern upb_def_init envoy_config_accesslog_v3_accesslog_proto_upbdefinit;
extern upb_def_init google_protobuf_wrappers_proto_upbdefinit;
extern upb_def_init udpa_annotations_status_proto_upbdefinit;
extern upb_def_init udpa_annotations_versioning_proto_upbdefinit;
extern upb_def_init validate_validate_proto_upbdefinit;
extern const upb_msglayout envoy_extensions_filters_http_router_v3_Router_msginit;
static const upb_msglayout *layouts[1] = {
&envoy_extensions_filters_http_router_v3_Router_msginit,
};
static const char descriptor[909] = {'\n', '4', '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', '/', 'r', 'o', 'u', 't', 'e', 'r', '/', 'v', '3', '/', 'r', 'o', 'u', 't', 'e', 'r', '.', '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', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '3', '\032', ')', 'e', 'n', 'v',
'o', 'y', '/', 'c', 'o', 'n', 'f', 'i', 'g', '/', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o', 'g', '/', 'v', '3', '/', 'a', 'c',
'c', 'e', 's', 's', 'l', 'o', 'g', '.', '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', '\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', '!', 'u', 'd', 'p', 'a', '/', 'a', 'n', 'n', 'o', 't', 'a', 't', 'i', 'o', 'n', 's', '/', 'v', 'e', 'r', 's', 'i',
'o', 'n', 'i', 'n', 'g', '.', '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', '\"', '\255', '\004', '\n', '\006', 'R', 'o', 'u', 't', 'e', 'r', '\022', '?', '\n',
'\r', 'd', 'y', 'n', 'a', 'm', 'i', 'c', '_', 's', 't', 'a', 't', 's', '\030', '\001', ' ', '\001', '(', '\013', '2', '\032', '.', 'g', 'o',
'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '.', 'B', 'o', 'o', 'l', 'V', 'a', 'l', 'u', 'e', 'R', '\014',
'd', 'y', 'n', 'a', 'm', 'i', 'c', 'S', 't', 'a', 't', 's', '\022', '(', '\n', '\020', 's', 't', 'a', 'r', 't', '_', 'c', 'h', 'i',
'l', 'd', '_', 's', 'p', 'a', 'n', '\030', '\002', ' ', '\001', '(', '\010', 'R', '\016', 's', 't', 'a', 'r', 't', 'C', 'h', 'i', 'l', 'd',
'S', 'p', 'a', 'n', '\022', 'G', '\n', '\014', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '_', 'l', 'o', 'g', '\030', '\003', ' ', '\003', '(',
'\013', '2', '$', '.', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'a', 'c', 'c', 'e', 's', 's', 'l', 'o',
'g', '.', 'v', '3', '.', 'A', 'c', 'c', 'e', 's', 's', 'L', 'o', 'g', 'R', '\013', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', 'L',
'o', 'g', '\022', '4', '\n', '\026', 's', 'u', 'p', 'p', 'r', 'e', 's', 's', '_', 'e', 'n', 'v', 'o', 'y', '_', 'h', 'e', 'a', 'd',
'e', 'r', 's', '\030', '\004', ' ', '\001', '(', '\010', 'R', '\024', 's', 'u', 'p', 'p', 'r', 'e', 's', 's', 'E', 'n', 'v', 'o', 'y', 'H',
'e', 'a', 'd', 'e', 'r', 's', '\022', '\307', '\001', '\n', '\024', 's', 't', 'r', 'i', 'c', 't', '_', 'c', 'h', 'e', 'c', 'k', '_', 'h',
'e', 'a', 'd', 'e', 'r', 's', '\030', '\005', ' ', '\003', '(', '\t', 'B', '\224', '\001', '\372', 'B', '\220', '\001', '\222', '\001', '\214', '\001', '\"', '\211',
'\001', 'r', '\206', '\001', 'R', '\036', 'x', '-', 'e', 'n', 'v', 'o', 'y', '-', 'u', 'p', 's', 't', 'r', 'e', 'a', 'm', '-', 'r', 'q',
'-', 't', 'i', 'm', 'e', 'o', 'u', 't', '-', 'm', 's', 'R', '&', 'x', '-', 'e', 'n', 'v', 'o', 'y', '-', 'u', 'p', 's', 't',
'r', 'e', 'a', 'm', '-', 'r', 'q', '-', 'p', 'e', 'r', '-', 't', 'r', 'y', '-', 't', 'i', 'm', 'e', 'o', 'u', 't', '-', 'm',
's', 'R', '\023', 'x', '-', 'e', 'n', 'v', 'o', 'y', '-', 'm', 'a', 'x', '-', 'r', 'e', 't', 'r', 'i', 'e', 's', 'R', '\025', 'x',
'-', 'e', 'n', 'v', 'o', 'y', '-', 'r', 'e', 't', 'r', 'y', '-', 'g', 'r', 'p', 'c', '-', 'o', 'n', 'R', '\020', 'x', '-', 'e',
'n', 'v', 'o', 'y', '-', 'r', 'e', 't', 'r', 'y', '-', 'o', 'n', 'R', '\022', 's', 't', 'r', 'i', 'c', 't', 'C', 'h', 'e', 'c',
'k', 'H', 'e', 'a', 'd', 'e', 'r', 's', '\022', '=', '\n', '\033', 'r', 'e', 's', 'p', 'e', 'c', 't', '_', 'e', 'x', 'p', 'e', 'c',
't', 'e', 'd', '_', 'r', 'q', '_', 't', 'i', 'm', 'e', 'o', 'u', 't', '\030', '\006', ' ', '\001', '(', '\010', 'R', '\030', 'r', 'e', 's',
'p', 'e', 'c', 't', 'E', 'x', 'p', 'e', 'c', 't', 'e', 'd', 'R', 'q', 'T', 'i', 'm', 'e', 'o', 'u', 't', ':', '0', '\232', '\305',
'\210', '\036', '+', '\n', ')', 'e', 'n', 'v', 'o', 'y', '.', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'f', 'i', 'l', 't', 'e', 'r', '.',
'h', 't', 't', 'p', '.', 'r', 'o', 'u', 't', 'e', 'r', '.', 'v', '2', '.', 'R', 'o', 'u', 't', 'e', 'r', 'B', 'N', '\n', '5',
'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', '.', 'r', 'o', 'u', 't', 'e', 'r',
'.', 'v', '3', 'B', '\013', 'R', 'o', 'u', 't', 'e', 'r', 'P', 'r', 'o', 't', 'o', 'P', '\001', '\272', '\200', '\310', '\321', '\006', '\002', '\020',
'\002', 'b', '\006', 'p', 'r', 'o', 't', 'o', '3',
};
static upb_def_init *deps[6] = {
&envoy_config_accesslog_v3_accesslog_proto_upbdefinit,
&google_protobuf_wrappers_proto_upbdefinit,
&udpa_annotations_status_proto_upbdefinit,
&udpa_annotations_versioning_proto_upbdefinit,
&validate_validate_proto_upbdefinit,
NULL
};
upb_def_init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit = {
deps,
layouts,
"envoy/extensions/filters/http/router/v3/router.proto",
UPB_STRVIEW_INIT(descriptor, 909)
};

@ -0,0 +1,35 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* envoy/extensions/filters/http/router/v3/router.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPBDEFS_H_
#define ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPBDEFS_H_
#include "upb/def.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
#include "upb/def.h"
#include "upb/port_def.inc"
extern upb_def_init envoy_extensions_filters_http_router_v3_router_proto_upbdefinit;
UPB_INLINE const upb_msgdef *envoy_extensions_filters_http_router_v3_Router_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &envoy_extensions_filters_http_router_v3_router_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "envoy.extensions.filters.http.router.v3.Router");
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* ENVOY_EXTENSIONS_FILTERS_HTTP_ROUTER_V3_ROUTER_PROTO_UPBDEFS_H_ */

@ -0,0 +1,44 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* udpa/type/v1/typed_struct.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#include "upb/def.h"
#include "udpa/type/v1/typed_struct.upbdefs.h"
extern upb_def_init validate_validate_proto_upbdefinit;
extern upb_def_init google_protobuf_struct_proto_upbdefinit;
extern const upb_msglayout udpa_type_v1_TypedStruct_msginit;
static const upb_msglayout *layouts[1] = {
&udpa_type_v1_TypedStruct_msginit,
};
static const char descriptor[251] = {'\n', '\037', 'u', 'd', 'p', 'a', '/', 't', 'y', 'p', 'e', '/', 'v', '1', '/', 't', 'y', 'p', 'e', 'd', '_', 's', 't', 'r', 'u',
'c', 't', '.', 'p', 'r', 'o', 't', 'o', '\022', '\014', 'u', 'd', 'p', 'a', '.', 't', 'y', 'p', 'e', '.', 'v', '1', '\032', '\027', 'v',
'a', 'l', 'i', 'd', 'a', 't', 'e', '/', 'v', 'a', 'l', 'i', 'd', 'a', 't', 'e', '.', 'p', 'r', 'o', 't', 'o', '\032', '\034', 'g',
'o', 'o', 'g', 'l', 'e', '/', 'p', 'r', 'o', 't', 'o', 'b', 'u', 'f', '/', 's', 't', 'r', 'u', 'c', 't', '.', 'p', 'r', 'o',
't', 'o', '\"', 'W', '\n', '\013', 'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', '\022', '\031', '\n', '\010', 't', 'y', 'p', 'e',
'_', 'u', 'r', 'l', '\030', '\001', ' ', '\001', '(', '\t', 'R', '\007', 't', 'y', 'p', 'e', 'U', 'r', 'l', '\022', '-', '\n', '\005', 'v', 'a',
'l', 'u', 'e', '\030', '\002', ' ', '\001', '(', '\013', '2', '\027', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'p', 'r', 'o', 't', 'o', 'b',
'u', 'f', '.', 'S', 't', 'r', 'u', 'c', 't', 'R', '\005', 'v', 'a', 'l', 'u', 'e', 'B', '2', '\n', '\034', 'c', 'o', 'm', '.', 'g',
'i', 't', 'h', 'u', 'b', '.', 'u', 'd', 'p', 'a', '.', 'u', 'd', 'p', 'a', '.', 't', 'y', 'p', 'e', '.', 'v', '1', 'B', '\020',
'T', 'y', 'p', 'e', 'd', 'S', 't', 'r', 'u', 'c', 't', 'P', 'r', 'o', 't', 'o', 'P', '\001', 'b', '\006', 'p', 'r', 'o', 't', 'o',
'3',
};
static upb_def_init *deps[3] = {
&validate_validate_proto_upbdefinit,
&google_protobuf_struct_proto_upbdefinit,
NULL
};
upb_def_init udpa_type_v1_typed_struct_proto_upbdefinit = {
deps,
layouts,
"udpa/type/v1/typed_struct.proto",
UPB_STRVIEW_INIT(descriptor, 251)
};

@ -0,0 +1,35 @@
/* This file was generated by upbc (the upb compiler) from the input
* file:
*
* udpa/type/v1/typed_struct.proto
*
* Do not edit -- your changes will be discarded when the file is
* regenerated. */
#ifndef UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_
#define UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_
#include "upb/def.h"
#include "upb/port_def.inc"
#ifdef __cplusplus
extern "C" {
#endif
#include "upb/def.h"
#include "upb/port_def.inc"
extern upb_def_init udpa_type_v1_typed_struct_proto_upbdefinit;
UPB_INLINE const upb_msgdef *udpa_type_v1_TypedStruct_getmsgdef(upb_symtab *s) {
_upb_symtab_loaddefinit(s, &udpa_type_v1_typed_struct_proto_upbdefinit);
return upb_symtab_lookupmsg(s, "udpa.type.v1.TypedStruct");
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#include "upb/port_undef.inc"
#endif /* UDPA_TYPE_V1_TYPED_STRUCT_PROTO_UPBDEFS_H_ */

File diff suppressed because it is too large Load Diff

@ -36,6 +36,7 @@
#include "src/core/ext/filters/client_channel/server_address.h"
#include "src/core/ext/xds/xds_bootstrap.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/ext/xds/xds_http_filters.h"
#include "src/core/lib/security/authorization/matchers.h"
namespace grpc_core {
@ -45,6 +46,10 @@ namespace grpc_core {
// default.
bool XdsSecurityEnabled();
// TODO(lidiz): This will be removed once the fault injection feature is
// fully integration-tested and enabled by default.
bool XdsFaultInjectionEnabled();
class XdsClient;
class XdsApi {
@ -58,13 +63,16 @@ class XdsApi {
int64_t seconds = 0;
int32_t nanos = 0;
bool operator==(const Duration& other) const {
return (seconds == other.seconds && nanos == other.nanos);
return seconds == other.seconds && nanos == other.nanos;
}
std::string ToString() const {
return absl::StrFormat("Duration seconds: %ld, nanos %d", seconds, nanos);
}
};
using TypedPerFilterConfig =
std::map<std::string, XdsHttpFilterImpl::FilterConfig>;
// TODO(donnadionne): When we can use absl::variant<>, consider using that
// for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
struct Route {
@ -75,9 +83,9 @@ class XdsApi {
absl::optional<uint32_t> fraction_per_million;
bool operator==(const Matchers& other) const {
return (path_matcher == other.path_matcher &&
header_matchers == other.header_matchers &&
fraction_per_million == other.fraction_per_million);
return path_matcher == other.path_matcher &&
header_matchers == other.header_matchers &&
fraction_per_million == other.fraction_per_million;
}
std::string ToString() const;
};
@ -91,8 +99,11 @@ class XdsApi {
struct ClusterWeight {
std::string name;
uint32_t weight;
TypedPerFilterConfig typed_per_filter_config;
bool operator==(const ClusterWeight& other) const {
return (name == other.name && weight == other.weight);
return name == other.name && weight == other.weight &&
typed_per_filter_config == other.typed_per_filter_config;
}
std::string ToString() const;
};
@ -103,11 +114,13 @@ class XdsApi {
// not set.
absl::optional<Duration> max_stream_duration;
TypedPerFilterConfig typed_per_filter_config;
bool operator==(const Route& other) const {
return (matchers == other.matchers &&
cluster_name == other.cluster_name &&
weighted_clusters == other.weighted_clusters &&
max_stream_duration == other.max_stream_duration);
return matchers == other.matchers && cluster_name == other.cluster_name &&
weighted_clusters == other.weighted_clusters &&
max_stream_duration == other.max_stream_duration &&
typed_per_filter_config == other.typed_per_filter_config;
}
std::string ToString() const;
};
@ -116,9 +129,11 @@ class XdsApi {
struct VirtualHost {
std::vector<std::string> domains;
std::vector<Route> routes;
TypedPerFilterConfig typed_per_filter_config;
bool operator==(const VirtualHost& other) const {
return domains == other.domains && routes == other.routes;
return domains == other.domains && routes == other.routes &&
typed_per_filter_config == other.typed_per_filter_config;
}
};
@ -214,11 +229,24 @@ class XdsApi {
// Present only if it is inlined in the LDS response.
absl::optional<RdsUpdate> rds_update;
struct HttpFilter {
std::string name;
XdsHttpFilterImpl::FilterConfig config;
bool operator==(const HttpFilter& other) const {
return name == other.name && config == other.config;
}
std::string ToString() const;
};
std::vector<HttpFilter> http_filters;
bool operator==(const LdsUpdate& other) const {
return downstream_tls_context == other.downstream_tls_context &&
route_config_name == other.route_config_name &&
rds_update == other.rds_update &&
http_max_stream_duration == other.http_max_stream_duration;
http_max_stream_duration == other.http_max_stream_duration &&
http_filters == other.http_filters;
}
std::string ToString() const;
@ -397,7 +425,7 @@ class XdsApi {
std::set<std::string> resource_names_failed;
};
AdsParseResult ParseAdsResponse(
const grpc_slice& encoded_response,
const XdsBootstrap::XdsServer& server, const grpc_slice& encoded_response,
const std::set<absl::string_view>& expected_listener_names,
const std::set<absl::string_view>& expected_route_configuration_names,
const std::set<absl::string_view>& expected_cluster_names,

@ -38,6 +38,7 @@
#include "src/core/ext/xds/xds_channel_args.h"
#include "src/core/ext/xds/xds_client.h"
#include "src/core/ext/xds/xds_client_stats.h"
#include "src/core/ext/xds/xds_http_filters.h"
#include "src/core/lib/backoff/backoff.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/channel/channel_stack.h"
@ -1161,7 +1162,8 @@ bool XdsClient::ChannelState::AdsCallState::OnResponseReceivedLocked() {
recv_message_payload_ = nullptr;
// Parse and validate the response.
XdsApi::AdsParseResult result = xds_client()->api_.ParseAdsResponse(
response_slice, ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
chand()->server_, response_slice,
ResourceNamesForRequest(XdsApi::kLdsTypeUrl),
ResourceNamesForRequest(XdsApi::kRdsTypeUrl),
ResourceNamesForRequest(XdsApi::kCdsTypeUrl),
ResourceNamesForRequest(XdsApi::kEdsTypeUrl));
@ -2196,13 +2198,17 @@ XdsApi::ClusterLoadReportMap XdsClient::BuildLoadReportSnapshotLocked(
// accessors for global state
//
void XdsClientGlobalInit() { g_mu = new Mutex; }
void XdsClientGlobalInit() {
g_mu = new Mutex;
XdsHttpFilterRegistry::Init();
}
void XdsClientGlobalShutdown() {
delete g_mu;
g_mu = nullptr;
gpr_free(g_fallback_bootstrap_config);
g_fallback_bootstrap_config = nullptr;
XdsHttpFilterRegistry::Shutdown();
}
RefCountedPtr<XdsClient> XdsClient::GetOrCreate(grpc_error** error) {

@ -0,0 +1,107 @@
//
// Copyright 2021 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 <grpc/support/port_platform.h>
#include "src/core/ext/xds/xds_http_filters.h"
#include "envoy/extensions/filters/http/router/v3/router.upb.h"
#include "envoy/extensions/filters/http/router/v3/router.upbdefs.h"
namespace grpc_core {
const char* kXdsHttpRouterFilterConfigName =
"envoy.extensions.filters.http.router.v3.Router";
namespace {
class XdsHttpRouterFilter : public XdsHttpFilterImpl {
public:
void PopulateSymtab(upb_symtab* symtab) const override {
envoy_extensions_filters_http_router_v3_Router_getmsgdef(symtab);
}
absl::StatusOr<FilterConfig> GenerateFilterConfig(
upb_strview serialized_filter_config, upb_arena* arena) const override {
if (envoy_extensions_filters_http_router_v3_Router_parse(
serialized_filter_config.data, serialized_filter_config.size,
arena) == nullptr) {
return absl::InvalidArgumentError("could not parse router filter config");
}
return FilterConfig{kXdsHttpRouterFilterConfigName, Json()};
}
absl::StatusOr<FilterConfig> GenerateFilterConfigOverride(
upb_strview /*serialized_filter_config*/,
upb_arena* /*arena*/) const override {
return absl::InvalidArgumentError(
"router filter does not support config override");
}
// No-op -- this filter is special-cased by the xds resolver.
const grpc_channel_filter* channel_filter() const override { return nullptr; }
// No-op -- this filter is special-cased by the xds resolver.
absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
const FilterConfig& /*hcm_filter_config*/,
const FilterConfig* /*filter_config_override*/) const override {
return absl::UnimplementedError("router filter should never be called");
}
};
using FilterOwnerList = std::vector<std::unique_ptr<XdsHttpFilterImpl>>;
using FilterRegistryMap = std::map<absl::string_view, XdsHttpFilterImpl*>;
FilterOwnerList* g_filters = nullptr;
FilterRegistryMap* g_filter_registry = nullptr;
} // namespace
void XdsHttpFilterRegistry::RegisterFilter(
std::unique_ptr<XdsHttpFilterImpl> filter,
const std::set<absl::string_view>& config_proto_type_names) {
for (auto config_proto_type_name : config_proto_type_names) {
(*g_filter_registry)[config_proto_type_name] = filter.get();
}
g_filters->push_back(std::move(filter));
}
const XdsHttpFilterImpl* XdsHttpFilterRegistry::GetFilterForType(
absl::string_view proto_type_name) {
auto it = g_filter_registry->find(proto_type_name);
if (it == g_filter_registry->end()) return nullptr;
return it->second;
}
void XdsHttpFilterRegistry::PopulateSymtab(upb_symtab* symtab) {
for (const auto& filter : *g_filters) {
filter->PopulateSymtab(symtab);
}
}
void XdsHttpFilterRegistry::Init() {
g_filters = new FilterOwnerList;
g_filter_registry = new FilterRegistryMap;
RegisterFilter(absl::make_unique<XdsHttpRouterFilter>(),
{kXdsHttpRouterFilterConfigName});
}
void XdsHttpFilterRegistry::Shutdown() {
delete g_filter_registry;
delete g_filters;
}
} // namespace grpc_core

@ -0,0 +1,124 @@
//
// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_CORE_EXT_XDS_XDS_HTTP_FILTERS_H
#define GRPC_CORE_EXT_XDS_XDS_HTTP_FILTERS_H
#include <grpc/support/port_platform.h>
#include <memory>
#include <set>
#include <string>
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/any.upb.h"
#include "upb/def.h"
#include <grpc/grpc.h>
#include "src/core/lib/channel/channel_stack.h"
#include "src/core/lib/json/json.h"
namespace grpc_core {
extern const char* kXdsHttpRouterFilterConfigName;
class XdsHttpFilterImpl {
public:
struct FilterConfig {
absl::string_view config_proto_type_name;
Json config;
bool operator==(const FilterConfig& other) const {
return config_proto_type_name == other.config_proto_type_name &&
config == other.config;
}
std::string ToString() const {
return absl::StrCat("{config_proto_type_name=", config_proto_type_name,
" config=", config.Dump(), "}");
}
};
// Service config data for the filter, returned by GenerateServiceConfig().
struct ServiceConfigJsonEntry {
// The top-level field name in the method config.
// Filter implementations should use their primary config proto type
// name for this.
// The value of this field in the method config will be a JSON array,
// which will be populated with the elements returned by each filter
// instance.
std::string service_config_field_name;
// The element to add to the JSON array.
std::string element;
};
virtual ~XdsHttpFilterImpl() = default;
// Loads the proto message into the upb symtab.
virtual void PopulateSymtab(upb_symtab* symtab) const = 0;
// Generates a Config from the xDS filter config proto.
// Used for the top-level config in the HCM HTTP filter list.
virtual absl::StatusOr<FilterConfig> GenerateFilterConfig(
upb_strview serialized_filter_config, upb_arena* arena) const = 0;
// Generates a Config from the xDS filter config proto.
// Used for the typed_per_filter_config override in VirtualHost and Route.
virtual absl::StatusOr<FilterConfig> GenerateFilterConfigOverride(
upb_strview serialized_filter_config, upb_arena* arena) const = 0;
// C-core channel filter implementation.
virtual const grpc_channel_filter* channel_filter() const = 0;
// Modifies channel args that may affect service config parsing (not
// visible to the channel as a whole).
// Takes ownership of args. Caller takes ownership of return value.
virtual grpc_channel_args* ModifyChannelArgs(grpc_channel_args* args) const {
return args;
}
// Function to convert the Configs into a JSON string to be added to the
// per-method part of the service config.
// The hcm_filter_config comes from the HttpConnectionManager config.
// The filter_config_override comes from the first of the ClusterWeight,
// Route, or VirtualHost entries that it is found in, or null if
// there is no override in any of those locations.
virtual absl::StatusOr<ServiceConfigJsonEntry> GenerateServiceConfig(
const FilterConfig& hcm_filter_config,
const FilterConfig* filter_config_override) const = 0;
};
class XdsHttpFilterRegistry {
public:
static void RegisterFilter(
std::unique_ptr<XdsHttpFilterImpl> filter,
const std::set<absl::string_view>& config_proto_type_names);
static const XdsHttpFilterImpl* GetFilterForType(
absl::string_view proto_type_name);
static void PopulateSymtab(upb_symtab* symtab);
// Global init and shutdown.
static void Init();
static void Shutdown();
};
} // namespace grpc_core
#endif /* GRPC_CORE_EXT_XDS_XDS_HTTP_FILTERS_H */

@ -81,6 +81,18 @@ grpc_channel_element* grpc_channel_stack_last_element(
return grpc_channel_stack_element(channel_stack, channel_stack->count - 1);
}
size_t grpc_channel_stack_filter_instance_number(
grpc_channel_stack* channel_stack, grpc_channel_element* elem) {
size_t num_found = 0;
for (size_t i = 0; i < channel_stack->count; ++i) {
grpc_channel_element* element =
grpc_channel_stack_element(channel_stack, i);
if (element == elem) break;
if (element->filter == elem->filter) ++num_found;
}
return num_found;
}
grpc_call_element* grpc_call_stack_element(grpc_call_stack* call_stack,
size_t index) {
return CALL_ELEMS_FROM_STACK(call_stack) + index;

@ -204,6 +204,13 @@ grpc_channel_element* grpc_channel_stack_element(grpc_channel_stack* stack,
/* Get the last channel element in a channel stack */
grpc_channel_element* grpc_channel_stack_last_element(
grpc_channel_stack* stack);
// A utility function for a filter to determine how many other instances
// of the same filter exist above it in the same stack. Intended to be
// used in the filter's init_channel_elem() method.
size_t grpc_channel_stack_filter_instance_number(
grpc_channel_stack* channel_stack, grpc_channel_element* elem);
/* Get a call stack element given a call stack and an index */
grpc_call_element* grpc_call_stack_element(grpc_call_stack* stack, size_t i);

@ -35,12 +35,20 @@
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/static_metadata.h"
#define GRPC_ARG_LAME_FILTER_ERROR "grpc.lame_filter_error"
namespace grpc_core {
namespace {
struct ChannelData {
ChannelData() : state_tracker("lame_channel", GRPC_CHANNEL_SHUTDOWN) {}
explicit ChannelData(grpc_channel_element_args* args)
: state_tracker("lame_channel", GRPC_CHANNEL_SHUTDOWN) {
grpc_error* err = grpc_channel_args_find_pointer<grpc_error>(
args->channel_args, GRPC_ARG_LAME_FILTER_ERROR);
if (err != nullptr) error = GRPC_ERROR_REF(err);
}
~ChannelData() { GRPC_ERROR_UNREF(error); }
grpc_error* error = GRPC_ERROR_NONE;
@ -105,9 +113,7 @@ static void lame_destroy_call_elem(grpc_call_element* /*elem*/,
static grpc_error* lame_init_channel_elem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
GPR_ASSERT(args->is_first);
GPR_ASSERT(args->is_last);
new (elem->channel_data) ChannelData;
new (elem->channel_data) ChannelData(args);
return GRPC_ERROR_NONE;
}
@ -116,12 +122,25 @@ static void lame_destroy_channel_elem(grpc_channel_element* elem) {
chand->~ChannelData();
}
// Channel arg vtable for a grpc_error*.
void* ErrorCopy(void* p) {
grpc_error* error = static_cast<grpc_error*>(p);
return GRPC_ERROR_REF(error);
}
void ErrorDestroy(void* p) {
grpc_error* error = static_cast<grpc_error*>(p);
GRPC_ERROR_UNREF(error);
}
int ErrorCompare(void* p, void* q) { return GPR_ICMP(p, q); }
const grpc_arg_pointer_vtable kLameFilterErrorArgVtable = {
ErrorCopy, ErrorDestroy, ErrorCompare};
} // namespace
void SetLameFilterError(grpc_channel_element* elem, grpc_error* error) {
GPR_ASSERT(elem->filter == &grpc_lame_filter);
auto chand = static_cast<grpc_core::ChannelData*>(elem->channel_data);
chand->error = error;
grpc_arg MakeLameClientErrorArg(grpc_error* error) {
return grpc_channel_arg_pointer_create(
const_cast<char*>(GRPC_ARG_LAME_FILTER_ERROR), error,
&kLameFilterErrorArgVtable);
}
} // namespace grpc_core
@ -146,20 +165,20 @@ grpc_channel* grpc_lame_client_channel_create(const char* target,
grpc_status_code error_code,
const char* error_message) {
grpc_core::ExecCtx exec_ctx;
grpc_channel_element* elem;
grpc_channel* channel =
grpc_channel_create(target, nullptr, GRPC_CLIENT_LAME_CHANNEL, nullptr);
elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0);
GRPC_API_TRACE(
"grpc_lame_client_channel_create(target=%s, error_code=%d, "
"error_message=%s)",
3, (target, (int)error_code, error_message));
grpc_core::SetLameFilterError(
elem, grpc_error_set_str(
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("lame client channel"),
GRPC_ERROR_INT_GRPC_STATUS, error_code),
GRPC_ERROR_STR_GRPC_MESSAGE,
grpc_slice_from_static_string(error_message)));
grpc_error* error = grpc_error_set_str(
grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("lame client channel"),
GRPC_ERROR_INT_GRPC_STATUS, error_code),
GRPC_ERROR_STR_GRPC_MESSAGE,
grpc_slice_from_static_string(error_message));
grpc_arg error_arg = grpc_core::MakeLameClientErrorArg(error);
grpc_channel_args args = {1, &error_arg};
grpc_channel* channel =
grpc_channel_create(target, &args, GRPC_CLIENT_LAME_CHANNEL, nullptr);
GRPC_ERROR_UNREF(error);
return channel;
}

@ -23,10 +23,11 @@
#include "src/core/lib/channel/channel_stack.h"
extern const grpc_channel_filter grpc_lame_filter;
namespace grpc_core {
void SetLameFilterError(grpc_channel_element* elem, grpc_error* error);
// Does NOT take ownership of error.
grpc_arg MakeLameClientErrorArg(grpc_error* error);
} // namespace grpc_core
extern const grpc_channel_filter grpc_lame_filter;
#endif /* GRPC_CORE_LIB_SURFACE_LAME_CLIENT_H */

@ -186,6 +186,7 @@ grpc_proto_library(
srcs = [
"http_connection_manager.proto",
],
well_known_protos = True,
deps = [
"config_source_proto",
"protocol_proto",
@ -193,6 +194,13 @@ grpc_proto_library(
],
)
grpc_proto_library(
name = "router_proto",
srcs = [
"router.proto",
],
)
grpc_proto_library(
name = "string_proto",
srcs = [

@ -18,6 +18,8 @@ syntax = "proto3";
package envoy.extensions.filters.network.http_connection_manager.v3;
import "google/protobuf/any.proto";
import "src/proto/grpc/testing/xds/v3/config_source.proto";
import "src/proto/grpc/testing/xds/v3/protocol.proto";
import "src/proto/grpc/testing/xds/v3/route.proto";
@ -40,6 +42,11 @@ message HttpConnectionManager {
ScopedRoutes scoped_routes = 31;
}
// A list of individual HTTP filters that make up the filter chain for
// requests made to the connection manager. :ref:`Order matters <arch_overview_http_filters_ordering>`
// as the filters are processed sequentially as request events happen.
repeated HttpFilter http_filters = 5;
// Additional settings for HTTP requests handled by the connection manager. These will be
// applicable to both HTTP1 and HTTP2 requests.
config.core.v3.HttpProtocolOptions common_http_protocol_options = 35;
@ -58,3 +65,18 @@ message Rds {
message ScopedRoutes {
}
message HttpFilter {
// The name of the filter configuration. The name is used as a fallback to
// select an extension if the type of the configuration proto is not
// sufficient. It also serves as a resource name in ExtensionConfigDS.
string name = 1;
oneof config_type {
// Filter specific configuration which depends on the filter being instantiated. See the supported
// filters for further documentation.
google.protobuf.Any typed_config = 4;
}
bool is_optional = 6;
}

@ -23,6 +23,7 @@ import "src/proto/grpc/testing/xds/v3/regex.proto";
import "src/proto/grpc/testing/xds/v3/percent.proto";
import "src/proto/grpc/testing/xds/v3/range.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
@ -64,6 +65,13 @@ message VirtualHost {
// The list of routes that will be matched, in order, for incoming requests.
// The first route that matches will be used.
repeated Route routes = 3;
// The per_filter_config field can be used to provide virtual host-specific
// configurations for filters. The key should match the filter name, such as
// *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
// for if and how it is utilized.
map<string, google.protobuf.Any> typed_per_filter_config = 15;
}
// A route is both a specification of how to match a request as well as an indication of what to do
@ -88,6 +96,13 @@ message Route {
// Return a redirect.
RedirectAction redirect = 3;
}
// The typed_per_filter_config field can be used to provide route-specific
// configurations for filters. The key should match the filter name, such as
// *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter
// specific; see the :ref:`HTTP filter documentation <config_http_filters>` for
// if and how it is utilized.
map<string, google.protobuf.Any> typed_per_filter_config = 13;
}
// Compared to the :ref:`cluster <envoy_api_field_config.route.v3.RouteAction.cluster>` field that specifies a
@ -108,6 +123,13 @@ message WeightedCluster {
// the choice of an upstream cluster is determined by its weight. The sum of weights across all
// entries in the clusters array must add up to the total_weight, which defaults to 100.
google.protobuf.UInt32Value weight = 2;
// The per_filter_config field can be used to provide weighted cluster-specific
// configurations for filters. The key should match the filter name, such as
// *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
// for if and how it is utilized.
map<string, google.protobuf.Any> typed_per_filter_config = 10;
}
// Specifies one or more upstream clusters associated with the route.
@ -334,3 +356,13 @@ message RouteConfiguration {
message RedirectAction {
}
message FilterConfig {
// The filter config.
google.protobuf.Any config = 1;
// If true, the filter is optional, meaning that if the client does
// not support the specified filter, it may ignore the map entry rather
// than rejecting the config.
bool is_optional = 2;
}

@ -0,0 +1,28 @@
// Copyright 2021 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.router.v3;
// [#protodoc-title: Router]
// Router :ref:`configuration overview <config_http_filters_router>`.
// [#extension: envoy.filters.http.router]
// We don't actually use any of the fields in this message, but we need
// the message itself to signify which filter to use.
message Router {
}

@ -153,6 +153,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c',
'src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c',
'src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c',
'src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c',
'src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c',
@ -201,6 +202,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upb-generated/udpa/annotations/status.upb.c',
'src/core/ext/upb-generated/udpa/annotations/versioning.upb.c',
'src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c',
'src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c',
'src/core/ext/upb-generated/validate/validate.upb.c',
'src/core/ext/upb-generated/xds/core/v3/authority.upb.c',
'src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c',
@ -240,6 +242,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upbdefs-generated/envoy/config/route/v3/scoped_route.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c',
'src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/common.upbdefs.c',
@ -280,6 +283,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/upbdefs-generated/udpa/annotations/sensitive.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c',
'src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c',
'src/core/ext/upbdefs-generated/validate/validate.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c',
'src/core/ext/upbdefs-generated/xds/core/v3/collection_entry.upbdefs.c',
@ -295,6 +299,7 @@ CORE_SOURCE_FILES = [
'src/core/ext/xds/xds_certificate_provider.cc',
'src/core/ext/xds/xds_client.cc',
'src/core/ext/xds/xds_client_stats.cc',
'src/core/ext/xds/xds_http_filters.cc',
'src/core/ext/xds/xds_server_config_fetcher.cc',
'src/core/lib/avl/avl.cc',
'src/core/lib/backoff/backoff.cc',

@ -544,6 +544,7 @@ grpc_cc_test(
"//src/proto/grpc/testing/xds/v3:listener_proto",
"//src/proto/grpc/testing/xds/v3:lrs_proto",
"//src/proto/grpc/testing/xds/v3:route_proto",
"//src/proto/grpc/testing/xds/v3:router_proto",
"//src/proto/grpc/testing/xds/v3:tls_proto",
"//test/core/util:grpc_test_util",
"//test/cpp/util:test_util",

@ -91,6 +91,7 @@
#include "src/proto/grpc/testing/xds/v3/listener.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/lrs.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/route.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/router.grpc.pb.h"
#include "src/proto/grpc/testing/xds/v3/tls.grpc.pb.h"
namespace grpc {
@ -1558,6 +1559,13 @@ class XdsEnd2endTest : public ::testing::TestWithParam<TestType> {
// Initialize default xDS resources.
// Construct LDS resource.
default_listener_.set_name(kServerName);
HttpConnectionManager http_connection_manager;
auto* filter = http_connection_manager.add_http_filters();
filter->set_name("router");
filter->mutable_typed_config()->PackFrom(
envoy::extensions::filters::http::router::v3::Router());
default_listener_.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
// Construct RDS resource.
default_route_config_.set_name(kDefaultRouteConfigurationName);
auto* virtual_host = default_route_config_.add_virtual_hosts();
@ -1993,6 +2001,10 @@ class XdsEnd2endTest : public ::testing::TestWithParam<TestType> {
static Listener BuildListener(const RouteConfiguration& route_config) {
HttpConnectionManager http_connection_manager;
*(http_connection_manager.mutable_route_config()) = route_config;
auto* filter = http_connection_manager.add_http_filters();
filter->set_name("router");
filter->mutable_typed_config()->PackFrom(
envoy::extensions::filters::http::router::v3::Router());
Listener listener;
listener.set_name(kServerName);
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
@ -2611,6 +2623,8 @@ TEST_P(XdsResolverOnlyTest, RestartsRequestsUponReconnection) {
// Manually configure use of RDS.
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
auto* rds = http_connection_manager.mutable_rds();
rds->set_route_config_name(kDefaultRouteConfigurationName);
rds->mutable_config_source()->mutable_ads();
@ -3012,7 +3026,7 @@ TEST_P(LdsTest, NoApiListener) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
@ -3025,6 +3039,8 @@ TEST_P(LdsTest, NoApiListener) {
TEST_P(LdsTest, WrongRouteSpecifier) {
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
http_connection_manager.mutable_scoped_routes();
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
@ -3032,7 +3048,7 @@ TEST_P(LdsTest, WrongRouteSpecifier) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
@ -3046,6 +3062,8 @@ TEST_P(LdsTest, WrongRouteSpecifier) {
TEST_P(LdsTest, RdsMissingConfigSource) {
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
http_connection_manager.mutable_rds()->set_route_config_name(
kDefaultRouteConfigurationName);
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
@ -3054,7 +3072,7 @@ TEST_P(LdsTest, RdsMissingConfigSource) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -3067,6 +3085,8 @@ TEST_P(LdsTest, RdsMissingConfigSource) {
TEST_P(LdsTest, RdsConfigSourceDoesNotSpecifyAds) {
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
auto* rds = http_connection_manager.mutable_rds();
rds->set_route_config_name(kDefaultRouteConfigurationName);
rds->mutable_config_source()->mutable_self();
@ -3076,7 +3096,7 @@ TEST_P(LdsTest, RdsConfigSourceDoesNotSpecifyAds) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
@ -3104,7 +3124,7 @@ TEST_P(LdsTest, MultipleBadResources) {
EchoResponse response;
grpc::Status status = stub2->Echo(&context, request, &response);
EXPECT_FALSE(status.ok());
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
@ -3117,6 +3137,196 @@ TEST_P(LdsTest, MultipleBadResources) {
": Listener has neither address nor ApiListener"))));
}
// TODO(roth): Remove this test when we remove the
// GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION environment variable guard.
TEST_P(LdsTest, HttpFiltersEnabled) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
SetNextResolutionForLbChannelAllBalancers();
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts()},
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
WaitForAllBackends();
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we fail RPCs if there is no router filter.
TEST_P(LdsTest, FailRpcsIfNoHttpRouterFilter) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
SetNextResolutionForLbChannelAllBalancers();
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
http_connection_manager.clear_http_filters();
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
SetListenerAndRouteConfiguration(0, listener, default_route_config_);
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts()},
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
Status status = SendRpc();
EXPECT_EQ(status.error_code(), StatusCode::UNAVAILABLE);
EXPECT_EQ(status.error_message(), "no xDS HTTP router filter configured");
// Wait until xDS server sees ACK.
while (balancers_[0]->ads_service()->lds_response_state().state ==
AdsServiceImpl::ResponseState::SENT) {
CheckRpcSendFailure();
}
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// TODO(lidiz): As part of adding the fault injection filter, add a test
// that we ignore filters after the router filter.
// Test that we NACK empty filter names.
TEST_P(LdsTest, RejectsEmptyHttpFilterName) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
auto* filter = http_connection_manager.add_http_filters();
filter->mutable_typed_config()->PackFrom(Listener());
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
SetListenerAndRouteConfiguration(0, listener, default_route_config_);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (balancers_[0]->ads_service()->lds_response_state().state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("empty filter name at index 1"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK duplicate HTTP filter names.
TEST_P(LdsTest, RejectsDuplicateHttpFilterName) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
*http_connection_manager.add_http_filters() =
http_connection_manager.http_filters(0);
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
SetListenerAndRouteConfiguration(0, listener, default_route_config_);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (balancers_[0]->ads_service()->lds_response_state().state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("duplicate HTTP filter name: router"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unknown filter types.
TEST_P(LdsTest, RejectsUnknownHttpFilterType) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
auto* filter = http_connection_manager.add_http_filters();
filter->set_name("unknown");
filter->mutable_typed_config()->PackFrom(Listener());
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
SetListenerAndRouteConfiguration(0, listener, default_route_config_);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (balancers_[0]->ads_service()->lds_response_state().state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("no filter registered for config type "
"envoy.config.listener.v3.Listener"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we ignore optional unknown filter types.
TEST_P(LdsTest, IgnoresOptionalUnknownHttpFilterType) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
auto* filter = http_connection_manager.add_http_filters();
filter->set_name("unknown");
filter->mutable_typed_config()->PackFrom(Listener());
filter->set_is_optional(true);
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
SetListenerAndRouteConfiguration(0, listener, default_route_config_);
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts()},
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
SetNextResolutionForLbChannelAllBalancers();
WaitForAllBackends();
EXPECT_EQ(balancers_[0]->ads_service()->lds_response_state().state,
AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unparseable filter configs.
TEST_P(LdsTest, RejectsUnparseableHttpFilterType) {
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
auto* filter = http_connection_manager.add_http_filters();
filter->set_name("unknown");
filter->mutable_typed_config()->PackFrom(listener);
filter->mutable_typed_config()->set_type_url(
"type.googleapis.com/envoy.extensions.filters.http.router.v3.Router");
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
SetListenerAndRouteConfiguration(0, listener, default_route_config_);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (balancers_[0]->ads_service()->lds_response_state().state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
::testing::HasSubstr(
"filter config for type "
"envoy.extensions.filters.http.router.v3.Router failed to parse"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
using LdsRdsTest = BasicTest;
// Tests that LDS client should send an ACK upon correct LDS response (with
@ -3168,7 +3378,7 @@ TEST_P(LdsRdsTest, NoMatchedDomain) {
CheckRpcSendFailure();
// Do a bit of polling, to allow the ACK to get to the ADS server.
channel_->WaitForConnected(grpc_timeout_milliseconds_to_deadline(100));
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -3215,7 +3425,7 @@ TEST_P(LdsRdsTest, RouteMatchHasQueryParameters) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3234,7 +3444,7 @@ TEST_P(LdsRdsTest, RouteMatchHasValidPrefixEmptyOrSingleSlash) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
(void)SendRpc();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -3248,7 +3458,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPrefixNoLeadingSlash) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3264,7 +3474,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPrefixExtraContent) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3280,7 +3490,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPrefixDoubleSlash) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3296,7 +3506,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathEmptyPath) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3312,7 +3522,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathNoLeadingSlash) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3328,7 +3538,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathTooManySlashes) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3344,7 +3554,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathOnlyOneSlash) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3360,7 +3570,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathMissingService) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3376,7 +3586,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathMissingMethod) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No valid routes specified."));
@ -3393,7 +3603,7 @@ TEST_P(LdsRdsTest, RouteMatchHasInvalidPathRegex) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr(
@ -3409,7 +3619,7 @@ TEST_P(LdsRdsTest, RouteHasNoRouteAction) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("No RouteAction found in route."));
@ -3427,7 +3637,7 @@ TEST_P(LdsRdsTest, RouteActionClusterHasEmptyClusterName) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
@ -3455,7 +3665,7 @@ TEST_P(LdsRdsTest, RouteActionWeightedTargetHasIncorrectTotalWeightSet) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr(
@ -3482,7 +3692,7 @@ TEST_P(LdsRdsTest, RouteActionWeightedClusterHasZeroTotalWeight) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
@ -3510,7 +3720,7 @@ TEST_P(LdsRdsTest, RouteActionWeightedTargetClusterHasEmptyClusterName) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
@ -3538,7 +3748,7 @@ TEST_P(LdsRdsTest, RouteActionWeightedTargetClusterHasNoWeight) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr(
@ -3558,7 +3768,7 @@ TEST_P(LdsRdsTest, RouteHeaderMatchInvalidRegex) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
@ -3580,7 +3790,7 @@ TEST_P(LdsRdsTest, RouteHeaderMatchInvalidRange) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
@ -4642,6 +4852,8 @@ TEST_P(LdsRdsTest, XdsRoutingApplyXdsTimeout) {
// Construct listener.
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
// Set up HTTP max_stream_duration of 3.5 seconds
auto* duration =
http_connection_manager.mutable_common_http_protocol_options()
@ -4780,6 +4992,8 @@ TEST_P(LdsRdsTest, XdsRoutingHttpTimeoutDisabled) {
// Construct listener.
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
// Set up HTTP max_stream_duration of 3.5 seconds
auto* duration =
http_connection_manager.mutable_common_http_protocol_options()
@ -4845,6 +5059,8 @@ TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenXdsTimeoutExplicit0) {
// Construct listener.
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
// Set up HTTP max_stream_duration of 3.5 seconds
auto* duration =
http_connection_manager.mutable_common_http_protocol_options()
@ -4918,14 +5134,16 @@ TEST_P(LdsRdsTest, XdsRoutingApplyApplicationTimeoutWhenHttpTimeoutExplicit0) {
{"locality0", {grpc_pick_unused_port_or_die()}},
});
balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
auto listener = default_listener_;
HttpConnectionManager http_connection_manager;
listener.mutable_api_listener()->mutable_api_listener()->UnpackTo(
&http_connection_manager);
// Set up HTTP max_stream_duration to be explicit 0
auto* duration =
http_connection_manager.mutable_common_http_protocol_options()
->mutable_max_stream_duration();
duration->set_seconds(0);
duration->set_nanos(0);
auto listener = default_listener_;
listener.mutable_api_listener()->mutable_api_listener()->PackFrom(
http_connection_manager);
// Set listener and route config.
@ -5051,7 +5269,7 @@ TEST_P(LdsRdsTest, XdsRoutingHeadersMatching) {
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
EXPECT_EQ(kNumEcho1Rpcs, backends_[1]->backend_service1()->request_count());
EXPECT_EQ(0, backends_[1]->backend_service2()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -5098,7 +5316,7 @@ TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialHeaderContentType) {
CheckRpcSendOk(kNumEchoRpcs);
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -5166,7 +5384,7 @@ TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingSpecialCasesToIgnore) {
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(0, backends_[1]->backend_service()->request_count());
EXPECT_EQ(0, backends_[2]->backend_service()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -5223,7 +5441,7 @@ TEST_P(LdsRdsTest, XdsRoutingRuntimeFractionMatching) {
(1 - kErrorTolerance)),
::testing::Le(static_cast<double>(kNumRpcs) * 25 / 100 *
(1 + kErrorTolerance))));
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -5322,7 +5540,7 @@ TEST_P(LdsRdsTest, XdsRoutingHeadersMatchingUnmatchCases) {
EXPECT_EQ(kNumEchoRpcs, backends_[0]->backend_service()->request_count());
EXPECT_EQ(kNumEcho1Rpcs, backends_[0]->backend_service1()->request_count());
EXPECT_EQ(0, backends_[0]->backend_service2()->request_count());
const auto& response_state = RouteConfigurationResponseState(0);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::ACKED);
}
@ -5389,6 +5607,253 @@ TEST_P(LdsRdsTest, XdsRoutingChangeRoutesWithoutChangingClusters) {
EXPECT_EQ(1, backends_[1]->backend_service2()->request_count());
}
// Test that we NACK unknown filter types in VirtualHost.
TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInVirtualHost) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* per_filter_config =
route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
(*per_filter_config)["unknown"].PackFrom(Listener());
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (RouteConfigurationResponseState(0).state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("no filter registered for config type "
"envoy.config.listener.v3.Listener"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we ignore optional unknown filter types in VirtualHost.
TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInVirtualHost) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* per_filter_config =
route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
::envoy::config::route::v3::FilterConfig filter_config;
filter_config.mutable_config()->PackFrom(Listener());
filter_config.set_is_optional(true);
(*per_filter_config)["unknown"].PackFrom(filter_config);
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts()},
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
WaitForAllBackends();
EXPECT_EQ(RouteConfigurationResponseState(0).state,
AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unparseable filter types in VirtualHost.
TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInVirtualHost) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* per_filter_config =
route_config.mutable_virtual_hosts(0)->mutable_typed_per_filter_config();
(*per_filter_config)["unknown"].PackFrom(
envoy::extensions::filters::http::router::v3::Router());
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (RouteConfigurationResponseState(0).state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
::testing::HasSubstr("router filter does not support config override"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unknown filter types in Route.
TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInRoute) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* per_filter_config = route_config.mutable_virtual_hosts(0)
->mutable_routes(0)
->mutable_typed_per_filter_config();
(*per_filter_config)["unknown"].PackFrom(Listener());
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (RouteConfigurationResponseState(0).state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("no filter registered for config type "
"envoy.config.listener.v3.Listener"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we ignore optional unknown filter types in Route.
TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInRoute) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* per_filter_config = route_config.mutable_virtual_hosts(0)
->mutable_routes(0)
->mutable_typed_per_filter_config();
::envoy::config::route::v3::FilterConfig filter_config;
filter_config.mutable_config()->PackFrom(Listener());
filter_config.set_is_optional(true);
(*per_filter_config)["unknown"].PackFrom(filter_config);
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts()},
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
WaitForAllBackends();
EXPECT_EQ(RouteConfigurationResponseState(0).state,
AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unparseable filter types in Route.
TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInRoute) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* per_filter_config = route_config.mutable_virtual_hosts(0)
->mutable_routes(0)
->mutable_typed_per_filter_config();
(*per_filter_config)["unknown"].PackFrom(
envoy::extensions::filters::http::router::v3::Router());
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (RouteConfigurationResponseState(0).state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
::testing::HasSubstr("router filter does not support config override"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unknown filter types in ClusterWeight.
TEST_P(LdsRdsTest, RejectsUnknownHttpFilterTypeInClusterWeight) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* cluster_weight = route_config.mutable_virtual_hosts(0)
->mutable_routes(0)
->mutable_route()
->mutable_weighted_clusters()
->add_clusters();
cluster_weight->set_name(kDefaultClusterName);
cluster_weight->mutable_weight()->set_value(100);
auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
(*per_filter_config)["unknown"].PackFrom(Listener());
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (RouteConfigurationResponseState(0).state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
::testing::HasSubstr("no filter registered for config type "
"envoy.config.listener.v3.Listener"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we ignore optional unknown filter types in ClusterWeight.
TEST_P(LdsRdsTest, IgnoresOptionalUnknownHttpFilterTypeInClusterWeight) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* cluster_weight = route_config.mutable_virtual_hosts(0)
->mutable_routes(0)
->mutable_route()
->mutable_weighted_clusters()
->add_clusters();
cluster_weight->set_name(kDefaultClusterName);
cluster_weight->mutable_weight()->set_value(100);
auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
::envoy::config::route::v3::FilterConfig filter_config;
filter_config.mutable_config()->PackFrom(Listener());
filter_config.set_is_optional(true);
(*per_filter_config)["unknown"].PackFrom(filter_config);
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
AdsServiceImpl::EdsResourceArgs args({
{"locality0", GetBackendPorts()},
});
balancers_[0]->ads_service()->SetEdsResource(
BuildEdsResource(args, DefaultEdsServiceName()));
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
WaitForAllBackends();
EXPECT_EQ(RouteConfigurationResponseState(0).state,
AdsServiceImpl::ResponseState::ACKED);
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// Test that we NACK unparseable filter types in ClusterWeight.
TEST_P(LdsRdsTest, RejectsUnparseableHttpFilterTypeInClusterWeight) {
if (GetParam().use_v2()) return; // Filters supported in v3 only.
gpr_setenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION", "true");
RouteConfiguration route_config = default_route_config_;
auto* cluster_weight = route_config.mutable_virtual_hosts(0)
->mutable_routes(0)
->mutable_route()
->mutable_weighted_clusters()
->add_clusters();
cluster_weight->set_name(kDefaultClusterName);
cluster_weight->mutable_weight()->set_value(100);
auto* per_filter_config = cluster_weight->mutable_typed_per_filter_config();
(*per_filter_config)["unknown"].PackFrom(
envoy::extensions::filters::http::router::v3::Router());
SetListenerAndRouteConfiguration(0, default_listener_, route_config);
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
// Wait until xDS server sees NACK.
do {
CheckRpcSendFailure();
} while (RouteConfigurationResponseState(0).state ==
AdsServiceImpl::ResponseState::SENT);
const auto response_state = RouteConfigurationResponseState(0);
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
response_state.error_message,
::testing::HasSubstr("router filter does not support config override"));
gpr_unsetenv("GRPC_XDS_EXPERIMENTAL_FAULT_INJECTION");
}
// TODO(lidiz): As part of adding the fault injection filter, add tests
// for overriding filter configs in the typed_per_filter_config fields in
// each of VirtualHost, Route, and ClusterWeight.
using CdsTest = BasicTest;
// Tests that CDS client should send an ACK upon correct CDS response.
@ -5598,7 +6063,7 @@ TEST_P(CdsTest, LogicalDNSClusterTypeDisabled) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5620,7 +6085,7 @@ TEST_P(CdsTest, AggregateClusterTypeDisabled) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5636,7 +6101,7 @@ TEST_P(CdsTest, UnsupportedClusterType) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5663,7 +6128,7 @@ TEST_P(CdsTest, MultipleBadResources) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5683,7 +6148,7 @@ TEST_P(CdsTest, WrongEdsConfig) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5699,7 +6164,7 @@ TEST_P(CdsTest, WrongLbPolicy) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5715,7 +6180,7 @@ TEST_P(CdsTest, WrongLrsServer) {
SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers();
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5883,7 +6348,7 @@ TEST_P(XdsSecurityTest,
transport_socket->set_name("envoy.transport_sockets.tls");
balancers_[0]->ads_service()->SetCdsResource(cluster);
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5906,7 +6371,7 @@ TEST_P(
transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
balancers_[0]->ads_service()->SetCdsResource(cluster);
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5928,7 +6393,7 @@ TEST_P(
transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
balancers_[0]->ads_service()->SetCdsResource(cluster);
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -5958,7 +6423,7 @@ TEST_P(XdsSecurityTest, RegexSanMatcherDoesNotAllowIgnoreCase) {
transport_socket->mutable_typed_config()->PackFrom(upstream_tls_context);
balancers_[0]->ads_service()->SetCdsResource(cluster);
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->cds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -6387,7 +6852,7 @@ TEST_P(XdsEnabledServerTest, BadLdsUpdateNoApiListenerNorAddress) {
listener.add_filter_chains();
balancers_[0]->ads_service()->SetLdsResource(listener);
CheckRpcSendFailure(1, RpcOptions().set_wait_for_ready(true));
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
@ -6411,7 +6876,7 @@ TEST_P(XdsEnabledServerTest, BadLdsUpdateBothApiListenerAndAddress) {
listener.mutable_api_listener();
balancers_[0]->ads_service()->SetLdsResource(listener);
CheckRpcSendFailure(1, RpcOptions().set_wait_for_ready(true));
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(
@ -6671,7 +7136,7 @@ TEST_P(XdsServerSecurityTest, TlsConfigurationWithoutRootProviderInstance) {
transport_socket->mutable_typed_config()->PackFrom(downstream_tls_context);
balancers_[0]->ads_service()->SetLdsResource(listener);
CheckRpcSendFailure(1, RpcOptions().set_wait_for_ready(true));
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->lds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,
@ -6934,7 +7399,7 @@ TEST_P(EdsTest, NacksSparsePriorityList) {
});
balancers_[0]->ads_service()->SetEdsResource(BuildEdsResource(args));
CheckRpcSendFailure();
const auto& response_state =
const auto response_state =
balancers_[0]->ads_service()->eds_response_state();
EXPECT_EQ(response_state.state, AdsServiceImpl::ResponseState::NACKED);
EXPECT_THAT(response_state.error_message,

@ -76,6 +76,7 @@ proto_files=( \
"envoy/config/route/v3/scoped_route.proto" \
"envoy/config/trace/v3/http_tracer.proto" \
"envoy/extensions/clusters/aggregate/v3/cluster.proto" \
"envoy/extensions/filters/http/router/v3/router.proto" \
"envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto" \
"envoy/extensions/transport_sockets/tls/v3/cert.proto" \
"envoy/extensions/transport_sockets/tls/v3/common.proto" \
@ -126,6 +127,7 @@ proto_files=( \
"udpa/annotations/sensitive.proto" \
"udpa/annotations/status.proto" \
"udpa/annotations/versioning.proto" \
"udpa/type/v1/typed_struct.proto" \
"xds/core/v3/authority.proto" \
"xds/core/v3/collection_entry.proto" \
"xds/core/v3/context_params.proto" \

@ -1292,6 +1292,8 @@ src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c \
@ -1386,6 +1388,8 @@ src/core/ext/upb-generated/udpa/annotations/versioning.upb.c \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.h \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h \
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/validate/validate.upb.h \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
@ -1464,6 +1468,8 @@ src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
@ -1542,6 +1548,8 @@ src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
@ -1574,6 +1582,8 @@ src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client.h \
src/core/ext/xds/xds_client_stats.cc \
src/core/ext/xds/xds_client_stats.h \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_http_filters.h \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/avl/avl.cc \
src/core/lib/avl/avl.h \

@ -1128,6 +1128,8 @@ src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c \
src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c \
src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c \
src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h \
src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/cert.upb.c \
@ -1222,6 +1224,8 @@ src/core/ext/upb-generated/udpa/annotations/versioning.upb.c \
src/core/ext/upb-generated/udpa/annotations/versioning.upb.h \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.c \
src/core/ext/upb-generated/udpa/data/orca/v1/orca_load_report.upb.h \
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.c \
src/core/ext/upb-generated/udpa/type/v1/typed_struct.upb.h \
src/core/ext/upb-generated/validate/validate.upb.c \
src/core/ext/upb-generated/validate/validate.upb.h \
src/core/ext/upb-generated/xds/core/v3/authority.upb.c \
@ -1300,6 +1304,8 @@ src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/config/trace/v3/http_tracer.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/clusters/aggregate/v3/cluster.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/http/router/v3/router.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.c \
src/core/ext/upbdefs-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upbdefs.h \
src/core/ext/upbdefs-generated/envoy/extensions/transport_sockets/tls/v3/cert.upbdefs.c \
@ -1378,6 +1384,8 @@ src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/status.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/annotations/versioning.upbdefs.h \
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.c \
src/core/ext/upbdefs-generated/udpa/type/v1/typed_struct.upbdefs.h \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.c \
src/core/ext/upbdefs-generated/validate/validate.upbdefs.h \
src/core/ext/upbdefs-generated/xds/core/v3/authority.upbdefs.c \
@ -1410,6 +1418,8 @@ src/core/ext/xds/xds_client.cc \
src/core/ext/xds/xds_client.h \
src/core/ext/xds/xds_client_stats.cc \
src/core/ext/xds/xds_client_stats.h \
src/core/ext/xds/xds_http_filters.cc \
src/core/ext/xds/xds_http_filters.h \
src/core/ext/xds/xds_server_config_fetcher.cc \
src/core/lib/README.md \
src/core/lib/avl/avl.cc \

Loading…
Cancel
Save