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

feat(security): added the ability to use a different claim field to match against the allow-subjects list. #763

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LCerebo
Copy link

@LCerebo LCerebo commented May 14, 2024

Summary

You can use a custom claim field to identify users i.e. 'email' or 'preferred_username'.
If not specified the default is 'subject'.

Checklist

  • Tested and/or added tests to validate that the changes work as intended, if applicable.
  • Updated documentation in README.md, if applicable.

##Notes
Tested using a keycloak server as OIDC provider.
I tried to add some unit tests but I'm not sure how to mock a valid OIDC server.

…atch against the allow-subjects list.

In this way you can use 'email' or 'preferred_username' to identify the users.
If not specified the default is 'subject'.
@LCerebo
Copy link
Author

LCerebo commented May 31, 2024

@TwiN can you take a look in this PR?
Thanks in advance.

Copy link
Owner

@TwiN TwiN left a comment

Choose a reason for hiding this comment

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

Is there any way you could add a test to ensure that the feature works as intended?

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.

Project coverage is 78.63%. Comparing base (af00dfd) to head (6cb85b4).
Report is 4 commits behind head on master.

Files Patch % Lines
security/oidc.go 0.00% 21 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #763      +/-   ##
==========================================
- Coverage   78.92%   78.63%   -0.29%     
==========================================
  Files          69       69              
  Lines        4521     4536      +15     
==========================================
- Hits         3568     3567       -1     
- Misses        754      769      +15     
- Partials      199      200       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

3 participants