From 8cb6862fe6099cd8583a64ff037ecdeaf0e939fa Mon Sep 17 00:00:00 2001 From: Kuat Date: Thu, 7 Apr 2022 06:31:49 -0700 Subject: [PATCH] extensions: strongly prefer type URL lookup (#20397) Use type_url to look up extensions. This prevents the undesirable practice of putting invalid protobufs to avoid a type lookup or duplicating the type URL. Risk Level: medium, affects extensions with duplicated type URLs or no configuration Testing: yes Docs Changes: yes, this has been the recommendation for awhile. Release Notes: yes Runtime Guard: envoy.reloadable_features.no_extension_lookup_by_name Signed-off-by: Kuat Yessenov --- api/envoy/config/accesslog/v3/accesslog.proto | 4 +- api/envoy/config/cluster/v3/filter.proto | 6 +- .../listener/v3/listener_components.proto | 6 +- .../v3/http_connection_manager.proto | 4 +- configs/envoy-demo.yaml | 2 + configs/envoy-tap-config.yaml | 2 + configs/envoy_double_proxy.template.yaml | 2 + configs/envoy_front_proxy.template.yaml | 2 + .../envoy_service_to_service.template.yaml | 14 ++ configs/envoyproxy_io_proxy.yaml | 2 + .../envoyproxy_io_proxy_http3_downstream.yaml | 4 + configs/freebind/freebind.yaml | 2 + configs/google-vrp/envoy-edge.yaml | 2 + configs/google-vrp/envoy-origin.yaml | 2 + .../google_com_auto_http3_upstream_proxy.yaml | 2 + configs/google_com_http3_upstream_proxy.yaml | 2 + .../original-dst-cluster/proxy_config.yaml | 4 + configs/proxy_connect.yaml | 2 + configs/terminate_http1_connect.yaml | 2 + configs/terminate_http2_connect.yaml | 2 + configs/terminate_http2_post.yaml | 2 + .../sip_proxy/filters/network/source/BUILD | 1 + .../filters/network/source/config.cc | 3 + .../filters/network/test/config_test.cc | 8 + .../best_practices/_include/edge.yaml | 4 + .../http_conn_man/_include/preserve-case.yaml | 2 + .../_include/bandwidth-limit-filter.yaml | 2 + .../http/http_filters/_include/composite.yaml | 2 + .../_include/grpc-reverse-bridge-filter.yaml | 2 + .../_include/grpc-transcoder-filter.yaml | 2 + .../local-rate-limit-with-descriptors.yaml | 2 + .../_include/stateful-cookie-session.yaml | 2 + .../listener_filters/tls_inspector.rst | 8 - .../sni-dynamic-forward-proxy-filter.yaml | 2 + .../overview/_include/tagged.yaml | 2 + .../root/configuration/overview/extension.rst | 5 +- .../intro/_include/life-of-a-request.yaml | 4 + .../matching/_include/complicated.yaml | 2 + .../matching/_include/request_response.yaml | 2 + .../advanced/matching/_include/simple.yaml | 2 + .../_include/envoy-demo-tls-client-auth.yaml | 2 + .../_include/envoy-demo-tls-sni.yaml | 2 + .../_include/envoy-demo-tls-validation.yaml | 2 + .../quick-start/_include/envoy-demo-tls.yaml | 2 + .../quick-start/_include/envoy-demo.yaml | 2 + .../_include/envoy-dynamic-lds-demo.yaml | 2 + docs/root/version_history/current.rst | 1 + examples/brotli/brotli-envoy.yaml | 4 + examples/cache/front-envoy.yaml | 2 + examples/cors/backend/front-envoy.yaml | 4 + examples/cors/frontend/front-envoy.yaml | 4 + examples/csrf/crosssite/front-envoy.yaml | 2 + examples/csrf/samesite/front-envoy.yaml | 4 + examples/double-proxy/envoy-backend.yaml | 2 + examples/double-proxy/envoy.yaml | 2 + examples/dynamic-config-cp/resource.go | 11 ++ examples/dynamic-config-fs/configs/lds.yaml | 2 + .../ext_authz/config/grpc-service/v3.yaml | 2 + examples/ext_authz/config/http-service.yaml | 2 + examples/ext_authz/config/opa-service/v3.yaml | 2 + examples/fault-injection/envoy.yaml | 2 + examples/front-proxy/front-envoy.yaml | 4 + examples/front-proxy/service-envoy.yaml | 2 + examples/grpc-bridge/client/envoy-proxy.yaml | 4 + examples/grpc-bridge/server/envoy-proxy.yaml | 2 + examples/gzip/gzip-envoy.yaml | 4 + .../front-envoy-jaeger.yaml | 2 + .../service1-envoy-jaeger.yaml | 4 + .../service2-envoy-jaeger.yaml | 2 + .../jaeger-tracing/front-envoy-jaeger.yaml | 2 + .../jaeger-tracing/service1-envoy-jaeger.yaml | 4 + .../jaeger-tracing/service2-envoy-jaeger.yaml | 2 + .../service-envoy-w-lrs.yaml | 2 + .../locality-load-balancing/envoy-proxy.yaml | 2 + examples/lua/envoy.yaml | 2 + examples/tls-sni/envoy-client.yaml | 2 + examples/tls-sni/envoy.yaml | 6 + examples/tls/envoy-http-https.yaml | 2 + examples/tls/envoy-https-http.yaml | 2 + examples/tls/envoy-https-https.yaml | 2 + examples/wasm-cc/envoy.yaml | 2 + examples/websocket/envoy-ws.yaml | 2 + examples/websocket/envoy-wss.yaml | 2 + examples/win32-front-proxy/front-envoy.yaml | 4 + examples/win32-front-proxy/service-envoy.yaml | 2 + .../zipkin-tracing/front-envoy-zipkin.yaml | 2 + .../zipkin-tracing/service1-envoy-zipkin.yaml | 4 + .../zipkin-tracing/service2-envoy-zipkin.yaml | 2 + source/common/config/utility.h | 12 +- source/common/runtime/runtime_features.cc | 1 + source/common/upstream/BUILD | 1 + source/common/upstream/upstream_impl.cc | 3 + .../filters/network/thrift_proxy/BUILD | 1 + .../filters/network/thrift_proxy/config.cc | 3 + source/server/BUILD | 1 + source/server/listener_manager_impl.cc | 3 + test/common/config/BUILD | 1 + .../custom_config_validators_impl_test.cc | 7 +- test/common/matcher/matcher_test.cc | 71 ++++---- test/common/matcher/test_utility.h | 37 +++- .../network/dns_resolver/dns_factory_test.cc | 3 +- test/common/router/config_impl_test.cc | 3 + test/common/tracing/BUILD | 1 + .../tracing/http_tracer_manager_impl_test.cc | 8 + .../upstream/cluster_manager_impl_test.cc | 9 + test/common/upstream/eds_test.cc | 7 + test/common/upstream/hds_test.cc | 2 + test/common/upstream/upstream_impl_test.cc | 23 ++- .../server_xds.lds.typed_struct.yaml | 5 +- .../server_xds.lds.udpa.list_collection.yaml | 5 +- ...s.lds.with_unknown_field.typed_struct.yaml | 5 +- .../server_xds.lds.with_unknown_field.yaml | 5 +- test/config/integration/server_xds.lds.yaml | 6 +- test/config/utility.cc | 20 ++- .../access_loggers/file/config_test.cc | 7 +- .../dns_cache_impl_test.cc | 6 +- .../common/matcher/trie_matcher_test.cc | 97 +++++------ .../decompressor_filter_integration_test.cc | 3 +- .../proxy_filter_integration_test.cc | 6 +- .../filters/http/ext_authz/ext_authz.yaml | 3 +- .../network/http_connection_manager/BUILD | 1 + .../config_filter_chain_test.cc | 4 + .../http_connection_manager/config_test.cc | 161 +++++++++++++++++- .../config_test_base.h | 6 + .../network/thrift_proxy/config_test.cc | 10 ++ .../dns_resolver/apple/apple_dns_impl_test.cc | 3 +- .../alts/alts_integration_test.cc | 2 - .../transport_sockets/tcp_stats/BUILD | 1 + .../tcp_stats/tcp_stats_test.cc | 3 + test/extensions/transport_sockets/tls/BUILD | 1 + .../tls/handshaker_factory_test.cc | 4 + test/integration/BUILD | 6 + test/integration/base_integration_test.cc | 3 + .../base_overload_integration_test.cc | 2 +- ...ter_upstream_extension_integration_test.cc | 3 +- test/integration/http_integration.cc | 5 +- test/integration/integration_test.cc | 15 +- .../multiplexed_integration_test.cc | 8 - .../multiplexed_upstream_integration_test.cc | 9 +- test/integration/protocol_integration_test.cc | 47 ++--- test/integration/redirect_integration_test.cc | 2 - test/integration/test_host_predicate.proto | 6 + test/integration/test_host_predicate_config.h | 6 +- .../typed_metadata_integration_test.cc | 5 +- test/server/BUILD | 3 + test/server/config_validation/BUILD | 1 + test/server/config_validation/xds_verifier.h | 1 + test/server/configuration_impl_test.cc | 13 +- test/server/guarddog_impl_test.cc | 27 ++- .../listener_manager_impl_quic_only_test.cc | 2 + test/server/listener_manager_impl_test.cc | 33 +++- test/server/overload_manager_impl_test.cc | 7 +- test/server/server_test.cc | 20 ++- 153 files changed, 779 insertions(+), 263 deletions(-) create mode 100644 test/integration/test_host_predicate.proto diff --git a/api/envoy/config/accesslog/v3/accesslog.proto b/api/envoy/config/accesslog/v3/accesslog.proto index a29fa839ea5a..cdf5877cefb2 100644 --- a/api/envoy/config/accesslog/v3/accesslog.proto +++ b/api/envoy/config/accesslog/v3/accesslog.proto @@ -30,9 +30,7 @@ message AccessLog { reserved "config"; - // The name of the access log extension to instantiate. - // The name must match one of the compiled in loggers. - // See the :ref:`extensions listed in typed_config below ` for the default list of available loggers. + // The name of the access log extension configuration. string name = 1; // Filter which is used to determine if the access log needs to be written. diff --git a/api/envoy/config/cluster/v3/filter.proto b/api/envoy/config/cluster/v3/filter.proto index a98674b72f01..c6b8722b9233 100644 --- a/api/envoy/config/cluster/v3/filter.proto +++ b/api/envoy/config/cluster/v3/filter.proto @@ -20,12 +20,12 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; message Filter { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.cluster.Filter"; - // The name of the filter to instantiate. The name must match a - // supported upstream filter. Note that Envoy's :ref:`downstream network - // filters ` are not valid upstream filters. + // The name of the filter configuration. string name = 1 [(validate.rules).string = {min_len: 1}]; // Filter specific configuration which depends on the filter being // instantiated. See the supported filters for further documentation. + // Note that Envoy's :ref:`downstream network + // filters ` are not valid upstream filters. google.protobuf.Any typed_config = 2; } diff --git a/api/envoy/config/listener/v3/listener_components.proto b/api/envoy/config/listener/v3/listener_components.proto index 1116031caca9..13501fb30d7a 100644 --- a/api/envoy/config/listener/v3/listener_components.proto +++ b/api/envoy/config/listener/v3/listener_components.proto @@ -33,8 +33,7 @@ message Filter { reserved "config"; - // The name of the filter to instantiate. The name must match a - // :ref:`supported filter `. + // The name of the filter configuration. string name = 1 [(validate.rules).string = {min_len: 1}]; oneof config_type { @@ -343,8 +342,7 @@ message ListenerFilter { reserved "config"; - // The name of the filter to instantiate. The name must match a - // :ref:`supported filter `. + // The name of the filter configuration. string name = 1 [(validate.rules).string = {min_len: 1}]; oneof config_type { diff --git a/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 7bff1de5bd2c..d7e8e799d303 100644 --- a/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -1013,9 +1013,7 @@ message HttpFilter { reserved "config"; - // 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. + // The name of the filter configuration. It also serves as a resource name in ExtensionConfigDS. string name = 1 [(validate.rules).string = {min_len: 1}]; oneof config_type { diff --git a/configs/envoy-demo.yaml b/configs/envoy-demo.yaml index 39bfae994947..b5c6aa51009a 100644 --- a/configs/envoy-demo.yaml +++ b/configs/envoy-demo.yaml @@ -35,6 +35,8 @@ static_resources: cluster: service_envoyproxy_io http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_envoyproxy_io type: LOGICAL_DNS diff --git a/configs/envoy-tap-config.yaml b/configs/envoy-tap-config.yaml index 655580c77210..108330d75448 100644 --- a/configs/envoy-tap-config.yaml +++ b/configs/envoy-tap-config.yaml @@ -35,6 +35,8 @@ static_resources: cluster: service_envoyproxy_io http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_envoyproxy_io type: LOGICAL_DNS diff --git a/configs/envoy_double_proxy.template.yaml b/configs/envoy_double_proxy.template.yaml index 56f4d17ad201..ef0f6b88ef10 100644 --- a/configs/envoy_double_proxy.template.yaml +++ b/configs/envoy_double_proxy.template.yaml @@ -61,6 +61,8 @@ "@type": type.googleapis.com/envoy.extensions.filters.http.buffer.v3.Buffer max_request_bytes: 5242880 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router {% if tracing %} tracing: provider: diff --git a/configs/envoy_front_proxy.template.yaml b/configs/envoy_front_proxy.template.yaml index 047390d8ef67..41404b49353e 100644 --- a/configs/envoy_front_proxy.template.yaml +++ b/configs/envoy_front_proxy.template.yaml @@ -71,6 +71,8 @@ envoy_grpc: cluster_name: ratelimit - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router add_user_agent: true {% if tracing %} tracing: diff --git a/configs/envoy_service_to_service.template.yaml b/configs/envoy_service_to_service.template.yaml index 7bdd6a4d0fad..1448e0f859c4 100644 --- a/configs/envoy_service_to_service.template.yaml +++ b/configs/envoy_service_to_service.template.yaml @@ -48,6 +48,8 @@ "@type": type.googleapis.com/envoy.extensions.filters.http.buffer.v3.Buffer max_request_bytes: 5242880 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router access_log: - name: envoy.access_loggers.file filter: @@ -165,7 +167,11 @@ static_resources: envoy_grpc: cluster_name: ratelimit - name: envoy.filters.http.grpc_http1_bridge + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_http1_bridge.v3.Config - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: protocol: TCP @@ -226,7 +232,11 @@ static_resources: envoy_grpc: cluster_name: ratelimit - name: envoy.filters.http.grpc_http1_bridge + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_http1_bridge.v3.Config - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router {% if external_virtual_hosts|length > 0 or mongos_servers|length > 0 %}{% endif -%} {% for mapping in external_virtual_hosts -%} - name: "{{ mapping['address']}}" @@ -265,8 +275,12 @@ static_resources: http_filters: {% if mapping['name'] in ['dynamodb_iad', 'dynamodb_legacy'] -%} - name: envoy.filters.http.dynamo + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.dynamo.v3.Dynamo {% endif -%} - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router access_log: - name: envoy.access_loggers.file filter: diff --git a/configs/envoyproxy_io_proxy.yaml b/configs/envoyproxy_io_proxy.yaml index 7b0e345fc9f3..f111f0dd2ae6 100644 --- a/configs/envoyproxy_io_proxy.yaml +++ b/configs/envoyproxy_io_proxy.yaml @@ -33,6 +33,8 @@ static_resources: cluster: service_envoyproxy_io http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_envoyproxy_io connect_timeout: 30s diff --git a/configs/envoyproxy_io_proxy_http3_downstream.yaml b/configs/envoyproxy_io_proxy_http3_downstream.yaml index bc6e7f73de42..eaba8f8d88f0 100644 --- a/configs/envoyproxy_io_proxy_http3_downstream.yaml +++ b/configs/envoyproxy_io_proxy_http3_downstream.yaml @@ -49,6 +49,8 @@ static_resources: http3_protocol_options: http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - name: listener_udp address: @@ -92,6 +94,8 @@ static_resources: http3_protocol_options: http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_envoyproxy_io connect_timeout: 30s diff --git a/configs/freebind/freebind.yaml b/configs/freebind/freebind.yaml index 38bf2b786aed..07393067a1b2 100644 --- a/configs/freebind/freebind.yaml +++ b/configs/freebind/freebind.yaml @@ -28,6 +28,8 @@ static_resources: route: {cluster: service_local} http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_local connect_timeout: 30s diff --git a/configs/google-vrp/envoy-edge.yaml b/configs/google-vrp/envoy-edge.yaml index 1d2e5867756b..d7611225cf0e 100644 --- a/configs/google-vrp/envoy-edge.yaml +++ b/configs/google-vrp/envoy-edge.yaml @@ -77,6 +77,8 @@ static_resources: inline_string: "denied\n" http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_foo connect_timeout: 5s diff --git a/configs/google-vrp/envoy-origin.yaml b/configs/google-vrp/envoy-origin.yaml index 7ca1a5ef3249..e1610dcc2e1b 100644 --- a/configs/google-vrp/envoy-origin.yaml +++ b/configs/google-vrp/envoy-origin.yaml @@ -62,3 +62,5 @@ static_resources: inline_string: "normal\n" http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router diff --git a/configs/google_com_auto_http3_upstream_proxy.yaml b/configs/google_com_auto_http3_upstream_proxy.yaml index 8767f87a59ef..e0639278ed08 100644 --- a/configs/google_com_auto_http3_upstream_proxy.yaml +++ b/configs/google_com_auto_http3_upstream_proxy.yaml @@ -39,6 +39,8 @@ static_resources: alternate_protocols_cache_options: name: default_alternate_protocols_cache - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_google connect_timeout: 30s diff --git a/configs/google_com_http3_upstream_proxy.yaml b/configs/google_com_http3_upstream_proxy.yaml index 1f5e8928eaaf..fb653c24655c 100644 --- a/configs/google_com_http3_upstream_proxy.yaml +++ b/configs/google_com_http3_upstream_proxy.yaml @@ -32,6 +32,8 @@ static_resources: cluster: service_google http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_google connect_timeout: 30s diff --git a/configs/original-dst-cluster/proxy_config.yaml b/configs/original-dst-cluster/proxy_config.yaml index ab57428744ef..98d310bce0c4 100644 --- a/configs/original-dst-cluster/proxy_config.yaml +++ b/configs/original-dst-cluster/proxy_config.yaml @@ -24,9 +24,13 @@ static_resources: cluster: cluster1 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router codec_type: AUTO listener_filters: - name: envoy.filters.listener.original_dst + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst clusters: - name: cluster1 type: ORIGINAL_DST diff --git a/configs/proxy_connect.yaml b/configs/proxy_connect.yaml index 7e83cd83eb3d..a0673aeef33c 100644 --- a/configs/proxy_connect.yaml +++ b/configs/proxy_connect.yaml @@ -36,6 +36,8 @@ static_resources: - upgrade_type: CONNECT http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: allow_connect: true upgrade_configs: diff --git a/configs/terminate_http1_connect.yaml b/configs/terminate_http1_connect.yaml index 28df478f3deb..21170910ca9a 100644 --- a/configs/terminate_http1_connect.yaml +++ b/configs/terminate_http1_connect.yaml @@ -56,6 +56,8 @@ static_resources: {} http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http_protocol_options: {} upgrade_configs: - upgrade_type: CONNECT diff --git a/configs/terminate_http2_connect.yaml b/configs/terminate_http2_connect.yaml index 349888beed89..962bdeb79783 100644 --- a/configs/terminate_http2_connect.yaml +++ b/configs/terminate_http2_connect.yaml @@ -40,6 +40,8 @@ static_resources: {} http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: allow_connect: true upgrade_configs: diff --git a/configs/terminate_http2_post.yaml b/configs/terminate_http2_post.yaml index 5401f43c78ef..64425ed0c091 100644 --- a/configs/terminate_http2_post.yaml +++ b/configs/terminate_http2_post.yaml @@ -43,6 +43,8 @@ static_resources: allow_post: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: allow_connect: true clusters: diff --git a/contrib/sip_proxy/filters/network/source/BUILD b/contrib/sip_proxy/filters/network/source/BUILD index 4eee6673e073..e6033a190f47 100644 --- a/contrib/sip_proxy/filters/network/source/BUILD +++ b/contrib/sip_proxy/filters/network/source/BUILD @@ -35,6 +35,7 @@ envoy_cc_contrib_extension( "//envoy/registry", "//source/common/config:utility_lib", "//source/extensions/filters/network/common:factory_base_lib", + "@envoy_api//contrib/envoy/extensions/filters/network/sip_proxy/router/v3alpha:pkg_cc_proto", "@envoy_api//contrib/envoy/extensions/filters/network/sip_proxy/v3alpha:pkg_cc_proto", ], ) diff --git a/contrib/sip_proxy/filters/network/source/config.cc b/contrib/sip_proxy/filters/network/source/config.cc index 0e555a995cb9..702a7115c798 100644 --- a/contrib/sip_proxy/filters/network/source/config.cc +++ b/contrib/sip_proxy/filters/network/source/config.cc @@ -7,6 +7,7 @@ #include "source/common/config/utility.h" +#include "contrib/envoy/extensions/filters/network/sip_proxy/router/v3alpha/router.pb.h" #include "contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/sip_proxy.pb.h" #include "contrib/envoy/extensions/filters/network/sip_proxy/v3alpha/sip_proxy.pb.validate.h" #include "contrib/sip_proxy/filters/network/source/decoder.h" @@ -97,7 +98,9 @@ ConfigImpl::ConfigImpl( ENVOY_LOG(debug, "using default router filter"); envoy::extensions::filters::network::sip_proxy::v3alpha::SipFilter router; + envoy::extensions::filters::network::sip_proxy::router::v3alpha::Router default_router; router.set_name(SipFilters::SipFilterNames::get().ROUTER); + router.mutable_typed_config()->PackFrom(default_router); processFilter(router); } else { for (const auto& filter : config.sip_filters()) { diff --git a/contrib/sip_proxy/filters/network/test/config_test.cc b/contrib/sip_proxy/filters/network/test/config_test.cc index ec0d6ce195be..97b4a93d7446 100644 --- a/contrib/sip_proxy/filters/network/test/config_test.cc +++ b/contrib/sip_proxy/filters/network/test/config_test.cc @@ -81,6 +81,8 @@ stat_prefix: sip cluster: A sip_filters: - name: envoy.filters.sip.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.sip_proxy.router.v3alpha.Router )EOF"; envoy::extensions::filters::network::sip_proxy::v3alpha::SipProxy config = @@ -98,6 +100,8 @@ stat_prefix: sip name: local_route sip_filters: - name: envoy.filters.sip.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.sip_proxy.router.v3alpha.Router )EOF"; envoy::extensions::filters::network::sip_proxy::v3alpha::SipProxy config = @@ -114,6 +118,8 @@ stat_prefix: sip sip_filters: - name: no_such_filter - name: envoy.filters.sip.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.sip_proxy.router.v3alpha.Router )EOF"; envoy::extensions::filters::network::sip_proxy::v3alpha::SipProxy config = @@ -136,6 +142,8 @@ stat_prefix: ingress value: key: value - name: envoy.filters.sip.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.sip_proxy.router.v3alpha.Router settings: transaction_timeout: 32s local_services: diff --git a/docs/root/configuration/best_practices/_include/edge.yaml b/docs/root/configuration/best_practices/_include/edge.yaml index 3e982eec08e5..f5ae8ab80736 100644 --- a/docs/root/configuration/best_practices/_include/edge.yaml +++ b/docs/root/configuration/best_practices/_include/edge.yaml @@ -32,6 +32,8 @@ static_resources: port_value: 443 listener_filters: - name: "envoy.filters.listener.tls_inspector" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector # Uncomment if Envoy is behind a load balancer that exposes client IP address using the PROXY protocol. # - name: envoy.filters.listener.proxy_protocol # typed_config: @@ -69,6 +71,8 @@ static_resources: request_timeout: 300s # 5 mins, must be disabled for long-lived and streaming requests http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: virtual_hosts: - name: default diff --git a/docs/root/configuration/http/http_conn_man/_include/preserve-case.yaml b/docs/root/configuration/http/http_conn_man/_include/preserve-case.yaml index cd70bffa507a..5c304e4fd237 100644 --- a/docs/root/configuration/http/http_conn_man/_include/preserve-case.yaml +++ b/docs/root/configuration/http/http_conn_man/_include/preserve-case.yaml @@ -18,6 +18,8 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.http.header_formatters.preserve_case.v3.PreserveCaseFormatterConfig http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: virtual_hosts: - name: default diff --git a/docs/root/configuration/http/http_filters/_include/bandwidth-limit-filter.yaml b/docs/root/configuration/http/http_filters/_include/bandwidth-limit-filter.yaml index 05674eb5dd91..bcdfabc69497 100644 --- a/docs/root/configuration/http/http_filters/_include/bandwidth-limit-filter.yaml +++ b/docs/root/configuration/http/http_filters/_include/bandwidth-limit-filter.yaml @@ -34,6 +34,8 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.filters.http.bandwidth_limit.v3.BandwidthLimit stat_prefix: bandwidth_limiter_default - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_protected_by_bandwidth_limit type: STRICT_DNS diff --git a/docs/root/configuration/http/http_filters/_include/composite.yaml b/docs/root/configuration/http/http_filters/_include/composite.yaml index 849b1fcedfde..d02505e13f1e 100644 --- a/docs/root/configuration/http/http_filters/_include/composite.yaml +++ b/docs/root/configuration/http/http_filters/_include/composite.yaml @@ -70,6 +70,8 @@ static_resources: numerator: 100 denominator: HUNDRED - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: grpc diff --git a/docs/root/configuration/http/http_filters/_include/grpc-reverse-bridge-filter.yaml b/docs/root/configuration/http/http_filters/_include/grpc-reverse-bridge-filter.yaml index 5ba17b1bf17e..5515ebabb88a 100644 --- a/docs/root/configuration/http/http_filters/_include/grpc-reverse-bridge-filter.yaml +++ b/docs/root/configuration/http/http_filters/_include/grpc-reverse-bridge-filter.yaml @@ -50,6 +50,8 @@ static_resources: content_type: application/grpc+proto withhold_grpc_frames: true - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: other type: LOGICAL_DNS diff --git a/docs/root/configuration/http/http_filters/_include/grpc-transcoder-filter.yaml b/docs/root/configuration/http/http_filters/_include/grpc-transcoder-filter.yaml index c18e1821f043..57700b640530 100644 --- a/docs/root/configuration/http/http_filters/_include/grpc-transcoder-filter.yaml +++ b/docs/root/configuration/http/http_filters/_include/grpc-transcoder-filter.yaml @@ -36,6 +36,8 @@ static_resources: always_print_enums_as_ints: false preserve_proto_field_names: false - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: grpc diff --git a/docs/root/configuration/http/http_filters/_include/local-rate-limit-with-descriptors.yaml b/docs/root/configuration/http/http_filters/_include/local-rate-limit-with-descriptors.yaml index b9109a189ae6..e196481c63da 100644 --- a/docs/root/configuration/http/http_filters/_include/local-rate-limit-with-descriptors.yaml +++ b/docs/root/configuration/http/http_filters/_include/local-rate-limit-with-descriptors.yaml @@ -12,6 +12,8 @@ static_resources: stat_prefix: ingress_http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/configuration/http/http_filters/_include/stateful-cookie-session.yaml b/docs/root/configuration/http/http_filters/_include/stateful-cookie-session.yaml index d2813b65cc2b..c148cfe18220 100644 --- a/docs/root/configuration/http/http_filters/_include/stateful-cookie-session.yaml +++ b/docs/root/configuration/http/http_filters/_include/stateful-cookie-session.yaml @@ -40,6 +40,8 @@ static_resources: path: /path ttl: 120s - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service1 diff --git a/docs/root/configuration/listeners/listener_filters/tls_inspector.rst b/docs/root/configuration/listeners/listener_filters/tls_inspector.rst index 65bb3a65e79b..c2015795f8ae 100644 --- a/docs/root/configuration/listeners/listener_filters/tls_inspector.rst +++ b/docs/root/configuration/listeners/listener_filters/tls_inspector.rst @@ -25,14 +25,6 @@ Example A sample filter configuration could be: -.. code-block:: yaml - - listener_filters: - - name: "envoy.filters.listener.tls_inspector" - -Or by specifying the `type_url `_ -of the *typed_config*: - .. code-block:: yaml listener_filters: diff --git a/docs/root/configuration/listeners/network_filters/_include/sni-dynamic-forward-proxy-filter.yaml b/docs/root/configuration/listeners/network_filters/_include/sni-dynamic-forward-proxy-filter.yaml index ec2306721083..e2a96b6683ad 100644 --- a/docs/root/configuration/listeners/network_filters/_include/sni-dynamic-forward-proxy-filter.yaml +++ b/docs/root/configuration/listeners/network_filters/_include/sni-dynamic-forward-proxy-filter.yaml @@ -14,6 +14,8 @@ static_resources: port_value: 10000 listener_filters: - name: envoy.filters.listener.tls_inspector + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector filter_chains: - filters: - name: envoy.filters.network.sni_dynamic_forward_proxy diff --git a/docs/root/configuration/overview/_include/tagged.yaml b/docs/root/configuration/overview/_include/tagged.yaml index 1146593ea9d3..a244c91c08c5 100644 --- a/docs/root/configuration/overview/_include/tagged.yaml +++ b/docs/root/configuration/overview/_include/tagged.yaml @@ -29,6 +29,8 @@ static_resources: route: {cluster: some_service} http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: some_service connect_timeout: 0.25s diff --git a/docs/root/configuration/overview/extension.rst b/docs/root/configuration/overview/extension.rst index fd99aa96f000..23e63c007340 100644 --- a/docs/root/configuration/overview/extension.rst +++ b/docs/root/configuration/overview/extension.rst @@ -4,9 +4,8 @@ Extension configuration ----------------------- Each configuration resource in Envoy has a type URL in the ``typed_config``. This -type corresponds to a versioned schema. If the type URL uniquely identifies an -extension capable of interpreting the configuration, then the extension is -selected regardless of the ``name`` field. In this case the ``name`` field becomes +type corresponds to a versioned schema. The type URL uniquely identifies an +extension capable of interpreting the configuration. The ``name`` field is optional and can be used as an identifier or as an annotation for the particular instance of the extension configuration. For example, the following filter configuration snippet is permitted: diff --git a/docs/root/intro/_include/life-of-a-request.yaml b/docs/root/intro/_include/life-of-a-request.yaml index f85b9e3b0d48..ef67b812cd00 100644 --- a/docs/root/intro/_include/life-of-a-request.yaml +++ b/docs/root/intro/_include/life-of-a-request.yaml @@ -11,6 +11,8 @@ static_resources: # A single listener filter exists for TLS inspector. listener_filters: - name: "envoy.filters.listener.tls_inspector" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector # On the listener, there is a single filter chain that matches SNI for acme.com. filter_chains: - filter_chain_match: @@ -55,6 +57,8 @@ static_resources: http_filters: # - name: some.customer.filter - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: some_service # Upstream TLS configuration. diff --git a/docs/root/intro/arch_overview/advanced/matching/_include/complicated.yaml b/docs/root/intro/arch_overview/advanced/matching/_include/complicated.yaml index 22df44b44a74..2579e4b97e79 100644 --- a/docs/root/intro/arch_overview/advanced/matching/_include/complicated.yaml +++ b/docs/root/intro/arch_overview/advanced/matching/_include/complicated.yaml @@ -71,6 +71,8 @@ static_resources: typed_config: "@type": type.googleapis.com/envoy.extensions.filters.common.matcher.action.v3.SkipFilter - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: virtual_hosts: - name: default diff --git a/docs/root/intro/arch_overview/advanced/matching/_include/request_response.yaml b/docs/root/intro/arch_overview/advanced/matching/_include/request_response.yaml index 195419353b63..3154b85407a7 100644 --- a/docs/root/intro/arch_overview/advanced/matching/_include/request_response.yaml +++ b/docs/root/intro/arch_overview/advanced/matching/_include/request_response.yaml @@ -57,6 +57,8 @@ static_resources: typed_config: "@type": type.googleapis.com/envoy.extensions.filters.common.matcher.action.v3.SkipFilter - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: virtual_hosts: - name: default diff --git a/docs/root/intro/arch_overview/advanced/matching/_include/simple.yaml b/docs/root/intro/arch_overview/advanced/matching/_include/simple.yaml index 11276dcf7d57..702c9c144d78 100644 --- a/docs/root/intro/arch_overview/advanced/matching/_include/simple.yaml +++ b/docs/root/intro/arch_overview/advanced/matching/_include/simple.yaml @@ -45,6 +45,8 @@ static_resources: typed_config: "@type": type.googleapis.com/envoy.extensions.filters.common.matcher.action.v3.SkipFilter - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: virtual_hosts: - name: default diff --git a/docs/root/start/quick-start/_include/envoy-demo-tls-client-auth.yaml b/docs/root/start/quick-start/_include/envoy-demo-tls-client-auth.yaml index dd48870fbda6..11c394b8c258 100644 --- a/docs/root/start/quick-start/_include/envoy-demo-tls-client-auth.yaml +++ b/docs/root/start/quick-start/_include/envoy-demo-tls-client-auth.yaml @@ -14,6 +14,8 @@ static_resources: stat_prefix: ingress_http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/start/quick-start/_include/envoy-demo-tls-sni.yaml b/docs/root/start/quick-start/_include/envoy-demo-tls-sni.yaml index 40f8533e1ce2..2a699b3eb36d 100644 --- a/docs/root/start/quick-start/_include/envoy-demo-tls-sni.yaml +++ b/docs/root/start/quick-start/_include/envoy-demo-tls-sni.yaml @@ -14,6 +14,8 @@ static_resources: stat_prefix: ingress_http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/start/quick-start/_include/envoy-demo-tls-validation.yaml b/docs/root/start/quick-start/_include/envoy-demo-tls-validation.yaml index 054f79e55f36..cca5aef958e9 100644 --- a/docs/root/start/quick-start/_include/envoy-demo-tls-validation.yaml +++ b/docs/root/start/quick-start/_include/envoy-demo-tls-validation.yaml @@ -14,6 +14,8 @@ static_resources: stat_prefix: ingress_http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/start/quick-start/_include/envoy-demo-tls.yaml b/docs/root/start/quick-start/_include/envoy-demo-tls.yaml index 960b9e9bca12..611d9c0c638f 100644 --- a/docs/root/start/quick-start/_include/envoy-demo-tls.yaml +++ b/docs/root/start/quick-start/_include/envoy-demo-tls.yaml @@ -14,6 +14,8 @@ static_resources: stat_prefix: ingress_http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/start/quick-start/_include/envoy-demo.yaml b/docs/root/start/quick-start/_include/envoy-demo.yaml index eaf9469b5aa7..2a4a6c700935 100644 --- a/docs/root/start/quick-start/_include/envoy-demo.yaml +++ b/docs/root/start/quick-start/_include/envoy-demo.yaml @@ -18,6 +18,8 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/start/quick-start/_include/envoy-dynamic-lds-demo.yaml b/docs/root/start/quick-start/_include/envoy-dynamic-lds-demo.yaml index aabf22ee3b44..37212286e2d6 100644 --- a/docs/root/start/quick-start/_include/envoy-dynamic-lds-demo.yaml +++ b/docs/root/start/quick-start/_include/envoy-dynamic-lds-demo.yaml @@ -13,6 +13,8 @@ resources: stat_prefix: ingress_http http_filters: - name: envoy.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index e1c126529dd1..4033a37ae20b 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -15,6 +15,7 @@ Minor Behavior Changes * access_log: log all header values in the grpc access log. * build: ``VERSION`` and ``API_VERSION`` have been renamed to ``VERSION.txt`` and ``API_VERSION.txt`` respectively to avoid conflicts with the C++ ```` header. +* config: type URL is used to lookup extensions regardless of the name field. This may cause problems for empty filter configurations or mis-matched protobuf as the typed configurations. This behavioral change can be temporarily reverted by setting runtime guard ``envoy.reloadable_features.no_extension_lookup_by_name`` to false. * config: warning messages for protobuf unknown fields now contain ancestors for easier troubleshooting. * cryptomb: remove RSA PKCS1 v1.5 padding support. * decompressor: decompressor does not duplicate ``accept-encoding`` header values anymore. This behavioral change can be reverted by setting runtime guard ``envoy.reloadable_features.append_to_accept_content_encoding_only_once`` to false. diff --git a/examples/brotli/brotli-envoy.yaml b/examples/brotli/brotli-envoy.yaml index 581e667a9b58..fab33e347c2e 100644 --- a/examples/brotli/brotli-envoy.yaml +++ b/examples/brotli/brotli-envoy.yaml @@ -37,6 +37,8 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.compression.brotli.compressor.v3.Brotli window_bits: 10 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: @@ -137,6 +139,8 @@ static_resources: "@type": type.googleapis.com/envoy.extensions.compression.brotli.compressor.v3.Brotli window_bits: 10 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/examples/cache/front-envoy.yaml b/examples/cache/front-envoy.yaml index 4754cbeebfc8..b953d1e781ff 100644 --- a/examples/cache/front-envoy.yaml +++ b/examples/cache/front-envoy.yaml @@ -33,6 +33,8 @@ static_resources: typed_config: "@type": "type.googleapis.com/envoy.extensions.cache.simple_http_cache.v3.SimpleHttpCacheConfig" - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service1 diff --git a/examples/cors/backend/front-envoy.yaml b/examples/cors/backend/front-envoy.yaml index f7cd4c7c14c0..4b4fd7552e0d 100644 --- a/examples/cors/backend/front-envoy.yaml +++ b/examples/cors/backend/front-envoy.yaml @@ -67,7 +67,11 @@ static_resources: cluster: backend_service http_filters: - name: envoy.filters.http.cors + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: backend_service type: STRICT_DNS diff --git a/examples/cors/frontend/front-envoy.yaml b/examples/cors/frontend/front-envoy.yaml index 5a61d4279efe..1dc027035b9c 100644 --- a/examples/cors/frontend/front-envoy.yaml +++ b/examples/cors/frontend/front-envoy.yaml @@ -28,7 +28,11 @@ static_resources: cluster: frontend_service http_filters: - name: envoy.filters.http.cors + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: frontend_service type: STRICT_DNS diff --git a/examples/csrf/crosssite/front-envoy.yaml b/examples/csrf/crosssite/front-envoy.yaml index 9e47676d0273..1556fa23ec09 100644 --- a/examples/csrf/crosssite/front-envoy.yaml +++ b/examples/csrf/crosssite/front-envoy.yaml @@ -28,6 +28,8 @@ static_resources: cluster: generic_service http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: generic_service type: STRICT_DNS diff --git a/examples/csrf/samesite/front-envoy.yaml b/examples/csrf/samesite/front-envoy.yaml index 37e3082517b5..7b01e99eb14d 100644 --- a/examples/csrf/samesite/front-envoy.yaml +++ b/examples/csrf/samesite/front-envoy.yaml @@ -91,6 +91,8 @@ static_resources: cluster: generic_service http_filters: - name: envoy.filters.http.cors + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors - name: envoy.filters.http.csrf typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.csrf.v3.CsrfPolicy @@ -99,6 +101,8 @@ static_resources: numerator: 0 denominator: HUNDRED - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: generic_service type: STRICT_DNS diff --git a/examples/double-proxy/envoy-backend.yaml b/examples/double-proxy/envoy-backend.yaml index 0636354c3771..49c8306f35d0 100644 --- a/examples/double-proxy/envoy-backend.yaml +++ b/examples/double-proxy/envoy-backend.yaml @@ -7,6 +7,8 @@ static_resources: port_value: 5432 listener_filters: - name: "envoy.filters.listener.tls_inspector" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector filter_chains: - filters: - name: envoy.filters.network.tcp_proxy diff --git a/examples/double-proxy/envoy.yaml b/examples/double-proxy/envoy.yaml index a96271592472..faf880c5bf81 100644 --- a/examples/double-proxy/envoy.yaml +++ b/examples/double-proxy/envoy.yaml @@ -24,6 +24,8 @@ static_resources: cluster: service1 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service1 diff --git a/examples/dynamic-config-cp/resource.go b/examples/dynamic-config-cp/resource.go index cd0ce177abc2..6fe45e4c6b5e 100644 --- a/examples/dynamic-config-cp/resource.go +++ b/examples/dynamic-config-cp/resource.go @@ -23,7 +23,9 @@ import ( endpoint "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3" listener "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3" route "github.com/envoyproxy/go-control-plane/envoy/config/route/v3" + router "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3" hcm "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3" + "github.com/envoyproxy/go-control-plane/pkg/cache/types" "github.com/envoyproxy/go-control-plane/pkg/cache/v3" "github.com/envoyproxy/go-control-plane/pkg/resource/v3" @@ -100,6 +102,12 @@ func makeRoute(routeName string, clusterName string) *route.RouteConfiguration { } func makeHTTPListener(listenerName string, route string) *listener.Listener { + router := &router.Router{} + routerpb, err := ptypes.MarshalAny(router) + if err != nil { + panic(err) + } + // HTTP filter configuration manager := &hcm.HttpConnectionManager{ CodecType: hcm.HttpConnectionManager_AUTO, @@ -112,6 +120,9 @@ func makeHTTPListener(listenerName string, route string) *listener.Listener { }, HttpFilters: []*hcm.HttpFilter{{ Name: wellknown.Router, + ConfigType: &hcm.HttpFilter_TypedConfig{ + TypedConfig: routerpb, + }, }}, } pbst, err := ptypes.MarshalAny(manager) diff --git a/examples/dynamic-config-fs/configs/lds.yaml b/examples/dynamic-config-fs/configs/lds.yaml index a0b8ba1fa6fa..ac12d349dffc 100644 --- a/examples/dynamic-config-fs/configs/lds.yaml +++ b/examples/dynamic-config-fs/configs/lds.yaml @@ -13,6 +13,8 @@ resources: stat_prefix: ingress_http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router route_config: name: local_route virtual_hosts: diff --git a/examples/ext_authz/config/grpc-service/v3.yaml b/examples/ext_authz/config/grpc-service/v3.yaml index f9e2bea51c40..5364539fb1d4 100644 --- a/examples/ext_authz/config/grpc-service/v3.yaml +++ b/examples/ext_authz/config/grpc-service/v3.yaml @@ -32,6 +32,8 @@ static_resources: timeout: 0.250s transport_api_version: V3 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: upstream-service diff --git a/examples/ext_authz/config/http-service.yaml b/examples/ext_authz/config/http-service.yaml index e80b0735473e..8b68dd01375d 100644 --- a/examples/ext_authz/config/http-service.yaml +++ b/examples/ext_authz/config/http-service.yaml @@ -37,6 +37,8 @@ static_resources: patterns: - exact: x-current-user - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: upstream-service diff --git a/examples/ext_authz/config/opa-service/v3.yaml b/examples/ext_authz/config/opa-service/v3.yaml index 83bc56d8dbb4..c5615eec26a3 100644 --- a/examples/ext_authz/config/opa-service/v3.yaml +++ b/examples/ext_authz/config/opa-service/v3.yaml @@ -32,6 +32,8 @@ static_resources: timeout: 0.250s transport_api_version: V3 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: upstream-service diff --git a/examples/fault-injection/envoy.yaml b/examples/fault-injection/envoy.yaml index 491517fc2b5a..697fd2957960 100644 --- a/examples/fault-injection/envoy.yaml +++ b/examples/fault-injection/envoy.yaml @@ -41,6 +41,8 @@ static_resources: numerator: 0 denominator: HUNDRED - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/examples/front-proxy/front-envoy.yaml b/examples/front-proxy/front-envoy.yaml index 957c69193221..4cb579d82ec8 100644 --- a/examples/front-proxy/front-envoy.yaml +++ b/examples/front-proxy/front-envoy.yaml @@ -28,6 +28,8 @@ static_resources: cluster: service2 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: @@ -57,6 +59,8 @@ static_resources: cluster: service2 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls diff --git a/examples/front-proxy/service-envoy.yaml b/examples/front-proxy/service-envoy.yaml index e9365e49bf0d..b9424a6a0aec 100644 --- a/examples/front-proxy/service-envoy.yaml +++ b/examples/front-proxy/service-envoy.yaml @@ -24,6 +24,8 @@ static_resources: cluster: local_service http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/examples/grpc-bridge/client/envoy-proxy.yaml b/examples/grpc-bridge/client/envoy-proxy.yaml index 65795feae685..66c17b70d20e 100644 --- a/examples/grpc-bridge/client/envoy-proxy.yaml +++ b/examples/grpc-bridge/client/envoy-proxy.yaml @@ -32,7 +32,11 @@ static_resources: cluster: backend-proxy http_filters: - name: envoy.filters.http.grpc_http1_bridge + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_http1_bridge.v3.Config - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: backend-proxy type: LOGICAL_DNS diff --git a/examples/grpc-bridge/server/envoy-proxy.yaml b/examples/grpc-bridge/server/envoy-proxy.yaml index 1608836126e0..b929aff74540 100644 --- a/examples/grpc-bridge/server/envoy-proxy.yaml +++ b/examples/grpc-bridge/server/envoy-proxy.yaml @@ -29,6 +29,8 @@ static_resources: cluster: backend_grpc_service http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: backend_grpc_service type: STRICT_DNS diff --git a/examples/gzip/gzip-envoy.yaml b/examples/gzip/gzip-envoy.yaml index 30ffbe32f876..821515e057d0 100644 --- a/examples/gzip/gzip-envoy.yaml +++ b/examples/gzip/gzip-envoy.yaml @@ -38,6 +38,8 @@ static_resources: memory_level: 3 window_bits: 10 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: address: 0.0.0.0 @@ -76,6 +78,8 @@ static_resources: memory_level: 3 window_bits: 10 - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: envoy-stats connect_timeout: 0.25s diff --git a/examples/jaeger-native-tracing/front-envoy-jaeger.yaml b/examples/jaeger-native-tracing/front-envoy-jaeger.yaml index 5b76fd5e48f9..a918770e1626 100644 --- a/examples/jaeger-native-tracing/front-envoy-jaeger.yaml +++ b/examples/jaeger-native-tracing/front-envoy-jaeger.yaml @@ -48,6 +48,8 @@ static_resources: operation: checkAvailability http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router use_remote_address: true clusters: - name: service1 diff --git a/examples/jaeger-native-tracing/service1-envoy-jaeger.yaml b/examples/jaeger-native-tracing/service1-envoy-jaeger.yaml index 853df7b43d71..2c619d649849 100644 --- a/examples/jaeger-native-tracing/service1-envoy-jaeger.yaml +++ b/examples/jaeger-native-tracing/service1-envoy-jaeger.yaml @@ -27,6 +27,8 @@ static_resources: operation: checkAvailability http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: address: 0.0.0.0 @@ -74,6 +76,8 @@ static_resources: operation: checkStock http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: strict_dns diff --git a/examples/jaeger-native-tracing/service2-envoy-jaeger.yaml b/examples/jaeger-native-tracing/service2-envoy-jaeger.yaml index 51ba180802f1..d0640d85e558 100644 --- a/examples/jaeger-native-tracing/service2-envoy-jaeger.yaml +++ b/examples/jaeger-native-tracing/service2-envoy-jaeger.yaml @@ -47,6 +47,8 @@ static_resources: operation: checkStock http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: strict_dns diff --git a/examples/jaeger-tracing/front-envoy-jaeger.yaml b/examples/jaeger-tracing/front-envoy-jaeger.yaml index dc4d256b7bc1..94f8c2f4a7c9 100644 --- a/examples/jaeger-tracing/front-envoy-jaeger.yaml +++ b/examples/jaeger-tracing/front-envoy-jaeger.yaml @@ -37,6 +37,8 @@ static_resources: operation: checkAvailability http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router use_remote_address: true clusters: - name: service1 diff --git a/examples/jaeger-tracing/service1-envoy-jaeger.yaml b/examples/jaeger-tracing/service1-envoy-jaeger.yaml index 8d9b38356282..e8828675c01b 100644 --- a/examples/jaeger-tracing/service1-envoy-jaeger.yaml +++ b/examples/jaeger-tracing/service1-envoy-jaeger.yaml @@ -36,6 +36,8 @@ static_resources: operation: checkAvailability http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: address: 0.0.0.0 @@ -72,6 +74,8 @@ static_resources: operation: checkStock http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/examples/jaeger-tracing/service2-envoy-jaeger.yaml b/examples/jaeger-tracing/service2-envoy-jaeger.yaml index d1f09f5537fb..fba4635d154a 100644 --- a/examples/jaeger-tracing/service2-envoy-jaeger.yaml +++ b/examples/jaeger-tracing/service2-envoy-jaeger.yaml @@ -36,6 +36,8 @@ static_resources: operation: checkStock http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/examples/load-reporting-service/service-envoy-w-lrs.yaml b/examples/load-reporting-service/service-envoy-w-lrs.yaml index c8f3a31da413..6b3c1faeae80 100644 --- a/examples/load-reporting-service/service-envoy-w-lrs.yaml +++ b/examples/load-reporting-service/service-envoy-w-lrs.yaml @@ -24,6 +24,8 @@ static_resources: cluster: local_service http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/examples/locality-load-balancing/envoy-proxy.yaml b/examples/locality-load-balancing/envoy-proxy.yaml index bbc2b2699a4a..66b07a09d5e2 100644 --- a/examples/locality-load-balancing/envoy-proxy.yaml +++ b/examples/locality-load-balancing/envoy-proxy.yaml @@ -33,6 +33,8 @@ static_resources: cluster: backend http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: backend type: STRICT_DNS diff --git a/examples/lua/envoy.yaml b/examples/lua/envoy.yaml index e287dac1202b..8a04d61efc14 100644 --- a/examples/lua/envoy.yaml +++ b/examples/lua/envoy.yaml @@ -38,6 +38,8 @@ static_resources: response_handle:headers():add("response-body-size", tostring(body_size)) end - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: web_service diff --git a/examples/tls-sni/envoy-client.yaml b/examples/tls-sni/envoy-client.yaml index b99bbeead452..6ad6fae1caa3 100644 --- a/examples/tls-sni/envoy-client.yaml +++ b/examples/tls-sni/envoy-client.yaml @@ -32,6 +32,8 @@ static_resources: cluster: proxy-client-domain3 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: proxy-client-domain1 diff --git a/examples/tls-sni/envoy.yaml b/examples/tls-sni/envoy.yaml index b6248f9d748a..cbd488c99f22 100644 --- a/examples/tls-sni/envoy.yaml +++ b/examples/tls-sni/envoy.yaml @@ -6,6 +6,8 @@ static_resources: port_value: 10000 listener_filters: - name: "envoy.filters.listener.tls_inspector" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector filter_chains: - filter_chain_match: server_names: @@ -29,6 +31,8 @@ static_resources: cluster: proxy-domain1 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: @@ -62,6 +66,8 @@ static_resources: cluster: proxy-domain2 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/examples/tls/envoy-http-https.yaml b/examples/tls/envoy-http-https.yaml index ae532dd7c355..66952f6075dc 100644 --- a/examples/tls/envoy-http-https.yaml +++ b/examples/tls/envoy-http-https.yaml @@ -24,6 +24,8 @@ static_resources: cluster: service-https http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service-https diff --git a/examples/tls/envoy-https-http.yaml b/examples/tls/envoy-https-http.yaml index 8b79837662f7..f7b939e4ead8 100644 --- a/examples/tls/envoy-https-http.yaml +++ b/examples/tls/envoy-https-http.yaml @@ -24,6 +24,8 @@ static_resources: cluster: service-http http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/examples/tls/envoy-https-https.yaml b/examples/tls/envoy-https-https.yaml index fc2fecb710ff..d71ab283d72e 100644 --- a/examples/tls/envoy-https-https.yaml +++ b/examples/tls/envoy-https-https.yaml @@ -24,6 +24,8 @@ static_resources: cluster: service-https http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/examples/wasm-cc/envoy.yaml b/examples/wasm-cc/envoy.yaml index fac7045ee94f..4eb06118e2cc 100644 --- a/examples/wasm-cc/envoy.yaml +++ b/examples/wasm-cc/envoy.yaml @@ -43,6 +43,8 @@ static_resources: local: filename: "lib/envoy_filter_http_wasm_example.wasm" - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: web_service diff --git a/examples/websocket/envoy-ws.yaml b/examples/websocket/envoy-ws.yaml index 5db9005f3d53..7538081847b3 100644 --- a/examples/websocket/envoy-ws.yaml +++ b/examples/websocket/envoy-ws.yaml @@ -25,6 +25,8 @@ static_resources: cluster: service_ws http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service_ws diff --git a/examples/websocket/envoy-wss.yaml b/examples/websocket/envoy-wss.yaml index 4bd536402b0e..2dc3d804e252 100644 --- a/examples/websocket/envoy-wss.yaml +++ b/examples/websocket/envoy-wss.yaml @@ -25,6 +25,8 @@ static_resources: cluster: service_wss http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/examples/win32-front-proxy/front-envoy.yaml b/examples/win32-front-proxy/front-envoy.yaml index 695dcc325e2d..389bf26140b9 100644 --- a/examples/win32-front-proxy/front-envoy.yaml +++ b/examples/win32-front-proxy/front-envoy.yaml @@ -28,6 +28,8 @@ static_resources: cluster: service2 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: @@ -57,6 +59,8 @@ static_resources: cluster: service2 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.tls diff --git a/examples/win32-front-proxy/service-envoy.yaml b/examples/win32-front-proxy/service-envoy.yaml index fd9ed4457de7..f944baa6ff87 100644 --- a/examples/win32-front-proxy/service-envoy.yaml +++ b/examples/win32-front-proxy/service-envoy.yaml @@ -24,6 +24,8 @@ static_resources: cluster: local_service http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service connect_timeout: 0.25s diff --git a/examples/zipkin-tracing/front-envoy-zipkin.yaml b/examples/zipkin-tracing/front-envoy-zipkin.yaml index 0469b5895f38..daa509bc4d4c 100644 --- a/examples/zipkin-tracing/front-envoy-zipkin.yaml +++ b/examples/zipkin-tracing/front-envoy-zipkin.yaml @@ -43,6 +43,8 @@ static_resources: value: "%REQ(x-request-id)%" http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: service1 type: STRICT_DNS diff --git a/examples/zipkin-tracing/service1-envoy-zipkin.yaml b/examples/zipkin-tracing/service1-envoy-zipkin.yaml index bcee3c873d65..fe72cdb46243 100644 --- a/examples/zipkin-tracing/service1-envoy-zipkin.yaml +++ b/examples/zipkin-tracing/service1-envoy-zipkin.yaml @@ -35,6 +35,8 @@ static_resources: operation: checkAvailability http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - address: socket_address: address: 0.0.0.0 @@ -70,6 +72,8 @@ static_resources: operation: checkStock http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/examples/zipkin-tracing/service2-envoy-zipkin.yaml b/examples/zipkin-tracing/service2-envoy-zipkin.yaml index c13ba31ab635..c0ecb7df7ca0 100644 --- a/examples/zipkin-tracing/service2-envoy-zipkin.yaml +++ b/examples/zipkin-tracing/service2-envoy-zipkin.yaml @@ -35,6 +35,8 @@ static_resources: operation: checkStock http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service type: STRICT_DNS diff --git a/source/common/config/utility.h b/source/common/config/utility.h index 421bec5d7ea5..311a4b75d7dc 100644 --- a/source/common/config/utility.h +++ b/source/common/config/utility.h @@ -293,7 +293,8 @@ class Utility { template static Factory* getFactory(const ProtoMessage& message) { Factory* factory = Utility::getFactoryByType(message.typed_config()); - if (factory != nullptr) { + if (factory != nullptr || + Runtime::runtimeFeatureEnabled("envoy.reloadable_features.no_extension_lookup_by_name")) { return factory; } @@ -310,7 +311,14 @@ class Utility { template static Factory* getAndCheckFactory(const ProtoMessage& message, bool is_optional) { Factory* factory = Utility::getFactoryByType(message.typed_config()); - if (factory != nullptr) { + if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.no_extension_lookup_by_name")) { + if (factory == nullptr && !is_optional) { + ExceptionUtil::throwEnvoyException( + fmt::format("Didn't find a registered implementation for '{}' with type URL: '{}'", + message.name(), getFactoryType(message.typed_config()))); + } + return factory; + } else if (factory != nullptr) { return factory; } diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index d98d584b3f3a..99956eaad2a0 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -53,6 +53,7 @@ RUNTIME_GUARD(envoy_reloadable_features_http_strip_fragment_from_path_unsafe_if_ RUNTIME_GUARD(envoy_reloadable_features_internal_address); RUNTIME_GUARD(envoy_reloadable_features_listener_reuse_port_default_enabled); RUNTIME_GUARD(envoy_reloadable_features_new_tcp_connection_pool); +RUNTIME_GUARD(envoy_reloadable_features_no_extension_lookup_by_name); RUNTIME_GUARD(envoy_reloadable_features_override_request_timeout_by_gateway_timeout); RUNTIME_GUARD(envoy_reloadable_features_postpone_h3_client_connect_to_next_loop); RUNTIME_GUARD(envoy_reloadable_features_proxy_102_103); diff --git a/source/common/upstream/BUILD b/source/common/upstream/BUILD index df90081e1558..23b707b1d8f0 100644 --- a/source/common/upstream/BUILD +++ b/source/common/upstream/BUILD @@ -538,6 +538,7 @@ envoy_cc_library( "@envoy_api//envoy/config/cluster/v3:pkg_cc_proto", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", "@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/transport_sockets/raw_buffer/v3:pkg_cc_proto", "//envoy/event:dispatcher_interface", "//envoy/event:timer_interface", "//envoy/network:dns_interface", diff --git a/source/common/upstream/upstream_impl.cc b/source/common/upstream/upstream_impl.cc index 7c8ac1ac0c03..f01a65a00f19 100644 --- a/source/common/upstream/upstream_impl.cc +++ b/source/common/upstream/upstream_impl.cc @@ -17,6 +17,7 @@ #include "envoy/config/endpoint/v3/endpoint_components.pb.h" #include "envoy/event/dispatcher.h" #include "envoy/event/timer.h" +#include "envoy/extensions/transport_sockets/raw_buffer/v3/raw_buffer.pb.h" #include "envoy/init/manager.h" #include "envoy/network/dns.h" #include "envoy/network/transport_socket.h" @@ -1019,6 +1020,8 @@ Network::TransportSocketFactoryPtr createTransportSocketFactory( // if necessary. auto transport_socket = config.transport_socket(); if (!config.has_transport_socket()) { + envoy::extensions::transport_sockets::raw_buffer::v3::RawBuffer raw_buffer; + transport_socket.mutable_typed_config()->PackFrom(raw_buffer); transport_socket.set_name("envoy.transport_sockets.raw_buffer"); } diff --git a/source/extensions/filters/network/thrift_proxy/BUILD b/source/extensions/filters/network/thrift_proxy/BUILD index 68c7e5242eff..d3c1e0af8e17 100644 --- a/source/extensions/filters/network/thrift_proxy/BUILD +++ b/source/extensions/filters/network/thrift_proxy/BUILD @@ -57,6 +57,7 @@ envoy_cc_extension( "//source/extensions/filters/network/thrift_proxy/filters:filter_config_interface", "//source/extensions/filters/network/thrift_proxy/router:rds_lib", "//source/extensions/filters/network/thrift_proxy/router:router_lib", + "@envoy_api//envoy/extensions/filters/network/thrift_proxy/router/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/thrift_proxy/v3:pkg_cc_proto", ], ) diff --git a/source/extensions/filters/network/thrift_proxy/config.cc b/source/extensions/filters/network/thrift_proxy/config.cc index 65f6e02e0699..6bb313f4409e 100644 --- a/source/extensions/filters/network/thrift_proxy/config.cc +++ b/source/extensions/filters/network/thrift_proxy/config.cc @@ -3,6 +3,7 @@ #include #include +#include "envoy/extensions/filters/network/thrift_proxy/router/v3/router.pb.h" #include "envoy/extensions/filters/network/thrift_proxy/v3/thrift_proxy.pb.h" #include "envoy/extensions/filters/network/thrift_proxy/v3/thrift_proxy.pb.validate.h" #include "envoy/network/connection.h" @@ -142,6 +143,8 @@ ConfigImpl::ConfigImpl( envoy::extensions::filters::network::thrift_proxy::v3::ThriftFilter router; router.set_name("envoy.filters.thrift.router"); + envoy::extensions::filters::network::thrift_proxy::router::v3::Router default_router; + router.mutable_typed_config()->PackFrom(default_router); processFilter(router); } else { for (const auto& filter : config.thrift_filters()) { diff --git a/source/server/BUILD b/source/server/BUILD index a408ed0905ba..61855b1d60aa 100644 --- a/source/server/BUILD +++ b/source/server/BUILD @@ -526,6 +526,7 @@ envoy_cc_library( "@envoy_api//envoy/config/core/v3:pkg_cc_proto", "@envoy_api//envoy/config/listener/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/listener/proxy_protocol/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/transport_sockets/raw_buffer/v3:pkg_cc_proto", ] + envoy_select_enable_http3([ "//source/common/quic:active_quic_listener_lib", "//source/common/quic:client_connection_factory_lib", diff --git a/source/server/listener_manager_impl.cc b/source/server/listener_manager_impl.cc index e945c7f7ceb0..82575d2b7ec3 100644 --- a/source/server/listener_manager_impl.cc +++ b/source/server/listener_manager_impl.cc @@ -7,6 +7,7 @@ #include "envoy/config/core/v3/base.pb.h" #include "envoy/config/listener/v3/listener.pb.h" #include "envoy/config/listener/v3/listener_components.pb.h" +#include "envoy/extensions/transport_sockets/raw_buffer/v3/raw_buffer.pb.h" #include "envoy/network/filter.h" #include "envoy/network/listener.h" #include "envoy/registry/registry.h" @@ -912,6 +913,8 @@ Network::DrainableFilterChainSharedPtr ListenerFilterChainFactoryBuilder::buildF // We copy by value first then override if necessary. auto transport_socket = filter_chain.transport_socket(); if (!filter_chain.has_transport_socket()) { + envoy::extensions::transport_sockets::raw_buffer::v3::RawBuffer raw_buffer; + transport_socket.mutable_typed_config()->PackFrom(raw_buffer); transport_socket.set_name("envoy.transport_sockets.raw_buffer"); } diff --git a/test/common/config/BUILD b/test/common/config/BUILD index 976ed6ede867..eb4024f1f966 100644 --- a/test/common/config/BUILD +++ b/test/common/config/BUILD @@ -573,5 +573,6 @@ envoy_cc_test( "//test/mocks/protobuf:protobuf_mocks", "//test/mocks/server:instance_mocks", "//test/test_common:registry_lib", + "//test/test_common:test_runtime_lib", ], ) diff --git a/test/common/config/custom_config_validators_impl_test.cc b/test/common/config/custom_config_validators_impl_test.cc index 2a68d5ccdf94..af31886a9f59 100644 --- a/test/common/config/custom_config_validators_impl_test.cc +++ b/test/common/config/custom_config_validators_impl_test.cc @@ -3,6 +3,7 @@ #include "test/mocks/protobuf/mocks.h" #include "test/mocks/server/instance.h" #include "test/test_common/registry.h" +#include "test/test_common/test_runtime.h" #include "gtest/gtest.h" @@ -62,7 +63,10 @@ class CustomConfigValidatorsImplTest : public testing::Test { public: CustomConfigValidatorsImplTest() : factory_accept_(false), factory_reject_(true), register_factory_accept_(factory_accept_), - register_factory_reject_(factory_reject_) {} + register_factory_reject_(factory_reject_) { + scoped_runtime_.mergeValues( + {{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + } static envoy::config::core::v3::TypedExtensionConfig parseConfig(const std::string& config) { envoy::config::core::v3::TypedExtensionConfig proto; @@ -77,6 +81,7 @@ class CustomConfigValidatorsImplTest : public testing::Test { testing::NiceMock validation_visitor_; const testing::NiceMock server_; const std::string type_url_{Envoy::Config::getTypeUrl()}; + TestScopedRuntime scoped_runtime_; static constexpr char AcceptValidatorConfig[] = "name: envoy.config.validators.fake_config_validator_accept"; diff --git a/test/common/matcher/matcher_test.cc b/test/common/matcher/matcher_test.cc index d67ce1cc9e1c..50cf95f903e7 100644 --- a/test/common/matcher/matcher_test.cc +++ b/test/common/matcher/matcher_test.cc @@ -60,7 +60,7 @@ TEST_F(MatcherTest, TestMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo )EOF"; @@ -70,12 +70,13 @@ TEST_F(MatcherTest, TestMatcher) { TestUtility::validate(matcher); - auto outer_factory = TestDataInputFactory("outer_input", "value"); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto outer_factory = TestDataInputStringFactory("value"); + auto inner_factory = TestDataInputBoolFactory("foo"); EXPECT_CALL(validation_visitor_, - performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")) - .Times(2); + performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")); + EXPECT_CALL(validation_visitor_, + performDataInputValidation(_, "type.googleapis.com/google.protobuf.BoolValue")); auto match_tree = factory_.create(matcher); const auto result = match_tree()->match(TestData()); @@ -108,7 +109,7 @@ TEST_F(MatcherTest, TestPrefixMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo )EOF"; @@ -118,12 +119,13 @@ TEST_F(MatcherTest, TestPrefixMatcher) { TestUtility::validate(matcher); - auto outer_factory = TestDataInputFactory("outer_input", "value"); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto outer_factory = TestDataInputStringFactory("value"); + auto inner_factory = TestDataInputBoolFactory("foo"); EXPECT_CALL(validation_visitor_, - performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")) - .Times(2); + performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")); + EXPECT_CALL(validation_visitor_, + performDataInputValidation(_, "type.googleapis.com/google.protobuf.BoolValue")); auto match_tree = factory_.create(matcher); const auto result = match_tree()->match(TestData()); @@ -204,10 +206,11 @@ TEST_F(MatcherTest, CustomMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue custom_match: name: never_match - typed_config: {} + typed_config: + "@type": type.googleapis.com/google.protobuf.StringValue )EOF"; envoy::config::common::matcher::v3::Matcher matcher; @@ -215,11 +218,11 @@ TEST_F(MatcherTest, CustomMatcher) { TestUtility::validate(matcher); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto inner_factory = TestDataInputBoolFactory("foo"); NeverMatchFactory match_factory; EXPECT_CALL(validation_visitor_, - performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")); + performDataInputValidation(_, "type.googleapis.com/google.protobuf.BoolValue")); auto match_tree = factory_.create(matcher); const auto result = match_tree()->match(TestData()); @@ -253,14 +256,14 @@ TEST_F(MatcherTest, TestAndMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo - single_predicate: input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo )EOF"; @@ -270,12 +273,14 @@ TEST_F(MatcherTest, TestAndMatcher) { TestUtility::validate(matcher); - auto outer_factory = TestDataInputFactory("outer_input", "value"); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto outer_factory = TestDataInputStringFactory("value"); + auto inner_factory = TestDataInputBoolFactory("foo"); EXPECT_CALL(validation_visitor_, - performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")) - .Times(3); + performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")); + EXPECT_CALL(validation_visitor_, + performDataInputValidation(_, "type.googleapis.com/google.protobuf.BoolValue")) + .Times(2); auto match_tree = factory_.create(matcher); const auto result = match_tree()->match(TestData()); @@ -310,14 +315,14 @@ TEST_F(MatcherTest, TestOrMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo - single_predicate: input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo )EOF"; @@ -327,12 +332,14 @@ TEST_F(MatcherTest, TestOrMatcher) { TestUtility::validate(matcher); - auto outer_factory = TestDataInputFactory("outer_input", "value"); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto outer_factory = TestDataInputStringFactory("value"); + auto inner_factory = TestDataInputBoolFactory("foo"); EXPECT_CALL(validation_visitor_, - performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")) - .Times(3); + performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")); + EXPECT_CALL(validation_visitor_, + performDataInputValidation(_, "type.googleapis.com/google.protobuf.BoolValue")) + .Times(2); auto match_tree = factory_.create(matcher); const auto result = match_tree()->match(TestData()); @@ -367,7 +374,7 @@ TEST_F(MatcherTest, TestNotMatcher) { TestUtility::validate(matcher); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto inner_factory = TestDataInputStringFactory("foo"); NeverMatchFactory match_factory; EXPECT_CALL(validation_visitor_, @@ -398,7 +405,7 @@ TEST_F(MatcherTest, TestRecursiveMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo predicate: @@ -406,7 +413,7 @@ TEST_F(MatcherTest, TestRecursiveMatcher) { input: name: inner_input typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue value_match: exact: foo )EOF"; @@ -416,11 +423,11 @@ TEST_F(MatcherTest, TestRecursiveMatcher) { TestUtility::validate(matcher); - auto outer_factory = TestDataInputFactory("outer_input", "value"); - auto inner_factory = TestDataInputFactory("inner_input", "foo"); + auto outer_factory = TestDataInputStringFactory("value"); + auto inner_factory = TestDataInputBoolFactory("foo"); EXPECT_CALL(validation_visitor_, - performDataInputValidation(_, "type.googleapis.com/google.protobuf.StringValue")) + performDataInputValidation(_, "type.googleapis.com/google.protobuf.BoolValue")) .Times(2); auto match_tree = factory_.create(matcher); diff --git a/test/common/matcher/test_utility.h b/test/common/matcher/test_utility.h index 58f1f28fec7a..db8fcd046e18 100644 --- a/test/common/matcher/test_utility.h +++ b/test/common/matcher/test_utility.h @@ -54,14 +54,12 @@ struct TestInput : public DataInput { }; // Self-injecting factory for TestInput. -class TestDataInputFactory : public DataInputFactory { +class TestDataInputStringFactory : public DataInputFactory { public: - TestDataInputFactory(absl::string_view factory_name, DataInputGetResult result) - : factory_name_(std::string(factory_name)), result_(result), injection_(*this) {} - TestDataInputFactory(absl::string_view factory_name, absl::string_view data) - : TestDataInputFactory(factory_name, {DataInputGetResult::DataAvailability::AllDataAvailable, - std::string(data)}) {} - + TestDataInputStringFactory(DataInputGetResult result) : result_(result), injection_(*this) {} + TestDataInputStringFactory(absl::string_view data) + : TestDataInputStringFactory( + {DataInputGetResult::DataAvailability::AllDataAvailable, std::string(data)}) {} DataInputFactoryCb createDataInputFactoryCb(const Protobuf::Message&, ProtobufMessage::ValidationVisitor&) override { return [&]() { return std::make_unique(result_); }; @@ -70,10 +68,31 @@ class TestDataInputFactory : public DataInputFactory { ProtobufTypes::MessagePtr createEmptyConfigProto() override { return std::make_unique(); } - std::string name() const override { return factory_name_; } + std::string name() const override { return "string"; } + +private: + const DataInputGetResult result_; + Registry::InjectFactory> injection_; +}; + +// Secondary data input to avoid duplicate type registration. +class TestDataInputBoolFactory : public DataInputFactory { +public: + TestDataInputBoolFactory(DataInputGetResult result) : result_(result), injection_(*this) {} + TestDataInputBoolFactory(absl::string_view data) + : TestDataInputBoolFactory( + {DataInputGetResult::DataAvailability::AllDataAvailable, std::string(data)}) {} + DataInputFactoryCb + createDataInputFactoryCb(const Protobuf::Message&, ProtobufMessage::ValidationVisitor&) override { + return [&]() { return std::make_unique(result_); }; + } + + ProtobufTypes::MessagePtr createEmptyConfigProto() override { + return std::make_unique(); + } + std::string name() const override { return "bool"; } private: - const std::string factory_name_; const DataInputGetResult result_; Registry::InjectFactory> injection_; }; diff --git a/test/common/network/dns_resolver/dns_factory_test.cc b/test/common/network/dns_resolver/dns_factory_test.cc index 813b64a52971..c1b61f5adf9b 100644 --- a/test/common/network/dns_resolver/dns_factory_test.cc +++ b/test/common/network/dns_resolver/dns_factory_test.cc @@ -271,7 +271,8 @@ TEST_F(DnsFactoryTest, MakeDnsResolverFactoryFromProtoTestInCaresWithInvalidType config.mutable_typed_dns_resolver_config()->MergeFrom(typed_dns_resolver_config); EXPECT_THROW_WITH_MESSAGE( Envoy::Network::createDnsResolverFactoryFromProto(config, typed_dns_resolver_config), - Envoy::EnvoyException, "Didn't find a registered implementation for name: 'bar'"); + Envoy::EnvoyException, + "Didn't find a registered implementation for 'bar' with type URL: 'foo'"); } } // namespace Network diff --git a/test/common/router/config_impl_test.cc b/test/common/router/config_impl_test.cc index 3b23f69e151c..12e33346299f 100644 --- a/test/common/router/config_impl_test.cc +++ b/test/common/router/config_impl_test.cc @@ -8215,6 +8215,9 @@ TEST_F(RouteConfigurationV2, BadConnectConfig) { // Verifies that we're creating a new instance of the retry plugins on each call instead of // always returning the same one. TEST_F(RouteConfigurationV2, RetryPluginsAreNotReused) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + const std::string yaml = R"EOF( virtual_hosts: - name: regex diff --git a/test/common/tracing/BUILD b/test/common/tracing/BUILD index 449fb54efa33..9a49a1d9b128 100644 --- a/test/common/tracing/BUILD +++ b/test/common/tracing/BUILD @@ -85,5 +85,6 @@ envoy_cc_test( "//test/mocks/server:tracer_factory_mocks", "//test/mocks/tracing:tracing_mocks", "//test/test_common:registry_lib", + "//test/test_common:test_runtime_lib", ], ) diff --git a/test/common/tracing/http_tracer_manager_impl_test.cc b/test/common/tracing/http_tracer_manager_impl_test.cc index 9cd493706048..c08e6dbceb8b 100644 --- a/test/common/tracing/http_tracer_manager_impl_test.cc +++ b/test/common/tracing/http_tracer_manager_impl_test.cc @@ -6,6 +6,7 @@ #include "test/mocks/server/tracer_factory.h" #include "test/mocks/tracing/mocks.h" #include "test/test_common/registry.h" +#include "test/test_common/test_runtime.h" #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -64,6 +65,8 @@ TEST_F(HttpTracerManagerImplTest, } TEST_F(HttpTracerManagerImplTest, ShouldUseProperTracerFactory) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); envoy::config::trace::v3::Tracing_Http tracing_config; tracing_config.set_name("envoy.tracers.sample"); @@ -117,6 +120,8 @@ TEST_F(HttpTracerManagerImplTest, ShouldCacheTracersBasedOnFullConfig) { } TEST_F(HttpTracerManagerImplTest, ShouldFailIfTracerProviderIsUnknown) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); envoy::config::trace::v3::Tracing_Http tracing_config; tracing_config.set_name("invalid"); @@ -126,6 +131,9 @@ TEST_F(HttpTracerManagerImplTest, ShouldFailIfTracerProviderIsUnknown) { } TEST_F(HttpTracerManagerImplTest, ShouldFailIfProviderSpecificConfigIsNotValid) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + envoy::config::trace::v3::Tracing_Http tracing_config; tracing_config.set_name("envoy.tracers.sample"); tracing_config.mutable_typed_config()->PackFrom(ValueUtil::stringValue("value")); diff --git a/test/common/upstream/cluster_manager_impl_test.cc b/test/common/upstream/cluster_manager_impl_test.cc index d15c6952a53d..25b1f1b8fea2 100644 --- a/test/common/upstream/cluster_manager_impl_test.cc +++ b/test/common/upstream/cluster_manager_impl_test.cc @@ -474,6 +474,9 @@ class AlpnTestConfigFactory }; TEST_F(ClusterManagerImplTest, MultipleProtocolClusterAlpn) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + AlpnTestConfigFactory alpn_factory; Registry::InjectFactory registered_factory(alpn_factory); @@ -1090,6 +1093,9 @@ TEST_F(ClusterManagerImplTest, LbPolicyConfigMustSpecifyLbPolicy) { // Verify that multiple load balancing policies can be specified, and Envoy selects the first // policy that it has a factory for. TEST_F(ClusterManagerImplTest, LbPolicyConfig) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + // envoy.load_balancers.custom_lb is registered by linking in // //test/integration/load_balancers:custom_lb_policy. const std::string yaml = fmt::format(R"EOF( @@ -4343,6 +4349,9 @@ class TestUpstreamNetworkFilterConfigFactory // Verify that configured upstream filters are added to client connections. TEST_F(ClusterManagerImplTest, AddUpstreamFilters) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + TestUpstreamNetworkFilterConfigFactory factory; Registry::InjectFactory registry( factory); diff --git a/test/common/upstream/eds_test.cc b/test/common/upstream/eds_test.cc index 3cc0c67d6257..a2d48b454542 100644 --- a/test/common/upstream/eds_test.cc +++ b/test/common/upstream/eds_test.cc @@ -78,10 +78,14 @@ class EdsTest : public testing::Test { name: secure-mode transport_socket: name: envoy.transport_sockets.tls + typed_config: + "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext - match: {} name: default-mode transport_socket: name: envoy.transport_sockets.raw_buffer + typed_config: + "@type": type.googleapis.com/envoy.extensions.transport_sockets.raw_buffer.v3.RawBuffer )EOF", Cluster::InitializePhase::Secondary); } @@ -1701,6 +1705,9 @@ TEST_F(EdsLocalityWeightsTest, WeightsPresentWithLocalityWeightedConfig) { // Validate that onConfigUpdate() propagates locality weights to the host set when the cluster uses // load balancing policy extensions. TEST_F(EdsLocalityWeightsTest, WeightsPresentWithLoadBalancingPolicyConfig) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + // envoy.load_balancers.custom_lb is registered by linking in // //test/integration/load_balancers:custom_lb_policy. expectLocalityWeightsPresentForClusterConfig(R"EOF( diff --git a/test/common/upstream/hds_test.cc b/test/common/upstream/hds_test.cc index 7f80c6297ff6..6478e3819b30 100644 --- a/test/common/upstream/hds_test.cc +++ b/test/common/upstream/hds_test.cc @@ -211,6 +211,8 @@ class HdsTest : public testing::Test { %s: "true" transport_socket: name: "envoy.transport_sockets.raw_buffer" + typed_config: + "@type": type.googleapis.com/envoy.extensions.transport_sockets.raw_buffer.v3.RawBuffer )EOF", match); cluster_health_check->MergeFrom( diff --git a/test/common/upstream/upstream_impl_test.cc b/test/common/upstream/upstream_impl_test.cc index 664c4645e92e..d821adfaf74c 100644 --- a/test/common/upstream/upstream_impl_test.cc +++ b/test/common/upstream/upstream_impl_test.cc @@ -2185,6 +2185,9 @@ TEST_F(StaticClusterImplTest, UnsupportedLBType) { // load_balancing_policy should be used when lb_policy is set to LOAD_BALANCING_POLICY_CONFIG. TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithLbPolicy) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + const std::string yaml = R"EOF( name: staticcluster connect_timeout: 0.25s @@ -2194,10 +2197,6 @@ TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithLbPolicy) { policies: - typed_extension_config: name: custom_lb - typed_config: - "@type": type.googleapis.com/google.protobuf.Struct - value: - foo: "bar" load_assignment: endpoints: - lb_endpoints: @@ -2230,6 +2229,9 @@ TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithLbPolicy) { // load_balancing_policy should also be used when lb_policy is set to something else besides // LOAD_BALANCING_POLICY_CONFIG. TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithOtherLbPolicy) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + const std::string yaml = R"EOF( name: staticcluster connect_timeout: 0.25s @@ -2239,10 +2241,6 @@ TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithOtherLbPolicy) { policies: - typed_extension_config: name: custom_lb - typed_config: - "@type": type.googleapis.com/google.protobuf.Struct - value: - foo: "bar" load_assignment: endpoints: - lb_endpoints: @@ -2274,6 +2272,9 @@ TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithOtherLbPolicy) { // load_balancing_policy should also be used when lb_policy is omitted. TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithoutLbPolicy) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + const std::string yaml = R"EOF( name: staticcluster connect_timeout: 0.25s @@ -2282,10 +2283,6 @@ TEST_F(StaticClusterImplTest, LoadBalancingPolicyWithoutLbPolicy) { policies: - typed_extension_config: name: custom_lb - typed_config: - "@type": type.googleapis.com/google.protobuf.Struct - value: - foo: "bar" load_assignment: endpoints: - lb_endpoints: @@ -4031,6 +4028,8 @@ TEST_F(ClusterInfoImplTest, Http2AutoWithNonAlpnMatcher) { name: insecure-mode transport_socket: name: envoy.transport_sockets.raw_buffer + typed_config: + "@type": type.googleapis.com/envoy.extensions.transport_sockets.raw_buffer.v3.RawBuffer transport_socket: name: envoy.transport_sockets.tls typed_config: diff --git a/test/config/integration/server_xds.lds.typed_struct.yaml b/test/config/integration/server_xds.lds.typed_struct.yaml index eda8a08326f1..a736cec84238 100644 --- a/test/config/integration/server_xds.lds.typed_struct.yaml +++ b/test/config/integration/server_xds.lds.typed_struct.yaml @@ -22,4 +22,7 @@ resources: resource_api_version: V3 path_config_source: path: "{{ rds_json_path }}" - http_filters: [{name: envoy.filters.http.router}] + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router diff --git a/test/config/integration/server_xds.lds.udpa.list_collection.yaml b/test/config/integration/server_xds.lds.udpa.list_collection.yaml index 91b7ce26c7cc..bdbd3d28c72a 100644 --- a/test/config/integration/server_xds.lds.udpa.list_collection.yaml +++ b/test/config/integration/server_xds.lds.udpa.list_collection.yaml @@ -26,4 +26,7 @@ resource: resource_api_version: V3 path_config_source: path: "{{ rds_json_path }}" - http_filters: [{name: envoy.filters.http.router}] + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router diff --git a/test/config/integration/server_xds.lds.with_unknown_field.typed_struct.yaml b/test/config/integration/server_xds.lds.with_unknown_field.typed_struct.yaml index e9f8324aa781..37601db20214 100644 --- a/test/config/integration/server_xds.lds.with_unknown_field.typed_struct.yaml +++ b/test/config/integration/server_xds.lds.with_unknown_field.typed_struct.yaml @@ -22,5 +22,8 @@ resources: resource_api_version: V3 path_config_source: path: "{{ rds_json_path }}" - http_filters: [{name: envoy.filters.http.router}] + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router foo: bar diff --git a/test/config/integration/server_xds.lds.with_unknown_field.yaml b/test/config/integration/server_xds.lds.with_unknown_field.yaml index ec467b52597b..b69be6046ee4 100644 --- a/test/config/integration/server_xds.lds.with_unknown_field.yaml +++ b/test/config/integration/server_xds.lds.with_unknown_field.yaml @@ -21,5 +21,8 @@ resources: resource_api_version: V3 path_config_source: path: "{{ rds_json_path }}" - http_filters: [{name: envoy.filters.http.router}] + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router foo: bar diff --git a/test/config/integration/server_xds.lds.yaml b/test/config/integration/server_xds.lds.yaml index e02fa9e9b73f..9e92a1ee6fb0 100644 --- a/test/config/integration/server_xds.lds.yaml +++ b/test/config/integration/server_xds.lds.yaml @@ -20,4 +20,8 @@ resources: resource_api_version: V3 path_config_source: path: "{{ rds_json_path }}" - http_filters: [{name: envoy.filters.http.router}] + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + diff --git a/test/config/utility.cc b/test/config/utility.cc index a003fb6e793d..853c93156b9b 100644 --- a/test/config/utility.cc +++ b/test/config/utility.cc @@ -160,6 +160,7 @@ std::string ConfigHelper::tlsInspectorFilter(bool enable_ja3_fingerprinting) { return R"EOF( name: "envoy.filters.listener.tls_inspector" typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector )EOF"; } @@ -185,7 +186,9 @@ std::string ConfigHelper::httpProxyConfig(bool downstream_use_quic) { delayed_close_timeout: nanos: 10000000 http_filters: - name: envoy.filters.http.router + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router codec_type: HTTP1 access_log: name: accesslog @@ -216,13 +219,17 @@ std::string ConfigHelper::quicHttpProxyConfig() { filter_chains: transport_socket: name: envoy.transport_sockets.quic + typed_config: + "@type": type.googleapis.com/envoy.extensions.transport_sockets.quic.v3.QuicDownstreamTransport filters: name: http typed_config: "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager stat_prefix: config_test http_filters: - name: envoy.filters.http.router + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router codec_type: HTTP3 access_log: name: file_access_log @@ -351,7 +358,9 @@ std::string ConfigHelper::discoveredClustersBootstrap(const std::string& api_typ "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager stat_prefix: config_test http_filters: - name: envoy.filters.http.router + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router codec_type: HTTP2 route_config: name: route_config_0 @@ -625,7 +634,10 @@ envoy::config::listener::v3::Listener ConfigHelper::buildListener(const std::str config_source: resource_api_version: V3 ads: {{}} - http_filters: [{{ name: envoy.filters.http.router }}] + http_filters: + - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF", stat_prefix, route_config); return buildBaseListener(name, address, hcm); diff --git a/test/extensions/access_loggers/file/config_test.cc b/test/extensions/access_loggers/file/config_test.cc index ca8448f7ad9f..1644c756c3f8 100644 --- a/test/extensions/access_loggers/file/config_test.cc +++ b/test/extensions/access_loggers/file/config_test.cc @@ -34,12 +34,13 @@ TEST(FileAccessLogNegativeTest, InvalidNameFail) { NiceMock context; EXPECT_THROW_WITH_MESSAGE(AccessLog::AccessLogFactory::fromProto(config, context), EnvoyException, - "Provided name for static registration lookup was empty."); + "Didn't find a registered implementation for '' with type URL: ''"); config.set_name("INVALID"); - EXPECT_THROW_WITH_MESSAGE(AccessLog::AccessLogFactory::fromProto(config, context), EnvoyException, - "Didn't find a registered implementation for name: 'INVALID'"); + EXPECT_THROW_WITH_MESSAGE( + AccessLog::AccessLogFactory::fromProto(config, context), EnvoyException, + "Didn't find a registered implementation for 'INVALID' with type URL: ''"); } class FileAccessLogTest : public testing::Test { diff --git a/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc b/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc index 6fe68041271b..18aeb760e816 100644 --- a/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc +++ b/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc @@ -1210,7 +1210,8 @@ TEST(UtilityTest, PrepareDnsRefreshStrategy) { TEST_F(DnsCacheImplTest, ResolveSuccessWithCaching) { TestScopedRuntime scoped_runtime; - scoped_runtime.mergeValues({{"envoy.reloadable_features.allow_multiple_dns_addresses", "true"}}); + scoped_runtime.mergeValues({{"envoy.reloadable_features.allow_multiple_dns_addresses", "true"}, + {"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); auto* time_source = new NiceMock(); context_.dispatcher_.time_system_.reset(time_source); @@ -1326,7 +1327,8 @@ TEST_F(DnsCacheImplTest, ResolveSuccessWithCaching) { TEST_F(DnsCacheImplTest, CacheLoad) { TestScopedRuntime scoped_runtime; - scoped_runtime.mergeValues({{"envoy.reloadable_features.allow_multiple_dns_addresses", "true"}}); + scoped_runtime.mergeValues({{"envoy.reloadable_features.allow_multiple_dns_addresses", "true"}, + {"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); auto* time_source = new NiceMock(); context_.dispatcher_.time_system_.reset(time_source); diff --git a/test/extensions/common/matcher/trie_matcher_test.cc b/test/extensions/common/matcher/trie_matcher_test.cc index afe0a34d9987..bf589a0e9248 100644 --- a/test/extensions/common/matcher/trie_matcher_test.cc +++ b/test/extensions/common/matcher/trie_matcher_test.cc @@ -35,7 +35,8 @@ using ::Envoy::Matcher::MockMatchTreeValidationVisitor; using ::Envoy::Matcher::StringAction; using ::Envoy::Matcher::StringActionFactory; using ::Envoy::Matcher::TestData; -using ::Envoy::Matcher::TestDataInputFactory; +using ::Envoy::Matcher::TestDataInputBoolFactory; +using ::Envoy::Matcher::TestDataInputStringFactory; class TrieMatcherTest : public ::testing::Test { public: @@ -117,19 +118,19 @@ TEST_F(TrieMatcherTest, TestMatcher) { loadConfig(yaml); { - auto input = TestDataInputFactory("input", "192.0.100.1"); + auto input = TestDataInputStringFactory("192.0.100.1"); validateMatch("foo"); } { - auto input = TestDataInputFactory("input", "192.101.0.1"); + auto input = TestDataInputStringFactory("192.101.0.1"); validateMatch("bar"); } { - auto input = TestDataInputFactory("input", "128.0.0.1"); + auto input = TestDataInputStringFactory("128.0.0.1"); validateNoMatch(); } { - auto input = TestDataInputFactory("input", "xxx"); + auto input = TestDataInputStringFactory("xxx"); validateNoMatch(); } } @@ -165,23 +166,23 @@ TEST_F(TrieMatcherTest, TestMatcherOnNoMatch) { loadConfig(yaml); { - auto input = TestDataInputFactory("input", "192.0.100.1"); + auto input = TestDataInputStringFactory("192.0.100.1"); validateMatch("foo"); } { // No range matches. - auto input = TestDataInputFactory("input", "128.0.0.1"); + auto input = TestDataInputStringFactory("128.0.0.1"); validateMatch("bar"); } { // Input is not a valid IP. - auto input = TestDataInputFactory("input", "xxx"); + auto input = TestDataInputStringFactory("xxx"); validateMatch("bar"); } { // Input is nullopt. - auto input = TestDataInputFactory( - "input", {DataInputGetResult::DataAvailability::AllDataAvailable, absl::nullopt}); + auto input = TestDataInputStringFactory( + {DataInputGetResult::DataAvailability::AllDataAvailable, absl::nullopt}); validateMatch("bar"); } } @@ -228,15 +229,15 @@ TEST_F(TrieMatcherTest, OverlappingMatcher) { loadConfig(yaml); { - auto input = TestDataInputFactory("input", "192.0.100.1"); + auto input = TestDataInputStringFactory("192.0.100.1"); validateMatch("foo"); } { - auto input = TestDataInputFactory("input", "192.0.0.1"); + auto input = TestDataInputStringFactory("192.0.0.1"); validateMatch("bar"); } { - auto input = TestDataInputFactory("input", "255.0.0.1"); + auto input = TestDataInputStringFactory("255.0.0.1"); validateMatch("bar"); } } @@ -270,7 +271,7 @@ TEST_F(TrieMatcherTest, NestedInclusiveMatcher) { input: name: nested typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue exact_match_map: map: baz: @@ -283,18 +284,18 @@ TEST_F(TrieMatcherTest, NestedInclusiveMatcher) { loadConfig(yaml); { - auto input = TestDataInputFactory("input", "192.0.100.1"); - auto nested = TestDataInputFactory("nested", "baz"); + auto input = TestDataInputStringFactory("192.0.100.1"); + auto nested = TestDataInputBoolFactory("baz"); validateMatch("bar"); } { - auto input = TestDataInputFactory("input", "192.0.100.1"); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory("192.0.100.1"); + auto nested = TestDataInputBoolFactory(""); validateMatch("foo"); } { - auto input = TestDataInputFactory("input", "128.0.0.1"); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory("128.0.0.1"); + auto nested = TestDataInputBoolFactory(""); validateMatch("foo"); } } @@ -330,7 +331,7 @@ TEST_F(TrieMatcherTest, NestedExclusiveMatcher) { input: name: nested typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue exact_match_map: map: baz: @@ -343,18 +344,18 @@ TEST_F(TrieMatcherTest, NestedExclusiveMatcher) { loadConfig(yaml); { - auto input = TestDataInputFactory("input", "192.0.100.1"); - auto nested = TestDataInputFactory("nested", "baz"); + auto input = TestDataInputStringFactory("192.0.100.1"); + auto nested = TestDataInputBoolFactory("baz"); validateMatch("bar"); } { - auto input = TestDataInputFactory("input", "192.0.100.1"); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory("192.0.100.1"); + auto nested = TestDataInputBoolFactory(""); validateNoMatch(); } { - auto input = TestDataInputFactory("input", "128.0.0.1"); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory("128.0.0.1"); + auto nested = TestDataInputBoolFactory(""); validateMatch("foo"); } } @@ -388,7 +389,7 @@ TEST_F(TrieMatcherTest, RecursiveMatcherTree) { input: name: nested typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue exact_match_map: map: bar: @@ -403,7 +404,7 @@ TEST_F(TrieMatcherTest, RecursiveMatcherTree) { input: name: nested typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue exact_match_map: map: baz: @@ -416,18 +417,18 @@ TEST_F(TrieMatcherTest, RecursiveMatcherTree) { loadConfig(yaml); { - auto input = TestDataInputFactory("input", "192.0.100.1"); - auto nested = TestDataInputFactory("nested", "baz"); + auto input = TestDataInputStringFactory("192.0.100.1"); + auto nested = TestDataInputBoolFactory("baz"); validateMatch("baz"); } { - auto input = TestDataInputFactory("input", "192.0.100.1"); - auto nested = TestDataInputFactory("nested", "bar"); + auto input = TestDataInputStringFactory("192.0.100.1"); + auto nested = TestDataInputBoolFactory("bar"); validateMatch("bar"); } { - auto input = TestDataInputFactory("input", "128.0.0.1"); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory("128.0.0.1"); + auto nested = TestDataInputBoolFactory(""); validateMatch("foo"); } } @@ -452,7 +453,7 @@ TEST_F(TrieMatcherTest, NoData) { input: name: nested typed_config: - "@type": type.googleapis.com/google.protobuf.StringValue + "@type": type.googleapis.com/google.protobuf.BoolValue custom_match: name: ip_matcher typed_config: @@ -471,27 +472,27 @@ TEST_F(TrieMatcherTest, NoData) { loadConfig(yaml); { - auto input = TestDataInputFactory( - "input", {DataInputGetResult::DataAvailability::AllDataAvailable, absl::nullopt}); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory( + {DataInputGetResult::DataAvailability::AllDataAvailable, absl::nullopt}); + auto nested = TestDataInputBoolFactory(""); validateNoMatch(); } { - auto input = TestDataInputFactory("input", "127.0.0.1"); - auto nested = TestDataInputFactory( - "nested", {DataInputGetResult::DataAvailability::AllDataAvailable, absl::nullopt}); + auto input = TestDataInputStringFactory("127.0.0.1"); + auto nested = TestDataInputBoolFactory( + {DataInputGetResult::DataAvailability::AllDataAvailable, absl::nullopt}); validateNoMatch(); } { - auto input = TestDataInputFactory( - "input", {DataInputGetResult::DataAvailability::NotAvailable, absl::nullopt}); - auto nested = TestDataInputFactory("nested", ""); + auto input = TestDataInputStringFactory( + {DataInputGetResult::DataAvailability::NotAvailable, absl::nullopt}); + auto nested = TestDataInputBoolFactory(""); validateUnableToMatch(); } { - auto input = TestDataInputFactory("input", "127.0.0.1"); - auto nested = TestDataInputFactory( - "nested", {DataInputGetResult::DataAvailability::NotAvailable, absl::nullopt}); + auto input = TestDataInputStringFactory("127.0.0.1"); + auto nested = TestDataInputBoolFactory( + {DataInputGetResult::DataAvailability::NotAvailable, absl::nullopt}); validateUnableToMatch(); } } diff --git a/test/extensions/filters/http/decompressor/decompressor_filter_integration_test.cc b/test/extensions/filters/http/decompressor/decompressor_filter_integration_test.cc index 2aa2cf3d9a34..e05c68ee5e7d 100644 --- a/test/extensions/filters/http/decompressor/decompressor_filter_integration_test.cc +++ b/test/extensions/filters/http/decompressor/decompressor_filter_integration_test.cc @@ -289,8 +289,7 @@ TEST_P(DecompressorIntegrationTest, BidirectionalDecompressionError) { // Buffer the request after it's been decompressed. TEST_P(DecompressorIntegrationTest, DecompressAndBuffer) { - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.prependFilter(R"EOF( name: envoy.filters.http.decompressor diff --git a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc index 50c3802e71e3..36bc05d387a5 100644 --- a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -50,8 +50,7 @@ name: dynamic_forward_proxy config_helper_.prependFilter(fmt::format(R"EOF( name: stream-info-to-headers-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty)EOF")); +)EOF")); config_helper_.addConfigModifier([this](envoy::config::bootstrap::v3::Bootstrap& bootstrap) { // Switch predefined cluster_0 to CDS filesystem sourcing. bootstrap.mutable_dynamic_resources()->mutable_cds_config()->set_resource_api_version( @@ -232,8 +231,7 @@ TEST_P(ProxyFilterIntegrationTest, RequestWithBody) { config_helper_.prependFilter(fmt::format(R"EOF( name: stream-info-to-headers-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty)EOF")); +)EOF")); initializeWithArgs(); codec_client_ = makeHttpConnection(lookupPort("http")); diff --git a/test/extensions/filters/http/ext_authz/ext_authz.yaml b/test/extensions/filters/http/ext_authz/ext_authz.yaml index e9c0877180ef..19916536b4a3 100644 --- a/test/extensions/filters/http/ext_authz/ext_authz.yaml +++ b/test/extensions/filters/http/ext_authz/ext_authz.yaml @@ -38,7 +38,8 @@ static_resources: allow_partial_message: true pack_as_bytes: false - name: envoy.filters.http.router - typed_config: {} + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router clusters: - name: local_service connect_timeout: 30s diff --git a/test/extensions/filters/network/http_connection_manager/BUILD b/test/extensions/filters/network/http_connection_manager/BUILD index b5a251858339..438802a9a298 100644 --- a/test/extensions/filters/network/http_connection_manager/BUILD +++ b/test/extensions/filters/network/http_connection_manager/BUILD @@ -37,6 +37,7 @@ envoy_extension_cc_test_library( "//test/mocks/network:network_mocks", "//test/mocks/server:factory_context_mocks", "//test/test_common:registry_lib", + "//test/test_common:test_runtime_lib", ], ) diff --git a/test/extensions/filters/network/http_connection_manager/config_filter_chain_test.cc b/test/extensions/filters/network/http_connection_manager/config_filter_chain_test.cc index 3c0e659844a2..3569501b9ae6 100644 --- a/test/extensions/filters/network/http_connection_manager/config_filter_chain_test.cc +++ b/test/extensions/filters/network/http_connection_manager/config_filter_chain_test.cc @@ -38,6 +38,8 @@ stat_prefix: router http_filters: - name: encoder-decoder-buffer-filter - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; }; @@ -80,6 +82,8 @@ stat_prefix: router type_urls: - type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, date_provider_, route_config_provider_manager_, diff --git a/test/extensions/filters/network/http_connection_manager/config_test.cc b/test/extensions/filters/network/http_connection_manager/config_test.cc index f7a855aa7fa0..3b1107e16a21 100644 --- a/test/extensions/filters/network/http_connection_manager/config_test.cc +++ b/test/extensions/filters/network/http_connection_manager/config_test.cc @@ -103,6 +103,8 @@ stat_prefix: router cluster: cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - name: health_check typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck @@ -162,6 +164,8 @@ stat_prefix: router max_path_tag_length: 128 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -194,6 +198,8 @@ stat_prefix: router cluster: cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; #ifdef ENVOY_ENABLE_QUIC @@ -241,6 +247,8 @@ stat_prefix: router cluster: cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_, isQuicListener()).WillOnce(Return(true)); @@ -270,6 +278,8 @@ stat_prefix: router cluster: cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; // When tracing is not enabled on a given "envoy.filters.network.http_connection_manager" filter, @@ -302,6 +312,8 @@ stat_prefix: router cluster: cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; // Simulate tracer provider configuration in the bootstrap config. @@ -345,6 +357,8 @@ stat_prefix: router tracing: {} # notice that tracing is enabled http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; // When tracing is enabled on a given "envoy.filters.network.http_connection_manager" filter, @@ -378,6 +392,8 @@ stat_prefix: router tracing: {} # notice that tracing is enabled http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; // Simulate tracer provider configuration in the bootstrap config. @@ -427,6 +443,8 @@ stat_prefix: router collector_endpoint_version: HTTP_JSON http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; // Simulate tracer provider configuration in the bootstrap config. @@ -505,6 +523,8 @@ TEST_F(HttpConnectionManagerConfigTest, SamplingDefault) { tracing: {} http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -540,6 +560,8 @@ TEST_F(HttpConnectionManagerConfigTest, SamplingConfigured) { value: 3 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -574,6 +596,8 @@ TEST_F(HttpConnectionManagerConfigTest, FractionalSamplingConfigured) { value: 0.3 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -608,6 +632,8 @@ TEST_F(HttpConnectionManagerConfigTest, OverallSampling) { value: 0.1 http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -653,6 +679,8 @@ TEST_F(HttpConnectionManagerConfigTest, UnixSocketInternalAddress) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -711,6 +739,8 @@ TEST_F(HttpConnectionManagerConfigTest, MaxRequestHeadersKbDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -728,6 +758,8 @@ TEST_F(HttpConnectionManagerConfigTest, MaxRequestHeadersKbConfigured) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -745,6 +777,8 @@ TEST_F(HttpConnectionManagerConfigTest, MaxRequestHeadersKbMaxConfigurable) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -763,6 +797,8 @@ TEST_F(HttpConnectionManagerConfigTest, DisabledStreamIdleTimeout) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -782,6 +818,8 @@ TEST_F(HttpConnectionManagerConfigTest, CommonHttpProtocolIdleTimeout) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -799,6 +837,8 @@ TEST_F(HttpConnectionManagerConfigTest, CommonHttpProtocolIdleTimeoutDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -818,6 +858,8 @@ TEST_F(HttpConnectionManagerConfigTest, CommonHttpProtocolIdleTimeoutOff) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -835,6 +877,8 @@ TEST_F(HttpConnectionManagerConfigTest, DefaultMaxRequestHeaderCount) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -854,6 +898,8 @@ TEST_F(HttpConnectionManagerConfigTest, MaxRequestHeaderCountConfigurable) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -871,6 +917,8 @@ TEST_F(HttpConnectionManagerConfigTest, DefaultMaxRequestPerConnection) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -890,6 +938,8 @@ TEST_F(HttpConnectionManagerConfigTest, MaxRequestPerConnectionConfigurable) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -907,6 +957,8 @@ TEST_F(HttpConnectionManagerConfigTest, ServerOverwrite) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -928,6 +980,8 @@ TEST_F(HttpConnectionManagerConfigTest, ServerAppendIfAbsent) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -949,6 +1003,8 @@ TEST_F(HttpConnectionManagerConfigTest, ServerPassThrough) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -971,6 +1027,8 @@ TEST_F(HttpConnectionManagerConfigTest, SchemeOverwrite) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -992,6 +1050,8 @@ TEST_F(HttpConnectionManagerConfigTest, NormalizePathDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -1016,6 +1076,8 @@ TEST_F(HttpConnectionManagerConfigTest, NormalizePathRuntime) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -1040,6 +1102,8 @@ TEST_F(HttpConnectionManagerConfigTest, NormalizePathTrue) { normalize_path: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -1064,6 +1128,8 @@ TEST_F(HttpConnectionManagerConfigTest, NormalizePathFalse) { normalize_path: false http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -1087,6 +1153,8 @@ TEST_F(HttpConnectionManagerConfigTest, MergeSlashesDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1105,6 +1173,8 @@ TEST_F(HttpConnectionManagerConfigTest, MergeSlashesTrue) { merge_slashes: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1123,6 +1193,8 @@ TEST_F(HttpConnectionManagerConfigTest, MergeSlashesFalse) { merge_slashes: false http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1140,6 +1212,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemovePortDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1158,6 +1232,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemovePortTrue) { strip_matching_host_port: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1177,6 +1253,8 @@ TEST_F(HttpConnectionManagerConfigTest, BothStripOptionsAreSet) { strip_any_host_port: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_MESSAGE( @@ -1197,6 +1275,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemovePortFalse) { strip_matching_host_port: false http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1215,6 +1295,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemoveAnyPortTrue) { strip_any_host_port: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1233,6 +1315,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemoveAnyPortFalse) { strip_any_host_port: false http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1250,6 +1334,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemoveTrailingDotDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1268,6 +1354,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemoveTrailingDotTrue) { strip_trailing_host_dot: true http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1286,6 +1374,8 @@ TEST_F(HttpConnectionManagerConfigTest, RemoveTrailingDotFalse) { strip_trailing_host_dot: false http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1303,6 +1393,8 @@ TEST_F(HttpConnectionManagerConfigTest, HeadersWithUnderscoresAllowedByDefault) name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1323,6 +1415,8 @@ TEST_F(HttpConnectionManagerConfigTest, HeadersWithUnderscoresDroppedByConfig) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1343,6 +1437,8 @@ TEST_F(HttpConnectionManagerConfigTest, HeadersWithUnderscoresRequestRejectedByC name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1361,6 +1457,8 @@ TEST_F(HttpConnectionManagerConfigTest, ConfiguredRequestTimeout) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1378,6 +1476,8 @@ TEST_F(HttpConnectionManagerConfigTest, DisabledRequestTimeout) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1394,6 +1494,8 @@ TEST_F(HttpConnectionManagerConfigTest, UnconfiguredRequestTimeout) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1404,6 +1506,9 @@ TEST_F(HttpConnectionManagerConfigTest, UnconfiguredRequestTimeout) { } TEST_F(HttpConnectionManagerConfigTest, SingleDateProvider) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + const std::string yaml_string = R"EOF( codec_type: http1 stat_prefix: router @@ -1419,9 +1524,9 @@ stat_prefix: router cluster: cluster http_filters: - name: encoder-decoder-buffer-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; context_.server_factory_context_.cluster_manager_.initializeClusters({"cluster"}, {}); @@ -1568,6 +1673,8 @@ stat_prefix: my_stat_prefix cluster: fake_cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: hpack_table_size: 1024 custom_settings_parameters: { identifier: 3, value: 2048 } @@ -1629,6 +1736,8 @@ stat_prefix: my_stat_prefix cluster: fake_cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: custom_settings_parameters: - { identifier: 8, value: 0 } @@ -1652,6 +1761,8 @@ stat_prefix: my_stat_prefix cluster: fake_cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: allow_connect: true )EOF"; @@ -1731,6 +1842,8 @@ stat_prefix: my_stat_prefix cluster: fake_cluster http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router http2_protocol_options: custom_settings_parameters: - { identifier: 10, value: 0 } @@ -1751,6 +1864,8 @@ TEST_F(HttpConnectionManagerConfigTest, AlwaysSetRequestIdInResponseDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1768,6 +1883,8 @@ TEST_F(HttpConnectionManagerConfigTest, AlwaysSetRequestIdInResponseConfigured) name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1833,6 +1950,8 @@ TEST_F(HttpConnectionManagerConfigTest, CustomRequestIDExtension) { test_field: example http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; TestRequestIDExtensionFactory factory; @@ -1858,6 +1977,8 @@ TEST_F(HttpConnectionManagerConfigTest, UnknownRequestIDExtension) { "@type": type.googleapis.com/test.http_connection_manager.UnknownRequestIDExtension http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_REGEX(createHttpConnectionManagerConfig(yaml_string), EnvoyException, @@ -1875,7 +1996,7 @@ TEST_F(HttpConnectionManagerConfigTest, UnknownHttpFilterWithException) { EXPECT_THROW_WITH_REGEX( createHttpConnectionManagerConfig(yaml_string), EnvoyException, - "Didn't find a registered implementation for name: 'envoy.filters.http.unknown"); + "Didn't find a registered implementation for name: 'envoy.filters.http.unknown'"); } TEST_F(HttpConnectionManagerConfigTest, UnknownOptionalHttpFilterWithIgnore) { @@ -1898,6 +2019,8 @@ TEST_F(HttpConnectionManagerConfigTest, DefaultRequestIDExtension) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1923,6 +2046,8 @@ TEST_F(HttpConnectionManagerConfigTest, DefaultRequestIDExtensionWithParams) { use_request_id_for_trace_sampling: false http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -1947,6 +2072,8 @@ TEST_F(HttpConnectionManagerConfigTest, UnknownOriginalIPDetectionExtension) { "@type": type.googleapis.com/google.protobuf.StringValue http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_REGEX(createHttpConnectionManagerConfig(yaml_string), EnvoyException, @@ -1988,6 +2115,8 @@ TEST_F(HttpConnectionManagerConfigTest, OriginalIPDetectionExtensionNotCreated) "@type": type.googleapis.com/google.protobuf.UInt32Value http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_REGEX( @@ -2008,6 +2137,8 @@ TEST_F(HttpConnectionManagerConfigTest, OriginalIPDetectionExtension) { header_name: x-ip-header http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; HttpConnectionManagerConfig config(parseHttpConnectionManagerFromYaml(yaml_string), context_, @@ -2032,6 +2163,8 @@ TEST_F(HttpConnectionManagerConfigTest, OriginalIPDetectionExtensionMixedWithUse header_name: x-ip-header http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_REGEX( @@ -2052,6 +2185,8 @@ TEST_F(HttpConnectionManagerConfigTest, OriginalIPDetectionExtensionMixedWithNum header_name: x-ip-header http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_REGEX( @@ -2171,6 +2306,8 @@ stat_prefix: router type_urls: - type.googleapis.com/envoy.extensions.filters.http.router.v3.Router - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_MESSAGE(createHttpConnectionManagerConfig(yaml_string), EnvoyException, @@ -2202,6 +2339,8 @@ stat_prefix: router type_urls: - type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_MESSAGE( @@ -2234,6 +2373,8 @@ stat_prefix: router type_urls: - type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_THROW_WITH_MESSAGE( @@ -2294,6 +2435,8 @@ stat_prefix: router - type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck apply_default_config_without_warming: true - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; createHttpConnectionManagerConfig(yaml_string); @@ -2306,6 +2449,8 @@ TEST_F(HttpConnectionManagerConfigTest, PathWithEscapedSlashesActionDefault) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, @@ -2332,6 +2477,8 @@ TEST_F(HttpConnectionManagerConfigTest, PathWithEscapedSlashesActionDefaultOverr name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, @@ -2372,6 +2519,8 @@ TEST_F(HttpConnectionManagerConfigTest, name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, @@ -2401,6 +2550,8 @@ TEST_F(HttpConnectionManagerConfigTest, PathWithEscapedSlashesActionDefaultOverr name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -2433,6 +2584,8 @@ TEST_F(HttpConnectionManagerConfigTest, PathWithEscapedSlashesActionSetAndDisabl name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; EXPECT_CALL(context_.runtime_loader_.snapshot_, featureEnabled(_, An())) @@ -2502,6 +2655,8 @@ TEST_F(HttpConnectionManagerMobileConfigTest, Mobile) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router )EOF"; envoy::extensions::filters::network::http_connection_manager::v3::EnvoyMobileHttpConnectionManager diff --git a/test/extensions/filters/network/http_connection_manager/config_test_base.h b/test/extensions/filters/network/http_connection_manager/config_test_base.h index 9241da2bff89..5780599bff95 100644 --- a/test/extensions/filters/network/http_connection_manager/config_test_base.h +++ b/test/extensions/filters/network/http_connection_manager/config_test_base.h @@ -14,6 +14,7 @@ #include "test/mocks/network/mocks.h" #include "test/mocks/server/factory_context.h" #include "test/test_common/registry.h" +#include "test/test_common/test_runtime.h" #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -33,6 +34,10 @@ parseHttpConnectionManagerFromYaml(const std::string& yaml) { class HttpConnectionManagerConfigTest : public testing::Test { public: + HttpConnectionManagerConfigTest() { + scoped_runtime_.mergeValues( + {{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + } NiceMock context_; Http::SlowDateProviderImpl date_provider_{context_.mainThreadDispatcher().timeSource()}; NiceMock route_config_provider_manager_; @@ -41,6 +46,7 @@ class HttpConnectionManagerConfigTest : public testing::Test { Filter::HttpFilterConfigProviderManagerImpl filter_config_provider_manager_; std::shared_ptr> http_tracer_{ std::make_shared>()}; + TestScopedRuntime scoped_runtime_; void createHttpConnectionManagerConfig(const std::string& yaml) { HttpConnectionManagerConfig(parseHttpConnectionManagerFromYaml(yaml), context_, date_provider_, route_config_provider_manager_, diff --git a/test/extensions/filters/network/thrift_proxy/config_test.cc b/test/extensions/filters/network/thrift_proxy/config_test.cc index 99aaa0c03970..f46c666b6b52 100644 --- a/test/extensions/filters/network/thrift_proxy/config_test.cc +++ b/test/extensions/filters/network/thrift_proxy/config_test.cc @@ -142,6 +142,8 @@ stat_prefix: thrift cluster_header: A thrift_filters: - name: envoy.filters.thrift.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.router.v3.Router )EOF"; envoy::extensions::filters::network::thrift_proxy::v3::ThriftProxy config = @@ -161,6 +163,8 @@ stat_prefix: thrift name: local_route thrift_filters: - name: envoy.filters.thrift.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.router.v3.Router )EOF"; envoy::extensions::filters::network::thrift_proxy::v3::ThriftProxy config = @@ -177,6 +181,8 @@ stat_prefix: thrift thrift_filters: - name: no_such_filter - name: envoy.filters.thrift.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.router.v3.Router )EOF"; envoy::extensions::filters::network::thrift_proxy::v3::ThriftProxy config = @@ -199,6 +205,8 @@ stat_prefix: ingress value: key: value - name: envoy.filters.thrift.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.router.v3.Router )EOF"; ThriftFilters::MockFilterConfigFactory factory; @@ -222,6 +230,8 @@ payload_passthrough: true name: local_route thrift_filters: - name: envoy.filters.thrift.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.network.thrift_proxy.router.v3.Router )EOF"; envoy::extensions::filters::network::thrift_proxy::v3::ThriftProxy config = diff --git a/test/extensions/network/dns_resolver/apple/apple_dns_impl_test.cc b/test/extensions/network/dns_resolver/apple/apple_dns_impl_test.cc index 0476228605d0..c7b0a230b744 100644 --- a/test/extensions/network/dns_resolver/apple/apple_dns_impl_test.cc +++ b/test/extensions/network/dns_resolver/apple/apple_dns_impl_test.cc @@ -244,7 +244,8 @@ TEST_F(AppleDnsImplTest, MakeDnsResolverFactoryFromProtoTestInAppleWithInvalidTy config.mutable_typed_dns_resolver_config()->MergeFrom(typed_dns_resolver_config); EXPECT_THROW_WITH_MESSAGE( Envoy::Network::createDnsResolverFactoryFromProto(config, typed_dns_resolver_config), - Envoy::EnvoyException, "Didn't find a registered implementation for name: 'bar'"); + Envoy::EnvoyException, + "Didn't find a registered implementation for 'bar' with type URL: 'foo'"); } // Validate that when AppleDnsResolverImpl is destructed with outstanding requests, diff --git a/test/extensions/transport_sockets/alts/alts_integration_test.cc b/test/extensions/transport_sockets/alts/alts_integration_test.cc index 62a960272a8e..69305cdf0c66 100644 --- a/test/extensions/transport_sockets/alts/alts_integration_test.cc +++ b/test/extensions/transport_sockets/alts/alts_integration_test.cc @@ -117,8 +117,6 @@ class AltsIntegrationTestBase : public Event::TestUsingSimulatedTime, config_helper_.prependFilter(R"EOF( name: decode-dynamic-metadata-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); HttpIntegrationTest::initialize(); diff --git a/test/extensions/transport_sockets/tcp_stats/BUILD b/test/extensions/transport_sockets/tcp_stats/BUILD index 525b3d61ce8d..8f30f7285830 100644 --- a/test/extensions/transport_sockets/tcp_stats/BUILD +++ b/test/extensions/transport_sockets/tcp_stats/BUILD @@ -24,6 +24,7 @@ envoy_extension_cc_test( "//test/mocks/network:network_mocks", "//test/mocks/network:transport_socket_mocks", "//test/mocks/server:transport_socket_factory_context_mocks", + "@envoy_api//envoy/extensions/transport_sockets/raw_buffer/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/transport_sockets/tcp_stats/v3:pkg_cc_proto", ], ) diff --git a/test/extensions/transport_sockets/tcp_stats/tcp_stats_test.cc b/test/extensions/transport_sockets/tcp_stats/tcp_stats_test.cc index a00c207d9aea..4ba61492ce22 100644 --- a/test/extensions/transport_sockets/tcp_stats/tcp_stats_test.cc +++ b/test/extensions/transport_sockets/tcp_stats/tcp_stats_test.cc @@ -294,6 +294,7 @@ TEST_F(TcpStatsSocketFactoryTest, ImplementsSecureTransportCallInnerFactory) { #else // #if defined(__linux__) +#include "envoy/extensions/transport_sockets/raw_buffer/v3/raw_buffer.pb.h" #include "envoy/extensions/transport_sockets/tcp_stats/v3/tcp_stats.pb.h" #include "test/mocks/server/transport_socket_factory_context.h" @@ -309,6 +310,8 @@ namespace TcpStats { TEST(TcpStatsTest, ConfigErrorOnUnsupportedPlatform) { envoy::extensions::transport_sockets::tcp_stats::v3::Config proto_config; proto_config.mutable_transport_socket()->set_name("envoy.transport_sockets.raw_buffer"); + envoy::extensions::transport_sockets::raw_buffer::v3::RawBuffer raw_buffer; + proto_config.mutable_transport_socket()->mutable_typed_config()->PackFrom(raw_buffer); NiceMock context; envoy::config::core::v3::TransportSocket transport_socket_config; diff --git a/test/extensions/transport_sockets/tls/BUILD b/test/extensions/transport_sockets/tls/BUILD index 5c40298b8bc7..2cdd4047efe2 100644 --- a/test/extensions/transport_sockets/tls/BUILD +++ b/test/extensions/transport_sockets/tls/BUILD @@ -200,6 +200,7 @@ envoy_cc_test( "//test/mocks/ssl:ssl_mocks", "//test/mocks/stats:stats_mocks", "//test/test_common:registry_lib", + "//test/test_common:test_runtime_lib", ], ) diff --git a/test/extensions/transport_sockets/tls/handshaker_factory_test.cc b/test/extensions/transport_sockets/tls/handshaker_factory_test.cc index 0c0907c3e056..1e5230dbbf82 100644 --- a/test/extensions/transport_sockets/tls/handshaker_factory_test.cc +++ b/test/extensions/transport_sockets/tls/handshaker_factory_test.cc @@ -13,6 +13,7 @@ #include "test/mocks/network/connection.h" #include "test/mocks/server/transport_socket_factory_context.h" #include "test/test_common/registry.h" +#include "test/test_common/test_runtime.h" #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -93,6 +94,8 @@ class HandshakerFactoryTest : public testing::Test { : context_manager_( std::make_unique(time_system_)), registered_factory_(handshaker_factory_) { + scoped_runtime_.mergeValues( + {{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); // UpstreamTlsContext proto expects to use the newly-registered handshaker. envoy::config::core::v3::TypedExtensionConfig* custom_handshaker = tls_context_.mutable_common_tls_context()->mutable_custom_handshaker(); @@ -113,6 +116,7 @@ class HandshakerFactoryTest : public testing::Test { HandshakerFactoryImplForTest handshaker_factory_; Registry::InjectFactory registered_factory_; envoy::extensions::transport_sockets::tls::v3::UpstreamTlsContext tls_context_; + TestScopedRuntime scoped_runtime_; }; TEST_F(HandshakerFactoryTest, SetMockFunctionCb) { diff --git a/test/integration/BUILD b/test/integration/BUILD index e0920a7f6f44..097e702699ef 100644 --- a/test/integration/BUILD +++ b/test/integration/BUILD @@ -606,6 +606,11 @@ envoy_cc_test( ], ) +envoy_proto_library( + name = "test_host_predicate_proto", + srcs = ["test_host_predicate.proto"], +) + envoy_cc_test_library( name = "test_host_predicate_lib", srcs = [ @@ -613,6 +618,7 @@ envoy_cc_test_library( "test_host_predicate_config.h", ], deps = [ + ":test_host_predicate_proto_cc_proto", "//envoy/upstream:retry_interface", ], ) diff --git a/test/integration/base_integration_test.cc b/test/integration/base_integration_test.cc index 7a7a16b0858c..87f81c93f0f3 100644 --- a/test/integration/base_integration_test.cc +++ b/test/integration/base_integration_test.cc @@ -66,6 +66,9 @@ BaseIntegrationTest::BaseIntegrationTest(const InstanceConstSharedPtrFn& upstrea })); ON_CALL(factory_context_, api()).WillByDefault(ReturnRef(*api_)); ON_CALL(factory_context_, scope()).WillByDefault(ReturnRef(stats_store_)); + // Allow extension lookup by name in the integration tests. + config_helper_.addRuntimeOverride("envoy.reloadable_features.no_extension_lookup_by_name", + "false"); } BaseIntegrationTest::BaseIntegrationTest(Network::Address::IpVersion version, diff --git a/test/integration/base_overload_integration_test.cc b/test/integration/base_overload_integration_test.cc index 905339dd6d54..9c1f7bb3a9fd 100644 --- a/test/integration/base_overload_integration_test.cc +++ b/test/integration/base_overload_integration_test.cc @@ -13,7 +13,7 @@ void BaseOverloadIntegrationTest::setupOverloadManagerConfig( resource_monitors: - name: "envoy.resource_monitors.testonly.fake_resource_monitor" typed_config: - "@type": type.googleapis.com/google.protobuf.Empty + "@type": type.googleapis.com/test.common.config.DummyConfig )EOF"; overload_manager_config_ = TestUtility::parseYaml(overload_config); diff --git a/test/integration/cluster_upstream_extension_integration_test.cc b/test/integration/cluster_upstream_extension_integration_test.cc index 163d628a175b..0853bedb76d5 100644 --- a/test/integration/cluster_upstream_extension_integration_test.cc +++ b/test/integration/cluster_upstream_extension_integration_test.cc @@ -35,7 +35,8 @@ class ClusterUpstreamExtensionIntegrationTest config_helper_.addConfigModifier([this](envoy::config::bootstrap::v3::Bootstrap& bootstrap) { auto* cluster = bootstrap.mutable_static_resources()->mutable_clusters(0); cluster->mutable_upstream_config()->set_name("envoy.filters.connection_pools.http.per_host"); - cluster->mutable_upstream_config()->mutable_typed_config(); + cluster->mutable_upstream_config()->mutable_typed_config()->set_type_url( + "type.googleapis.com/google.protobuf.Struct"); populateMetadataTestData(*cluster->mutable_metadata(), "foo", "bar", "cluster-value"); populateMetadataTestData(*cluster->mutable_load_assignment() ->mutable_endpoints(0) diff --git a/test/integration/http_integration.cc b/test/integration/http_integration.cc index 9457f1a37736..02e0c1eec0cf 100644 --- a/test/integration/http_integration.cc +++ b/test/integration/http_integration.cc @@ -1113,8 +1113,6 @@ void HttpIntegrationTest::testTwoRequests(bool network_backup) { config_helper_.prependFilter( fmt::format(R"EOF( name: pause-filter{} - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF", downstreamProtocol() == Http::CodecType::HTTP3 ? "-for-quic" : "")); } @@ -1449,8 +1447,7 @@ void HttpIntegrationTest::simultaneousRequest(uint32_t request1_bytes, uint32_t uint32_t response1_bytes, uint32_t response2_bytes) { config_helper_.prependFilter(fmt::format(R"EOF( name: stream-info-to-headers-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty)EOF")); +)EOF")); FakeStreamPtr upstream_request1; FakeStreamPtr upstream_request2; diff --git a/test/integration/integration_test.cc b/test/integration/integration_test.cc index 2f895e48e654..57099e575b88 100644 --- a/test/integration/integration_test.cc +++ b/test/integration/integration_test.cc @@ -1575,8 +1575,7 @@ TEST_P(IntegrationTest, TestDelayedConnectionTeardownOnGracefulClose) { hcm) { hcm.mutable_delayed_close_timeout()->set_seconds(1); }); // This test will trigger an early 413 Payload Too Large response due to buffer limits being // exceeded. The following filter is needed since the router filter will never trigger a 413. - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.setBufferLimits(1024, 1024); initialize(); @@ -1608,8 +1607,7 @@ TEST_P(IntegrationTest, TestDelayedConnectionTeardownOnGracefulClose) { // Test configuration of the delayed close timeout on downstream HTTP/1.1 connections. A value of 0 // disables delayed close processing. TEST_P(IntegrationTest, TestDelayedConnectionTeardownConfig) { - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.setBufferLimits(1024, 1024); config_helper_.addConfigModifier( [](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager& @@ -1642,8 +1640,7 @@ TEST_P(IntegrationTest, TestDelayedConnectionTeardownConfig) { // Test that if the route cache is cleared, it doesn't cause problems. TEST_P(IntegrationTest, TestClearingRouteCacheFilter) { - config_helper_.prependFilter("{ name: clear-route-cache, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: clear-route-cache }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); sendRequestAndWaitForResponse(default_request_headers_, 0, default_response_headers_, 0); @@ -1680,8 +1677,7 @@ TEST_P(IntegrationTest, NoConnectionPoolsFree) { } TEST_P(IntegrationTest, ProcessObjectHealthy) { - config_helper_.prependFilter("{ name: process-context-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: process-context-filter }"); ProcessObjectForFilter healthy_object(true); process_object_ = healthy_object; @@ -1701,8 +1697,7 @@ TEST_P(IntegrationTest, ProcessObjectHealthy) { } TEST_P(IntegrationTest, ProcessObjectUnealthy) { - config_helper_.prependFilter("{ name: process-context-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: process-context-filter }"); ProcessObjectForFilter unhealthy_object(false); process_object_ = unhealthy_object; diff --git a/test/integration/multiplexed_integration_test.cc b/test/integration/multiplexed_integration_test.cc index 820ced3af732..366cc5ecd151 100644 --- a/test/integration/multiplexed_integration_test.cc +++ b/test/integration/multiplexed_integration_test.cc @@ -205,8 +205,6 @@ TEST_P(MultiplexedIntegrationTest, Http2DownstreamKeepalive) { static std::string response_metadata_filter = R"EOF( name: response-metadata-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"; class Http2MetadataIntegrationTest : public HttpProtocolIntegrationTest { @@ -696,8 +694,6 @@ TEST_P(Http2MetadataIntegrationTest, RequestMetadataThenTrailers) { static std::string request_metadata_filter = R"EOF( name: request-metadata-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"; TEST_P(Http2MetadataIntegrationTest, ConsumeAndInsertRequestMetadata) { @@ -886,8 +882,6 @@ void Http2MetadataIntegrationTest::testRequestMetadataWithStopAllFilter() { static std::string metadata_stop_all_filter = R"EOF( name: metadata-stop-all-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"; TEST_P(Http2MetadataIntegrationTest, RequestMetadataWithStopAllFilterBeforeMetadataFilter) { @@ -2008,8 +2002,6 @@ TEST_P(Http2MetadataIntegrationTest, UpstreamMetadataAfterEndStream) { static std::string on_local_reply_filter = R"EOF( name: on-local-reply-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"; TEST_P(MultiplexedIntegrationTest, OnLocalReply) { diff --git a/test/integration/multiplexed_upstream_integration_test.cc b/test/integration/multiplexed_upstream_integration_test.cc index 10e8b314d42c..feb98f022561 100644 --- a/test/integration/multiplexed_upstream_integration_test.cc +++ b/test/integration/multiplexed_upstream_integration_test.cc @@ -113,8 +113,7 @@ TEST_P(MultiplexedUpstreamIntegrationTest, TestSchemeAndXFP) { void MultiplexedUpstreamIntegrationTest::bidirectionalStreaming(uint32_t bytes) { config_helper_.prependFilter(fmt::format(R"EOF( name: stream-info-to-headers-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty)EOF")); +)EOF")); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -353,8 +352,7 @@ TEST_P(MultiplexedUpstreamIntegrationTest, ManyLargeSimultaneousRequestWithRando } config_helper_.prependFilter(R"EOF( name: random-pause-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty)EOF"); +)EOF"); manySimultaneousRequests(1024 * 20, 1024 * 20); } @@ -447,8 +445,7 @@ name: router // As with ProtocolIntegrationTest.HittingEncoderFilterLimit use a filter // which buffers response data but in this case, make sure the sendLocalReply // is gRPC. - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.setBufferLimits(1024, 1024); initialize(); diff --git a/test/integration/protocol_integration_test.cc b/test/integration/protocol_integration_test.cc index eabdddfc0180..36410a5e5299 100644 --- a/test/integration/protocol_integration_test.cc +++ b/test/integration/protocol_integration_test.cc @@ -266,8 +266,6 @@ TEST_P(ProtocolIntegrationTest, AddBodyToResponseAndWaitForIt) { TEST_P(ProtocolIntegrationTest, ContinueHeadersOnlyInjectBodyFilter) { config_helper_.prependFilter(R"EOF( name: continue-headers-only-inject-body-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); initialize(); @@ -294,8 +292,6 @@ TEST_P(ProtocolIntegrationTest, ContinueHeadersOnlyInjectBodyFilter) { TEST_P(ProtocolIntegrationTest, StopIterationHeadersInjectBodyFilter) { config_helper_.prependFilter(R"EOF( name: stop-iteration-headers-inject-body-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); initialize(); @@ -322,8 +318,6 @@ TEST_P(ProtocolIntegrationTest, StopIterationHeadersInjectBodyFilter) { TEST_P(ProtocolIntegrationTest, AddEncodedTrailers) { config_helper_.prependFilter(R"EOF( name: add-trailers-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); initialize(); @@ -485,8 +479,7 @@ TEST_P(DownstreamProtocolIntegrationTest, DownstreamRequestWithFaultyFilter) { autonomous_upstream_ = true; } useAccessLog("%RESPONSE_CODE_DETAILS%"); - config_helper_.prependFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -530,8 +523,7 @@ TEST_P(DownstreamProtocolIntegrationTest, FaultyFilterWithConnect) { downstreamProtocol() == Http::CodecType::HTTP3); }); useAccessLog("%RESPONSE_CODE_DETAILS%"); - config_helper_.prependFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -549,8 +541,7 @@ TEST_P(DownstreamProtocolIntegrationTest, FaultyFilterWithConnect) { TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReply) { useAccessLog("%RESPONSE_CODE_DETAILS%"); - config_helper_.prependFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -571,8 +562,7 @@ TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReply) { TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyDownstreamBytesCount) { useAccessLog("%DOWNSTREAM_WIRE_BYTES_SENT% %DOWNSTREAM_WIRE_BYTES_RECEIVED% " "%DOWNSTREAM_HEADER_BYTES_SENT% %DOWNSTREAM_HEADER_BYTES_RECEIVED%"); - config_helper_.addFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.addFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -595,8 +585,7 @@ TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyDownstreamByte TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyUpstreamBytesCount) { useAccessLog("%UPSTREAM_WIRE_BYTES_SENT% %UPSTREAM_WIRE_BYTES_RECEIVED% " "%UPSTREAM_HEADER_BYTES_SENT% %UPSTREAM_HEADER_BYTES_RECEIVED%"); - config_helper_.addFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.addFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -618,8 +607,7 @@ TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyUpstreamBytesC TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyWithBody) { useAccessLog("%RESPONSE_CODE_DETAILS%"); - config_helper_.prependFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -641,8 +629,7 @@ TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyWithBody) { TEST_P(DownstreamProtocolIntegrationTest, MissingHeadersLocalReplyWithBodyBytesCount) { useAccessLog("%DOWNSTREAM_WIRE_BYTES_SENT% %DOWNSTREAM_WIRE_BYTES_RECEIVED% " "%DOWNSTREAM_HEADER_BYTES_SENT% %DOWNSTREAM_HEADER_BYTES_RECEIVED%"); - config_helper_.addFilter("{ name: invalid-header-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.addFilter("{ name: invalid-header-filter }"); initialize(); codec_client_ = makeHttpConnection(lookupPort("http")); @@ -1185,8 +1172,7 @@ TEST_P(ProtocolIntegrationTest, RetryHittingRouteLimits) { // Test hitting the decoder buffer filter with too many request bytes to buffer. Ensure the // connection manager sends a 413. TEST_P(DownstreamProtocolIntegrationTest, HittingDecoderFilterLimit) { - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.setBufferLimits(1024, 1024); initialize(); @@ -1228,8 +1214,7 @@ TEST_P(ProtocolIntegrationTest, HittingEncoderFilterLimit) { }); useAccessLog(); - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.setBufferLimits(1024, 1024); initialize(); @@ -2405,8 +2390,7 @@ TEST_P(ProtocolIntegrationTest, MultipleCookiesAndSetCookies) { // Test that delay closed connections are eventually force closed when the timeout triggers. TEST_P(DownstreamProtocolIntegrationTest, TestDelayedConnectionTeardownTimeoutTrigger) { - config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.prependFilter("{ name: encoder-decoder-buffer-filter }"); config_helper_.setBufferLimits(1024, 1024); config_helper_.addConfigModifier( [](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager& @@ -2805,8 +2789,6 @@ TEST_P(DownstreamProtocolIntegrationTest, HeaderNormalizationRejection) { TEST_P(DownstreamProtocolIntegrationTest, LocalReplyWithMetadata) { config_helper_.prependFilter(R"EOF( name: local-reply-with-metadata-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); initialize(); @@ -2875,8 +2857,6 @@ TEST_P(DownstreamProtocolIntegrationTest, DisableStripTrailingHostDot) { static std::string remove_response_headers_filter = R"EOF( name: remove-response-headers-filter -typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"; TEST_P(ProtocolIntegrationTest, HeadersOnlyRequestWithRemoveResponseHeadersFilter) { @@ -3533,8 +3513,7 @@ TEST_P(ProtocolIntegrationTest, BufferContinue) { }); useAccessLog(); - config_helper_.addFilter("{ name: buffer-continue-filter, typed_config: { \"@type\": " - "type.googleapis.com/google.protobuf.Empty } }"); + config_helper_.addFilter("{ name: buffer-continue-filter }"); config_helper_.setBufferLimits(1024, 1024); initialize(); @@ -3696,8 +3675,6 @@ TEST_P(ProtocolIntegrationTest, HandleUpstreamSocketFail) { TEST_P(ProtocolIntegrationTest, NoLocalInterfaceNameForUpstreamConnection) { config_helper_.prependFilter(R"EOF( name: stream-info-to-headers-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); initialize(); @@ -3723,8 +3700,6 @@ TEST_P(ProtocolIntegrationTest, NoLocalInterfaceNameForUpstreamConnection) { TEST_P(ProtocolIntegrationTest, LocalInterfaceNameForUpstreamConnection) { config_helper_.prependFilter(R"EOF( name: stream-info-to-headers-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); config_helper_.addConfigModifier([](envoy::config::bootstrap::v3::Bootstrap& bootstrap) { diff --git a/test/integration/redirect_integration_test.cc b/test/integration/redirect_integration_test.cc index a40fe7f392f2..8a29fe245917 100644 --- a/test/integration/redirect_integration_test.cc +++ b/test/integration/redirect_integration_test.cc @@ -611,8 +611,6 @@ TEST_P(RedirectIntegrationTest, InternalRedirectToDestinationWithResponseBody) { hcm) { hcm.set_via("via_value"); }); config_helper_.prependFilter(R"EOF( name: pause-filter - typed_config: - "@type": type.googleapis.com/google.protobuf.Empty )EOF"); initialize(); diff --git a/test/integration/test_host_predicate.proto b/test/integration/test_host_predicate.proto new file mode 100644 index 000000000000..50e7de301dec --- /dev/null +++ b/test/integration/test_host_predicate.proto @@ -0,0 +1,6 @@ +syntax = "proto3"; + +package test.integration; + +message TestHostPredicate { +} diff --git a/test/integration/test_host_predicate_config.h b/test/integration/test_host_predicate_config.h index d06a0339764d..fd82aa4463db 100644 --- a/test/integration/test_host_predicate_config.h +++ b/test/integration/test_host_predicate_config.h @@ -3,6 +3,8 @@ #include "envoy/upstream/retry.h" #include "test/integration/test_host_predicate.h" +#include "test/integration/test_host_predicate.pb.h" +#include "test/integration/test_host_predicate.pb.validate.h" #include "gmock/gmock.h" @@ -16,9 +18,7 @@ class TestHostPredicateFactory : public Upstream::RetryHostPredicateFactory { return std::make_shared>(); } ProtobufTypes::MessagePtr createEmptyConfigProto() override { - // Using Struct instead of a custom per-filter empty config proto - // This is only allowed in tests. - return ProtobufTypes::MessagePtr{new Envoy::ProtobufWkt::Struct()}; + return ProtobufTypes::MessagePtr{new ::test::integration::TestHostPredicate()}; } }; } // namespace Envoy diff --git a/test/integration/typed_metadata_integration_test.cc b/test/integration/typed_metadata_integration_test.cc index b5aac630c186..bf97e1e3ebad 100644 --- a/test/integration/typed_metadata_integration_test.cc +++ b/test/integration/typed_metadata_integration_test.cc @@ -26,10 +26,7 @@ TEST_P(ListenerTypedMetadataIntegrationTest, Hello) { // Add the filter that reads the listener typed metadata. config_helper_.addFilter(R"EOF({ - name: listener-typed-metadata-filter, - typed_config: { - "@type": type.googleapis.com/google.protobuf.Empty - } + name: listener-typed-metadata-filter })EOF"); initialize(); diff --git a/test/server/BUILD b/test/server/BUILD index a0a0dbb62815..c507b61a9640 100644 --- a/test/server/BUILD +++ b/test/server/BUILD @@ -213,6 +213,7 @@ envoy_cc_test( "//test/mocks/stats:stats_mocks", "//test/test_common:registry_lib", "//test/test_common:simulated_time_system_lib", + "//test/test_common:test_runtime_lib", "//test/test_common:utility_lib", ], ) @@ -253,6 +254,7 @@ envoy_cc_test( "//test/mocks/server:options_mocks", "//test/mocks/thread_local:thread_local_mocks", "//test/test_common:registry_lib", + "//test/test_common:test_runtime_lib", "//test/test_common:utility_lib", "@envoy_api//envoy/config/overload/v3:pkg_cc_proto", ], @@ -455,6 +457,7 @@ envoy_cc_test( "//test/test_common:logging_lib", "//test/test_common:registry_lib", "//test/test_common:simulated_time_system_lib", + "//test/test_common:test_runtime_lib", "//test/test_common:test_time_lib", "//test/test_common:utility_lib", "@envoy_api//envoy/config/core/v3:pkg_cc_proto", diff --git a/test/server/config_validation/BUILD b/test/server/config_validation/BUILD index 08473a7a3d87..d4fa2f33beba 100644 --- a/test/server/config_validation/BUILD +++ b/test/server/config_validation/BUILD @@ -116,6 +116,7 @@ envoy_cc_test_library( "@envoy_api//envoy/config/endpoint/v3:pkg_cc_proto", "@envoy_api//envoy/config/listener/v3:pkg_cc_proto", "@envoy_api//envoy/config/route/v3:pkg_cc_proto", + "@envoy_api//envoy/extensions/filters/http/router/v3:pkg_cc_proto", "@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto", ], ) diff --git a/test/server/config_validation/xds_verifier.h b/test/server/config_validation/xds_verifier.h index 69425f1cd403..62406bf28885 100644 --- a/test/server/config_validation/xds_verifier.h +++ b/test/server/config_validation/xds_verifier.h @@ -6,6 +6,7 @@ #include "envoy/config/endpoint/v3/endpoint.pb.h" #include "envoy/config/listener/v3/listener.pb.h" #include "envoy/config/route/v3/route.pb.h" +#include "envoy/extensions/filters/http/router/v3/router.pb.h" #include "envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.pb.h" #include "source/common/common/assert.h" diff --git a/test/server/configuration_impl_test.cc b/test/server/configuration_impl_test.cc index c2ee9097440e..4f145c1e74ae 100644 --- a/test/server/configuration_impl_test.cc +++ b/test/server/configuration_impl_test.cc @@ -435,7 +435,8 @@ TEST_F(ConfigurationImplTest, ConfigurationFailsWhenInvalidTracerSpecified) { MainImpl config; EXPECT_THROW_WITH_MESSAGE(config.initialize(bootstrap, server_, cluster_manager_factory_), EnvoyException, - "Didn't find a registered implementation for name: 'invalid'"); + "Didn't find a registered implementation for 'invalid' with type URL: " + "'envoy.config.trace.v2.BlackHoleConfig'"); } TEST_F(ConfigurationImplTest, ProtoSpecifiedStatsSink) { @@ -511,9 +512,9 @@ TEST_F(ConfigurationImplTest, StatsSinkWithInvalidName) { sink.set_name("envoy.invalid"); MainImpl config; - EXPECT_THROW_WITH_MESSAGE(config.initialize(bootstrap, server_, cluster_manager_factory_), - EnvoyException, - "Didn't find a registered implementation for name: 'envoy.invalid'"); + EXPECT_THROW_WITH_MESSAGE( + config.initialize(bootstrap, server_, cluster_manager_factory_), EnvoyException, + "Didn't find a registered implementation for 'envoy.invalid' with type URL: ''"); } TEST_F(ConfigurationImplTest, StatsSinkWithNoName) { @@ -550,7 +551,7 @@ TEST_F(ConfigurationImplTest, StatsSinkWithNoName) { MainImpl config; EXPECT_THROW_WITH_MESSAGE(config.initialize(bootstrap, server_, cluster_manager_factory_), EnvoyException, - "Provided name for static registration lookup was empty."); + "Didn't find a registered implementation for '' with type URL: ''"); } TEST_F(ConfigurationImplTest, StatsSinkWithNoType) { @@ -591,7 +592,7 @@ TEST_F(ConfigurationImplTest, StatsSinkWithNoType) { MainImpl config; EXPECT_THROW_WITH_MESSAGE(config.initialize(bootstrap, server_, cluster_manager_factory_), EnvoyException, - "Provided name for static registration lookup was empty."); + "Didn't find a registered implementation for '' with type URL: ''"); } // An explicit non-empty LayeredRuntime is available to the server with no diff --git a/test/server/guarddog_impl_test.cc b/test/server/guarddog_impl_test.cc index f3ed70f23015..76030ff62707 100644 --- a/test/server/guarddog_impl_test.cc +++ b/test/server/guarddog_impl_test.cc @@ -22,6 +22,7 @@ #include "test/mocks/stats/mocks.h" #include "test/test_common/registry.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_runtime.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" @@ -542,17 +543,17 @@ class GuardDogActionsTest : public GuardDogTestBase { protected: GuardDogActionsTest() : log_factory_("LogFactory", events_), register_log_factory_(log_factory_), - assert_factory_("AssertFactory"), register_assert_factory_(assert_factory_) {} + assert_factory_("AssertFactory"), register_assert_factory_(assert_factory_) { + scoped_runtime_.mergeValues( + {{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + } std::vector getActionsConfig() { return { R"EOF( { "config": { - "name": "AssertFactory", - "typed_config": { - "@type": "type.googleapis.com/google.protobuf.Empty" - } + "name": "AssertFactory" }, "event": "MULTIKILL" } @@ -560,10 +561,7 @@ class GuardDogActionsTest : public GuardDogTestBase { R"EOF( { "config": { - "name": "AssertFactory", - "typed_config": { - "@type": "type.googleapis.com/google.protobuf.Empty" - } + "name": "AssertFactory" }, "event": "KILL" } @@ -571,10 +569,7 @@ class GuardDogActionsTest : public GuardDogTestBase { R"EOF( { "config": { - "name": "LogFactory", - "typed_config": { - "@type": "type.googleapis.com/google.protobuf.Empty" - } + "name": "LogFactory" }, "event": "MEGAMISS" } @@ -582,10 +577,7 @@ class GuardDogActionsTest : public GuardDogTestBase { R"EOF( { "config": { - "name": "LogFactory", - "typed_config": { - "@type": "type.googleapis.com/google.protobuf.Empty" - } + "name": "LogFactory" }, "event": "MISS" } @@ -607,6 +599,7 @@ class GuardDogActionsTest : public GuardDogTestBase { NiceMock fake_stats_; WatchDogSharedPtr first_dog_; WatchDogSharedPtr second_dog_; + TestScopedRuntime scoped_runtime_; }; INSTANTIATE_TEST_SUITE_P(TimeSystemType, GuardDogActionsTest, diff --git a/test/server/listener_manager_impl_quic_only_test.cc b/test/server/listener_manager_impl_quic_only_test.cc index c60143bada35..8ad549a3a5e8 100644 --- a/test/server/listener_manager_impl_quic_only_test.cc +++ b/test/server/listener_manager_impl_quic_only_test.cc @@ -46,6 +46,8 @@ TEST_F(ListenerManagerImplQuicOnlyTest, QuicListenerFactoryAndSslContext) { name: local_route http_filters: - name: envoy.filters.http.router + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router transport_socket: name: envoy.transport_sockets.quic typed_config: diff --git a/test/server/listener_manager_impl_test.cc b/test/server/listener_manager_impl_test.cc index 05db3f9dd44c..f3a7590c7858 100644 --- a/test/server/listener_manager_impl_test.cc +++ b/test/server/listener_manager_impl_test.cc @@ -446,6 +446,9 @@ class NonTerminalFilterFactory : public Configuration::NamedNetworkFilterConfigF }; TEST_F(ListenerManagerImplWithRealFiltersTest, TerminalNotLast) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + NonTerminalFilterFactory filter; Registry::InjectFactory registered(filter); @@ -498,9 +501,9 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, BadFilterName) { - name: invalid )EOF"; - EXPECT_THROW_WITH_MESSAGE(manager_->addOrUpdateListener(parseListenerFromV3Yaml(yaml), "", true), - EnvoyException, - "Didn't find a registered implementation for name: 'invalid'"); + EXPECT_THROW_WITH_MESSAGE( + manager_->addOrUpdateListener(parseListenerFromV3Yaml(yaml), "", true), EnvoyException, + "Didn't find a registered implementation for 'invalid' with type URL: ''"); } class TestStatsConfigFactory : public Configuration::NamedNetworkFilterConfigFactory { @@ -533,6 +536,9 @@ class TestStatsConfigFactory : public Configuration::NamedNetworkFilterConfigFac }; TEST_F(ListenerManagerImplWithRealFiltersTest, StatsScopeTest) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + TestStatsConfigFactory filter; Registry::InjectFactory registered(filter); @@ -3356,7 +3362,6 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, MultipleFilterChainsWithDirectSou - name: "envoy.filters.listener.test" typed_config: "@type": type.googleapis.com/google.protobuf.Struct - typed_config: {} filter_chains: - filter_chain_match: # empty @@ -4101,6 +4106,8 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, Metadata) { route: { cluster: service_foo } listener_filters: - name: "envoy.filters.listener.original_dst" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst )EOF", Network::Address::IpVersion::v4); Configuration::ListenerFactoryContext* listener_factory_context = nullptr; @@ -4133,6 +4140,8 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstFilterWin32NoTrafficDi filter_chains: {} listener_filters: - name: "envoy.filters.listener.original_dst" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst )EOF", Network::Address::IpVersion::v4); @@ -4153,6 +4162,8 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstFilterWin32NoFeatureSu traffic_direction: INBOUND listener_filters: - name: "envoy.filters.listener.original_dst" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst )EOF", Network::Address::IpVersion::v4); EXPECT_THROW_WITH_MESSAGE(manager_->addOrUpdateListener(parseListenerFromV3Yaml(yaml), "", true); @@ -4171,6 +4182,8 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstFilter) { traffic_direction: INBOUND listener_filters: - name: "envoy.filters.listener.original_dst" + typed_config: + "@type": type.googleapis.com/envoy.extensions.filters.listener.original_dst.v3.OriginalDst )EOF", Network::Address::IpVersion::v4); EXPECT_CALL(server_.api_.random_, uuid()); @@ -4243,6 +4256,9 @@ class OriginalDstTestConfigFactory : public Configuration::NamedListenerFilterCo }; TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstTestFilterOutbound) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + #ifdef SOL_IP OriginalDstTestConfigFactory factory; Registry::InjectFactory registration(factory); @@ -4298,6 +4314,9 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstTestFilterOutbound) { } TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstFilterStopsIteration) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + #if defined(WIN32) && defined(SOL_IP) OriginalDstTestConfigFactory factory; Registry::InjectFactory registration(factory); @@ -4348,6 +4367,9 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstFilterStopsIteration) } TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstTestFilterInbound) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + #ifdef SOL_IP OriginalDstTestConfigFactory factory; Registry::InjectFactory registration(factory); @@ -4431,6 +4453,8 @@ TEST_F(ListenerManagerImplWithRealFiltersTest, OriginalDstTestFilterIPv6) { std::string name() const override { return "test.listener.original_dstipv6"; } }; + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); OriginalDstTestConfigFactory factory; Registry::InjectFactory registration(factory); @@ -5300,7 +5324,6 @@ per_connection_buffer_limit_bytes: 10 filter_chains: - filters: - name: fake - typed_config: {} )EOF"; ListenerHandle* listener_baz_update1 = expectListenerCreate(true, true); diff --git a/test/server/overload_manager_impl_test.cc b/test/server/overload_manager_impl_test.cc index 34268ecb7690..d7a15956bfbc 100644 --- a/test/server/overload_manager_impl_test.cc +++ b/test/server/overload_manager_impl_test.cc @@ -18,6 +18,7 @@ #include "test/mocks/server/options.h" #include "test/mocks/thread_local/mocks.h" #include "test/test_common/registry.h" +#include "test/test_common/test_runtime.h" #include "test/test_common/utility.h" #include "gmock/gmock.h" @@ -206,7 +207,10 @@ class OverloadManagerImplTest : public testing::Test { factory5_("envoy.resource_monitors.global_downstream_max_connections"), register_factory1_(factory1_), register_factory2_(factory2_), register_factory3_(factory3_), register_factory4_(factory4_), register_factory5_(factory5_), - api_(Api::createApiForTest(stats_)) {} + api_(Api::createApiForTest(stats_)) { + scoped_runtime_.mergeValues( + {{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + } void setDispatcherExpectation() { timer_ = new NiceMock(); @@ -246,6 +250,7 @@ class OverloadManagerImplTest : public testing::Test { NiceMock validation_visitor_; Api::ApiPtr api_; Server::MockOptions options_; + TestScopedRuntime scoped_runtime_; }; constexpr char kRegularStateConfig[] = R"YAML( diff --git a/test/server/server_test.cc b/test/server/server_test.cc index 796bc69d4fcd..875ad9b03fa7 100644 --- a/test/server/server_test.cc +++ b/test/server/server_test.cc @@ -31,6 +31,7 @@ #include "test/test_common/logging.h" #include "test/test_common/registry.h" #include "test/test_common/simulated_time_system.h" +#include "test/test_common/test_runtime.h" #include "test/test_common/test_time.h" #include "test/test_common/utility.h" @@ -438,6 +439,9 @@ TEST_P(ServerInstanceImplTest, WithCustomInlineHeaders) { // Validates that server stats are flushed even when server is stuck with initialization. TEST_P(ServerInstanceImplTest, StatsFlushWhenServerIsStillInitializing) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + CustomStatsSinkFactory factory; Registry::InjectFactory registered(factory); @@ -785,6 +789,9 @@ TEST_P(ServerStatsTest, FlushStats) { } TEST_P(ServerInstanceImplTest, FlushStatsOnAdmin) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + CustomStatsSinkFactory factory; Registry::InjectFactory registered(factory); auto server_thread = @@ -811,6 +818,9 @@ TEST_P(ServerInstanceImplTest, FlushStatsOnAdmin) { } TEST_P(ServerInstanceImplTest, ConcurrentFlushes) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + CustomStatsSinkFactory factory; Registry::InjectFactory registered(factory); @@ -1393,9 +1403,10 @@ TEST_P(ServerInstanceImplTest, WithBootstrapExtensionsThrowingError) { } TEST_P(ServerInstanceImplTest, WithUnknownBootstrapExtensions) { - EXPECT_THROW_WITH_REGEX( - initialize("test/server/test_data/server/bootstrap_extensions.yaml"), EnvoyException, - "Didn't find a registered implementation for name: 'envoy_test.bootstrap.foo'"); + EXPECT_THROW_WITH_REGEX(initialize("test/server/test_data/server/bootstrap_extensions.yaml"), + EnvoyException, + "Didn't find a registered implementation for 'envoy_test.bootstrap.foo' " + "with type URL: 'test.common.config.DummyConfig'"); } // Insufficient support on Windows. @@ -1568,6 +1579,9 @@ class CallbacksStatsSinkFactory : public Server::Configuration::StatsSinkFactory // lifecycle callback is also used to ensure that the cluster update callback is freed during // Server::Instance's destruction. See issue #9292 for more details. TEST_P(ServerInstanceImplTest, CallbacksStatsSinkTest) { + TestScopedRuntime scoped_runtime; + scoped_runtime.mergeValues({{"envoy.reloadable_features.no_extension_lookup_by_name", "false"}}); + CallbacksStatsSinkFactory factory; Registry::InjectFactory registered(factory);