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

Allow disabling generate_request_id #5281

Open
jukie opened this issue Feb 14, 2025 · 4 comments · May be fixed by #5283
Open

Allow disabling generate_request_id #5281

jukie opened this issue Feb 14, 2025 · 4 comments · May be fixed by #5283
Assignees
Labels
area/api API-related issues help wanted Extra attention is needed
Milestone

Comments

@jukie
Copy link
Contributor

jukie commented Feb 14, 2025

Description:

Describe the desired behavior, what scenario it enables and how it
would be used.

I'd like the ability to disable the behavior of generating request IDs without using an EnvoyPatchPolicy. Would it make sense to add this to ClientTrafficPolicy under HeaderSettings?

[optional Relevant Links:]

Any extra documentation required to understand the issue.

ClientTrafficPolicy.HeaderSettings spec:

// HeaderSettings provides configuration options for headers on the listener.
type HeaderSettings struct {
// EnableEnvoyHeaders configures Envoy Proxy to add the "X-Envoy-" headers to requests
// and responses.
// +optional
EnableEnvoyHeaders *bool `json:"enableEnvoyHeaders,omitempty"`
// DisableRateLimitHeaders configures Envoy Proxy to omit the "X-RateLimit-" response headers
// when rate limiting is enabled.
// +optional
DisableRateLimitHeaders *bool `json:"disableRateLimitHeaders,omitempty"`
// XForwardedClientCert configures how Envoy Proxy handle the x-forwarded-client-cert (XFCC) HTTP header.
//
// x-forwarded-client-cert (XFCC) is an HTTP header used to forward the certificate
// information of part or all of the clients or proxies that a request has flowed through,
// on its way from the client to the server.
//
// Envoy proxy may choose to sanitize/append/forward the XFCC header before proxying the request.
//
// If not set, the default behavior is sanitizing the XFCC header.
// +optional
XForwardedClientCert *XForwardedClientCert `json:"xForwardedClientCert,omitempty"`
// WithUnderscoresAction configures the action to take when an HTTP header with underscores
// is encountered. The default action is to reject the request.
// +optional
WithUnderscoresAction *WithUnderscoresAction `json:"withUnderscoresAction,omitempty"`
// PreserveXRequestID configures Envoy to keep the X-Request-ID header if passed for a request that is edge
// (Edge request is the request from external clients to front Envoy) and not reset it, which is the current Envoy behaviour.
// It defaults to false.
//
// +optional
PreserveXRequestID *bool `json:"preserveXRequestID,omitempty"`
// EarlyRequestHeaders defines settings for early request header modification, before envoy performs
// routing, tracing and built-in header manipulation.
//
// +optional
EarlyRequestHeaders *gwapiv1.HTTPHeaderFilter `json:"earlyRequestHeaders,omitempty"`
}

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyPatchPolicy
metadata:
  name: patch-pol
spec:
  jsonPatches:
  - name: default/eg/https
    operation:
      op: add
      path: /filter_chains/0/filters/0/typed_config/generate_request_id
      value: false
    type: type.googleapis.com/envoy.config.listener.v3.Listener
@jukie jukie added the triage label Feb 14, 2025
@arkodg
Copy link
Contributor

arkodg commented Feb 14, 2025

cc @guydc, dont we have this ?

@jukie
Copy link
Contributor Author

jukie commented Feb 14, 2025

Maybe you're thinking of PreserveXRequestID? I wasn't able to find any code references for generate_request_id/generateRequestID and tried disabling most of the header options but X-Request-ID is still always present. Would love to hear that I'm mistaken!

@arkodg
Copy link
Contributor

arkodg commented Feb 14, 2025

ah my bad, you're right

@arkodg arkodg added help wanted Extra attention is needed area/api API-related issues and removed triage labels Feb 14, 2025
@arkodg arkodg modified the milestones: Backlog, v1.4.0-rc.1 Feb 14, 2025
@jukie
Copy link
Contributor Author

jukie commented Feb 17, 2025

/assign @jukie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api API-related issues help wanted Extra attention is needed
Projects
None yet
2 participants