Skip to content

Commit 9ed9516

Browse files
authored
api: add field to allow clients to ignore unknown HTTP filters (#14982)
This allows control planes to tell clients that a given HTTP filter is okay to ignore if it is not supported. This is useful in environments where the clients are not centrally controlled and therefore cannot be upgraded at will, where it is desirable to start using a new filter for clients that do support the new filter without breaking older clients. Unlike a client-capability-based approach, where the client tells the server which filters it supports, this avoids cache pollution and resource-name-based complexity on the server. And because the control plane can set this on a per-filter basis, this approach does not impose risk that clients will silently fail to apply filters that provide mandatory functionality (e.g., authz policies). Risk Level: Low Testing: N/A (actual functionality will be implemented in a subsequent PR) Docs Changes: Included in PR Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Mark D. Roth <roth@google.com>
1 parent 5b3bc84 commit 9ed9516

File tree

9 files changed

+138
-4
lines changed

9 files changed

+138
-4
lines changed

api/envoy/config/route/v3/route_components.proto

+26
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ message VirtualHost {
138138
// *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter
139139
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
140140
// for if and how it is utilized.
141+
// [#comment: An entry's value may be wrapped in a
142+
// :ref:`FilterConfig<envoy_api_msg_config.route.v3.FilterConfig>`
143+
// message to specify additional options.]
141144
map<string, google.protobuf.Any> typed_per_filter_config = 15;
142145

143146
// Decides whether the :ref:`x-envoy-attempt-count
@@ -248,6 +251,9 @@ message Route {
248251
// *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter
249252
// specific; see the :ref:`HTTP filter documentation <config_http_filters>` for
250253
// if and how it is utilized.
254+
// [#comment: An entry's value may be wrapped in a
255+
// :ref:`FilterConfig<envoy_api_msg_config.route.v3.FilterConfig>`
256+
// message to specify additional options.]
251257
map<string, google.protobuf.Any> typed_per_filter_config = 13;
252258

253259
// Specifies a set of headers that will be added to requests matching this
@@ -362,6 +368,9 @@ message WeightedCluster {
362368
// *envoy.filters.http.buffer* for the HTTP buffer filter. Use of this field is filter
363369
// specific; see the :ref:`HTTP filter documentation <config_http_filters>`
364370
// for if and how it is utilized.
371+
// [#comment: An entry's value may be wrapped in a
372+
// :ref:`FilterConfig<envoy_api_msg_config.route.v3.FilterConfig>`
373+
// message to specify additional options.]
365374
map<string, google.protobuf.Any> typed_per_filter_config = 10;
366375
}
367376

@@ -1944,3 +1953,20 @@ message InternalRedirectPolicy {
19441953
// x-forwarded-proto. The default is false.
19451954
bool allow_cross_scheme_redirect = 4;
19461955
}
1956+
1957+
// A simple wrapper for an HTTP filter config. This is intended to be used as a wrapper for the
1958+
// map value in
1959+
// :ref:`VirtualHost.typed_per_filter_config<envoy_api_field_config.route.v3.VirtualHost.typed_per_filter_config>`,
1960+
// :ref:`Route.typed_per_filter_config<envoy_api_field_config.route.v3.Route.typed_per_filter_config>`,
1961+
// or :ref:`WeightedCluster.ClusterWeight.typed_per_filter_config<envoy_api_field_config.route.v3.WeightedCluster.ClusterWeight.typed_per_filter_config>`
1962+
// to add additional flags to the filter.
1963+
// [#not-implemented-hide:]
1964+
message FilterConfig {
1965+
// The filter config.
1966+
google.protobuf.Any config = 1;
1967+
1968+
// If true, the filter is optional, meaning that if the client does
1969+
// not support the specified filter, it may ignore the map entry rather
1970+
// than rejecting the config.
1971+
bool is_optional = 2;
1972+
}

api/envoy/config/route/v4alpha/route_components.proto

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto

+7-1
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ message ScopedRds {
816816
[(validate.rules).message = {required: true}];
817817
}
818818

819-
// [#next-free-field: 6]
819+
// [#next-free-field: 7]
820820
message HttpFilter {
821821
option (udpa.annotations.versioning).previous_message_type =
822822
"envoy.config.filter.network.http_connection_manager.v2.HttpFilter";
@@ -840,6 +840,12 @@ message HttpFilter {
840840
// Extension configs delivered through this mechanism are not expected to require warming (see https://github.com/envoyproxy/envoy/issues/12061).
841841
config.core.v3.ExtensionConfigSource config_discovery = 5;
842842
}
843+
844+
// If true, clients that do not support this filter may ignore the
845+
// filter but otherwise accept the config.
846+
// Otherwise, clients that do not support this filter must reject the config.
847+
// [#not-implemented-hide:]
848+
bool is_optional = 6;
843849
}
844850

845851
message RequestIDExtension {

api/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated_api_shadow/BUILD

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ proto_library(
164164
"//envoy/extensions/common/matching/v3:pkg",
165165
"//envoy/extensions/common/ratelimit/v3:pkg",
166166
"//envoy/extensions/common/tap/v3:pkg",
167+
"//envoy/extensions/compression/brotli/compressor/v3:pkg",
168+
"//envoy/extensions/compression/brotli/decompressor/v3:pkg",
167169
"//envoy/extensions/compression/gzip/compressor/v3:pkg",
168170
"//envoy/extensions/compression/gzip/decompressor/v3:pkg",
169171
"//envoy/extensions/filters/common/dependency/v3:pkg",

generated_api_shadow/envoy/config/route/v3/route_components.proto

+26
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated_api_shadow/envoy/config/route/v4alpha/route_components.proto

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated_api_shadow/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)