http: support creating filters with match tree (#14430)
Adds support for wrapping a HTTP filter with an ExtensionWithMatcher proto to create the filters with an associated match tree. Under the hood this makes use of a wrapper filter factory that manages creating the match tree and adding it to the FM alongside the associated filter. Also includes some code to register factories for input/actions, allowing them to be referenced in the proto configuration. Signed-off-by: Snow Pettersen <snowp@lyft.com> Mirrored from https://github.com/envoyproxy/envoy @ dcf575aa40ce281398a15e175c41a66c2ade3a7epull/624/head
parent
dd427e8c6b
commit
761aff3f81
2 changed files with 75 additions and 0 deletions
@ -0,0 +1,35 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.type.matcher.v3; |
||||
|
||||
import "udpa/annotations/migrate.proto"; |
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
import "validate/validate.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.type.matcher.v3"; |
||||
option java_outer_classname = "HttpInputsProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
|
||||
// [#protodoc-title: Common HTTP Inputs] |
||||
|
||||
// Match input indicates that matching should be done on a specific request header. |
||||
// The resulting input string will be all headers for the given key joined by a comma, |
||||
// e.g. if the request contains two 'foo' headers with value 'bar' and 'baz', the input |
||||
// string will be 'bar,baz'. |
||||
// [#comment:TODO(snowp): Link to unified matching docs.] |
||||
message HttpRequestHeaderMatchInput { |
||||
// The request header to match on. |
||||
string header_name = 1; |
||||
} |
||||
|
||||
// Match input indicating that matching should be done on a specific response header. |
||||
// The resulting input string will be all headers for the given key joined by a comma, |
||||
// e.g. if the response contains two 'foo' headers with value 'bar' and 'baz', the input |
||||
// string will be 'bar,baz'. |
||||
// [#comment:TODO(snowp): Link to unified matching docs.] |
||||
message HttpResponseHeaderMatchInput { |
||||
// The response header to match on. |
||||
string header_name = 1; |
||||
} |
@ -0,0 +1,40 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.type.matcher.v4alpha; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
import "validate/validate.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.type.matcher.v4alpha"; |
||||
option java_outer_classname = "HttpInputsProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; |
||||
|
||||
// [#protodoc-title: Common HTTP Inputs] |
||||
|
||||
// Match input indicates that matching should be done on a specific request header. |
||||
// The resulting input string will be all headers for the given key joined by a comma, |
||||
// e.g. if the request contains two 'foo' headers with value 'bar' and 'baz', the input |
||||
// string will be 'bar,baz'. |
||||
// [#comment:TODO(snowp): Link to unified matching docs.] |
||||
message HttpRequestHeaderMatchInput { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.type.matcher.v3.HttpRequestHeaderMatchInput"; |
||||
|
||||
// The request header to match on. |
||||
string header_name = 1; |
||||
} |
||||
|
||||
// Match input indicating that matching should be done on a specific response header. |
||||
// The resulting input string will be all headers for the given key joined by a comma, |
||||
// e.g. if the response contains two 'foo' headers with value 'bar' and 'baz', the input |
||||
// string will be 'bar,baz'. |
||||
// [#comment:TODO(snowp): Link to unified matching docs.] |
||||
message HttpResponseHeaderMatchInput { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.type.matcher.v3.HttpResponseHeaderMatchInput"; |
||||
|
||||
// The response header to match on. |
||||
string header_name = 1; |
||||
} |
Loading…
Reference in new issue