solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy
https://docs.solo.io/
Apache License 2.0
4.08k stars 438 forks source link

Expose "early_header_mutation" filter in the Gloo control plane #9604

Open DuncanDoyle opened 4 months ago

DuncanDoyle commented 4 months ago

Gloo Edge Product

Open Source

Gloo Edge Version

1.17.0

Is your feature request related to a problem? Please describe.

Gloo's Envoy proxy ships with the early header mutation extension.

{
       "name": "envoy.http.early_header_mutation.header_mutation",
       "category": "envoy.http.early_header_mutation",
       "type_urls": [
        "envoy.extensions.http.early_header_mutation.header_mutation.v3.HeaderMutation"
       ]
      }

We should expose this early header mutation functionality via the Gloo control plane.

Context

The customer use-case is the following:

As part of their test pipelines, the customer wants to set the x-b3-traceid header on the requests. When the original request does not yet contain the x-b3-traceid header, and we try to set this header using, for example, WASM, Envoy overwrites the x-b3-traceid header with a generated one. The only way to prevent Envoy from overwriting this header is to pass the header in the original request, which is something customer would not like to have to do.

Requirement

In Gloo Mesh Gateway, we were able to implement the customer's use-case with a custom EnvoyFilter that uses the early_header_mutation extension to set the x-b3-traceid header. Given that Gloo Gateway does not support the concept of EnvoyFilter like Gloo Mesh Gateway does, we need to expose this configuration in some other form in the Gloo Gateway control plane.

Describe the solution you'd like

Support the use of the early_header_mutation extension in the Gloo control plane.

Describe alternatives you've considered

n.a

Additional Context

Related Issues

┆Issue is synchronized with this Asana task by Unito

EItanya commented 4 months ago

@DuncanDoyle why can't we use transformation for this? Do you know at exactly what stage that header gets overwritten by envoy?

DuncanDoyle commented 3 weeks ago

@nfuden Can you provide the answer to Eitan's question. We're in the process of picking this up, so want to make sure we're all on the same page.

Also, how feasible is a 1.17 backport fo this one?

nfuden commented 3 weeks ago

Pre routing decisions https://github.com/envoyproxy/envoy/issues/23786

And feasible