matching: add support for matching on HTTP trailers (#14895)

Adds support for matching on HTTP request and response trailers.

Also fixes a bug around skipping filter iteration where we would not
skip encoding trailers even if the skip_filter_ flag was set.

Signed-off-by: Snow Pettersen <snowp@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 40964cc30d4e691df5c5f0c32a449a7b4462115a
pull/624/head
data-plane-api(Azure Pipelines) 4 years ago
parent e1cfb4b9b0
commit d4b81e1b07
  1. 29
      envoy/type/matcher/v3/http_inputs.proto
  2. 35
      envoy/type/matcher/v4alpha/http_inputs.proto

@ -3,6 +3,7 @@ syntax = "proto3";
package envoy.type.matcher.v3;
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
option java_outer_classname = "HttpInputsProto";
@ -18,7 +19,19 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#comment:TODO(snowp): Link to unified matching docs.]
message HttpRequestHeaderMatchInput {
// The request header to match on.
string header_name = 1;
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
// Match input indicates that matching should be done on a specific request trailer.
// 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 HttpRequestTrailerMatchInput {
// The request trailer to match on.
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
// Match input indicating that matching should be done on a specific response header.
@ -28,5 +41,17 @@ message HttpRequestHeaderMatchInput {
// [#comment:TODO(snowp): Link to unified matching docs.]
message HttpResponseHeaderMatchInput {
// The response header to match on.
string header_name = 1;
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
// Match input indicates that matching should be done on a specific response trailer.
// 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 HttpResponseTrailerMatchInput {
// The response trailer to match on.
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}

@ -4,6 +4,7 @@ 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";
@ -22,7 +23,22 @@ message HttpRequestHeaderMatchInput {
"envoy.type.matcher.v3.HttpRequestHeaderMatchInput";
// The request header to match on.
string header_name = 1;
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
// Match input indicates that matching should be done on a specific request trailer.
// 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 HttpRequestTrailerMatchInput {
option (udpa.annotations.versioning).previous_message_type =
"envoy.type.matcher.v3.HttpRequestTrailerMatchInput";
// The request trailer to match on.
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
// Match input indicating that matching should be done on a specific response header.
@ -35,5 +51,20 @@ message HttpResponseHeaderMatchInput {
"envoy.type.matcher.v3.HttpResponseHeaderMatchInput";
// The response header to match on.
string header_name = 1;
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}
// Match input indicates that matching should be done on a specific response trailer.
// 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 HttpResponseTrailerMatchInput {
option (udpa.annotations.versioning).previous_message_type =
"envoy.type.matcher.v3.HttpResponseTrailerMatchInput";
// The response trailer to match on.
string header_name = 1
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
}

Loading…
Cancel
Save