Extract TLVs from Proxy Protocol v2 and emit to dynamic metadata (#11488)

Before this change TLVs are read and discarded in the Proxy Protocol filter. This change is to extend the Proxy Protocol Listener filter to extract TLVs of interest and emit them as metadata which can be consumed by other filters.

Fixes #11336

Signed-off-by: Song <songhu@amazon.com>

Mirrored from https://github.com/envoyproxy/envoy @ f8bfc6a16ffebf1ecb9cdf8eb1265912118ae7bf
master-ci-test
data-plane-api(CircleCI) 4 years ago
parent 37c799ee0f
commit 3d9a4caa7c
  1. 23
      envoy/extensions/filters/listener/proxy_protocol/v3/proxy_protocol.proto

@ -4,6 +4,7 @@ package envoy.extensions.filters.listener.proxy_protocol.v3;
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.filters.listener.proxy_protocol.v3";
option java_outer_classname = "ProxyProtocolProto";
@ -17,4 +18,26 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
message ProxyProtocol {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.filter.listener.proxy_protocol.v2.ProxyProtocol";
message KeyValuePair {
// The namespace if this is empty, the filter's namespace will be used.
string metadata_namespace = 1;
// The key to use within the namespace.
string key = 2 [(validate.rules).string = {min_bytes: 1}];
}
// A Rule defines what metadata to apply when a header is present or missing.
message Rule {
// The type that triggers the rule - required
// TLV type is defined as uint8_t in proxy protocol. See `the spec
// <https://www.haproxy.org/download/2.1/doc/proxy-protocol.txt>`_ for details.
uint32 tlv_type = 1 [(validate.rules).uint32 = {lt: 256}];
// If the TLV type is present, apply this metadata KeyValuePair.
KeyValuePair on_tlv_present = 2;
}
// The list of rules to apply to requests.
repeated Rule rules = 1;
}

Loading…
Cancel
Save