Skip to content

proxy_protocol: support format_string TLVs in upstream transport socket#46068

Open
davidvo-lyft wants to merge 1 commit into
envoyproxy:mainfrom
davidvo-lyft:davidvo/45130-proxy-protocol-format-string-tlvs
Open

proxy_protocol: support format_string TLVs in upstream transport socket#46068
davidvo-lyft wants to merge 1 commit into
envoyproxy:mainfrom
davidvo-lyft:davidvo/45130-proxy-protocol-format-string-tlvs

Conversation

@davidvo-lyft

Copy link
Copy Markdown
Contributor

The upstream proxy_protocol transport socket only read each added_tlvs entry's static value, silently ignoring entries that use format_string. This parses the format strings into formatters at config time and evaluates them per connection into the proxy protocol v2 header, mirroring the tcp_proxy filter's TLV handling. It also rejects entries that set both or neither of value/format_string.

One design question before this is final: the formatters are evaluated against the upstream connection's stream info (what the transport socket has), so connection/machine-level substitutions like %HOSTNAME% (the use case in #45130) work, but downstream-request-scoped substitutions are not populated. Is upstream-connection stream info the intended scope, or would you prefer the downstream request's stream info be plumbed through? Happy to adjust; I'll add an integration test once the scope is confirmed.

Risk Level: Low
Testing: proxy_protocol_test — new red->green case for a format_string TLV, plus validation cases.
Docs Changes: n/a (proto field already documented)
Release Notes: changelog added

Fixes #45130

The upstream proxy_protocol transport socket only read each added_tlvs
entry's static value, silently ignoring entries that use format_string.
Parse the format strings into formatters at config time and evaluate them
per connection, emitting the result in the proxy protocol v2 header, and
reject entries that set both or neither of value/format_string.

Fixes envoyproxy#45130

Signed-off-by: David Vo <davidvo@lyft.com>
@davidvo-lyft davidvo-lyft requested a review from botengyao as a code owner July 9, 2026 18:25
@davidvo-lyft davidvo-lyft requested a deployment to external-contributors July 9, 2026 18:25 — with GitHub Actions Waiting
@repokitteh-read-only

Copy link
Copy Markdown

Hi @davidvo-lyft, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #46068 was opened by davidvo-lyft.

see: more, trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TlvEntry.format_string Is Being Ignored

1 participant