Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC: Add support to control envoy generated headers #34179

Merged
merged 15 commits into from
Jun 28, 2024

change to bool

f40b5a3
Select commit
Loading
Failed to load commit list.
Merged

gRPC: Add support to control envoy generated headers #34179

change to bool
f40b5a3
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/Coverage skipped Jun 27, 2024 in 0s

Check was skipped

This check was not triggered in this CI run

Details

Request (pr/34179/main@f40b5a3)

tyxia @tyxia f40b5a3 #34179 merge main@f0201e5

gRPC: Add support to control envoy generated headers

This PR provides gRPC client level control over Envoy generated headers. It currently controls x-envoy-internal and x-forwarded-for (can be expanded if needed)

  • If true, header will be added. But it can be overridden by setting setSendInternal or setSendXff to false in
    Http::AsyncClient::StreamOptions, as per stream control.
  • If false, header will be removed and can not be overridden by per stream option.

This logic is designed in this way because:

  • Preserve backwards compatible behavior:
    • Both headers are still sent by default
    • If any existing users remove them with StreamOptions, headers are still removed
  • Still provide the per stream override control
  • The only thing is that now user can not set StreamOptions to true if they are disabled in config. But it should be fine because:
    • For existing user, no one should set them to true in StreamOptions as they are already default to true.
    • For future user, per stream control can still be achieved as stated above.
Environment

Request variables

Key Value
ref 53bf255
sha f40b5a3
pr 34179
base-sha f0201e5
actor tyxia @tyxia
message gRPC: Add support to control envoy generated headers...
started 1719461997.814156
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:f94a38f62220a2b017878b790b6ea98a0f6c5f9c
mobile envoyproxy/envoy-build-ubuntu:mobile-f94a38f62220a2b017878b790b6ea98a0f6c5f9c
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 31
patch 0
dev true