Fix JWT attribute parsing of lists in AbstractHTTPJwtAuthenticator#6058
Fix JWT attribute parsing of lists in AbstractHTTPJwtAuthenticator#6058cwperks merged 3 commits intoopensearch-project:mainfrom
Conversation
…nticator The fix is very similar to #4884 It is the same issue as #4267 which was fixed for HTTPJwtAuthenticator, but not for AbstractHTTPJwtAuthenticator and its sub-classes, most importantly HTTPJwtKeyByJWKSAuthenticator. This leads to strange behavior that everything works as expected when using signing_key, which uses with HTTPJwtAuthenticator, but fails when switching to jwks_uri, which uses HTTPJwtKeyByJWKSAuthenticator. This commit aligns the two implementations and enables correct serialization of lists from the JWT. Signed-off-by: Valentin Pratz <git@valentinpratz.de>
Signed-off-by: Valentin Pratz <git@valentinpratz.de>
a7dad13 to
70d1b03
Compare
|
Sorry for the force-push, I forgot to use signoff. |
yes this is flaky. I will re-run them if they fail. |
|
TY for the fix! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6058 +/- ##
==========================================
+ Coverage 73.98% 74.08% +0.09%
==========================================
Files 441 441
Lines 27413 27479 +66
Branches 4110 4119 +9
==========================================
+ Hits 20281 20357 +76
+ Misses 5193 5184 -9
+ Partials 1939 1938 -1
🚀 New features to boost your workflow:
|
Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
Thanks a lot for the quick review and your work on this project in general! |
Signed-off-by: Valentin Pratz <git@valentinpratz.de>
Description
Category: Bug fix
The fix is very similar to #4884, as it is the same issue as #4267, except that
jwks_uriis used instead ofsigning_key.#4267 was fixed by adapting
HTTPJwtAuthenticator, butAbstractHTTPJwtAuthenticatorand its sub-classes, most importantlyHTTPJwtKeyByJWKSAuthenticator, have not received this fix.This leads to strange behavior that everything works as expected when using
signing_key, which relies onHTTPJwtAuthenticator, but fails when switching tojwks_uri, which usesHTTPJwtKeyByJWKSAuthenticator.This PR aligns the two implementations and enables correct serialization of lists from the JWT.
I think the tests show already quite well what is going on, if I should provide additional examples, please let me know.
Issues Resolved
#4267 (was resolved by #4884 when
signing_keyis used, but still fails withjwks_uri). Please let me know if I should open an additional Issue to track this bug.Testing
I have adapted the existing tests, where
attr.jwt.audis a list.Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.