-
Notifications
You must be signed in to change notification settings - Fork 704
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
fix: really assign string scp claim #6336
base: master
Are you sure you want to change the base?
Conversation
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Code Review Agent Run #e56972Actionable Suggestions - 0Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
Code Review Agent Run #8a2bbaActionable Suggestions - 0Review Details
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Can you fix the unit test?
Signed-off-by: Vladimír Dudr <[email protected]>
Like this? |
Code Review Agent Run #a97aefActionable Suggestions - 0Review Details
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6336 +/- ##
==========================================
- Coverage 58.50% 58.49% -0.01%
==========================================
Files 937 937
Lines 71091 71107 +16
==========================================
+ Hits 41589 41594 +5
- Misses 26350 26359 +9
- Partials 3152 3154 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -78,6 +78,7 @@ func Test_verifyClaims(t *testing.T) { | |||
t.Run("String scope", func(t *testing.T) { | |||
identityCtx, err := verifyClaims(sets.NewString("https://myserver", "https://myserver2"), | |||
map[string]interface{}{ | |||
"client_id": "my-client", | |||
"aud": []string{"https://myserver"}, | |||
"scp": "all", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use something other than the default all
scope so its clear that it was not injected.
Also make sure to run |
Why are the changes needed?
because before this change string formatted claims were ignored.
How was this patch tested?
I did run it against keycloak, which was forced to send
scp
claim as string. I.e."scp": "all"
Labels
Summary by Bito
This PR fixes a critical authentication bug by properly assigning scopes from string-formatted claims. The fix corrects an improper assignment that would have ignored the claim. A test file update adds client_id parameter support to validate the fix, improving overall claim handling reliability.Unit tests added: True
Estimated effort to review (1-5, lower is better): 1