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

Expose PadForwardPayloadHeader in JWTRule #50856

Open
dio opened this issue May 4, 2024 · 4 comments
Open

Expose PadForwardPayloadHeader in JWTRule #50856

dio opened this issue May 4, 2024 · 4 comments

Comments

@dio
Copy link

dio commented May 4, 2024

Describe the feature request

Currently, when outputPayloadToHeader is specified in the JWTRule config there is no way to force padding the (base64) forwarded value. It is controlled by: pad_forward_payload_header on Envoy jwt_auth filter.

We need this PadForwardPayloadHeader to be exposed in JWTRule.

As comparisons with other products, in Consul we have this field exposed here: https://developer.hashicorp.com/consul/docs/connect/config-entries/jwt-provider#forwarding-padforwardpayloadheader.

Describe alternatives you've considered

We needed to craft our own EnvoyFilter.

Affected product area (please put an X in all that apply)

[x] Networking
[x] User Experience

@dio
Copy link
Author

dio commented May 4, 2024

cc. @zirain

@howardjohn
Copy link
Member

Can you explain why we need this? IIUC this means we are going to take a encoded token that we said we would forward and modify it? Why?

@dio
Copy link
Author

dio commented May 8, 2024

Another service will consume the forwarded encoded token (produced by the envoy's jwt_authn filter) via the specified header. For some implementations, decoding base64 string without padding causes an issue (for example: a legacy service owned by a different team). Setting PadForwardPayloadHeader to true makes sure the encoded value has proper padding.

@MeruFM
Copy link

MeruFM commented May 17, 2024

What @dio said is correct. The proxy/mesh/gateway team is often not the same team as underlying services that assume padded Base64. This is especially true when integrating onto large existing systems. Older versions of golang default to require padding.

Since this flag is already present in Envoy, there's likely use cases for it and should be reasonably expected here as well?

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

No branches or pull requests

4 participants