http tap: add request/response trailer matching (#5804)

1) Add request/response trailer matching
2) Output request/response trailers
3) Refactor matchers to reduce boilerplate and make it harder
   to make mistakes when adding new update functions.
4) Split out a match configuration for HTTP request and response
   into individual things like request headers, request trailers,
   etc. This will make it easier and more logical to add various
   types of body matching and wire it up using the existing and/or
   logic.

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ fbcf6bcaac6ac3c2b13f8c51fb1470a25b240abd
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 007b0116cf
commit f8608b2b3d
  1. 17
      envoy/data/tap/v2alpha/http.proto
  2. 26
      envoy/service/tap/v2alpha/common.proto

@ -9,9 +9,18 @@ import "envoy/api/v2/core/base.proto";
// A fully buffered HTTP trace message.
message HttpBufferedTrace {
// Request headers.
repeated api.v2.core.HeaderValue request_headers = 2;
// HTTP message wrapper.
message Message {
// Message headers.
repeated api.v2.core.HeaderValue headers = 1;
// Response headers.
repeated api.v2.core.HeaderValue response_headers = 3;
// Message trailers.
repeated api.v2.core.HeaderValue trailers = 2;
}
// Request message.
Message request = 1;
// Response message.
Message response = 2;
}

@ -48,23 +48,23 @@ message MatchPredicate {
// The match configuration will always match.
bool any_match = 4 [(validate.rules).bool.const = true];
// HTTP request match configuration.
HttpRequestMatch http_request_match = 5;
// HTTP request headers match configuration.
HttpHeadersMatch http_request_headers_match = 5;
// HTTP response match configuration.
HttpResponseMatch http_response_match = 6;
}
}
// HTTP request trailers match configuration.
HttpHeadersMatch http_request_trailers_match = 6;
// HTTP request match configuration.
message HttpRequestMatch {
// HTTP request headers to match.
repeated api.v2.route.HeaderMatcher headers = 1;
// HTTP response headers match configuration.
HttpHeadersMatch http_response_headers_match = 7;
// HTTP response trailers match configuration.
HttpHeadersMatch http_response_trailers_match = 8;
}
}
// HTTP response match configuration.
message HttpResponseMatch {
// HTTP response headers to match.
// HTTP headers match configuration.
message HttpHeadersMatch {
// HTTP headers to match.
repeated api.v2.route.HeaderMatcher headers = 1;
}

Loading…
Cancel
Save