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

Fix issue with jwt attribute parsing of lists #4884

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Nov 8, 2024

Description

Fixes issue in the JWT authenticator when parsing a claim that contains a list value. The existing parsing logic works as-is, but the problem arises when you try to use the parsed value in a DLS clause using the ${attr.jwt.claim} syntax.

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Bug fix

Issues Resolved

Resolves: #4267

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Craig Perkins <[email protected]>
Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 69.86%. Comparing base (1c898dc) to head (59bb8f7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...mazon/dlic/auth/http/jwt/HTTPJwtAuthenticator.java 70.00% 3 Missing ⚠️
...nsearch/security/http/OnBehalfOfAuthenticator.java 70.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4884      +/-   ##
==========================================
- Coverage   69.90%   69.86%   -0.04%     
==========================================
  Files         320      320              
  Lines       21688    21706      +18     
  Branches     3460     3462       +2     
==========================================
+ Hits        15160    15164       +4     
- Misses       4734     4750      +16     
+ Partials     1794     1792       -2     
Files with missing lines Coverage Δ
...mazon/dlic/auth/http/jwt/HTTPJwtAuthenticator.java 80.32% <70.00%> (-1.09%) ⬇️
...nsearch/security/http/OnBehalfOfAuthenticator.java 89.38% <70.00%> (-1.97%) ⬇️

... and 2 files with indirect coverage changes

Copy link
Collaborator

@RyanL1997 RyanL1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cwperks , thanks for taking this on. I just left some comments. The change is LGTM in general.

Signed-off-by: Craig Perkins <[email protected]>
Copy link
Collaborator

@RyanL1997 RyanL1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@willyborankin willyborankin merged commit ddcecb5 into opensearch-project:main Nov 8, 2024
42 checks passed
@willyborankin willyborankin added the backport 2.x backport to 2.x branch label Nov 8, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 8, 2024
Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ddcecb5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Bad parsing on DLS custom JWT attribute
3 participants