jwt_authn: Add header_to_metadata#18140
jwt_authn: Add header_to_metadata#18140mattklein123 merged 12 commits intoenvoyproxy:mainfrom dio:jwt-auth-18138
Conversation
This patch adds header_to_metadata field to JwtProvider config to allow setting the extracted header of a successfully verified JWT to dynamic metadata. Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
|
Thanks for the quick response! I've verified I can log this new metadata field in this release. I use envoy_data_plane, so I can also verify that the protobufs are generated correctly at least for python. |
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
| // kid: EF71iSaosbC5C4tC6Syq1Gm647M | ||
| // alg: PS256 | ||
| // | ||
| string header_in_metadata = 14; |
There was a problem hiding this comment.
what if payload_in_metadata is the same as header_in_metadata? Is it allowed?
There was a problem hiding this comment.
it should not be allowed, please add comment on this restriction.
There was a problem hiding this comment.
Added a warning section. Please let me know if we want to validate this when checking the config.
There was a problem hiding this comment.
hmm, the current comment says ... is not allowed ... which I would expect the validation is going to reject the config, or you can just update the comment to be more accurate (it's not suggested due to potential override but can still be used (won't be rejected in validation) if the user is sure it won't have any override for their use case).
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
| // kid: EF71iSaosbC5C4tC6Syq1Gm647M | ||
| // alg: PS256 | ||
| // | ||
| string header_in_metadata = 14; |
There was a problem hiding this comment.
hmm, the current comment says ... is not allowed ... which I would expect the validation is going to reject the config, or you can just update the comment to be more accurate (it's not suggested due to potential override but can still be used (won't be rejected in validation) if the user is sure it won't have any override for their use case).
| // The active span for the request | ||
| Tracing::Span* parent_span_{&Tracing::NullSpan::instance()}; | ||
| // the callback function to set payload | ||
| // The callback function called to set the extracted payload and header from a verified JWT. |
There was a problem hiding this comment.
set_payload_cb_ should have a more generic name as it now sets both payload and header.
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
|
@qiwzhang @yangminzhu I have a question, re: envoy/source/extensions/filters/http/jwt_authn/verifier.h Lines 29 to 34 in a3cc673 |
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
|
Will wait for review/approve from @yangminzhu or @qiwzhang before looking, thanks. /wait-any |
|
Commit Message:
This patch adds the
header_to_metadatafield to theJwtProviderconfig to allow setting the extracted header of a successfully verified JWT to dynamic metadata.Additional Description:
Risk Level: Low, a new feature
Testing: Added
Docs Changes: Added
Release Notes: Added
Platform-Specific Features: N/A
Fixes #18138