Skip to content

Add configurable authorities split regex #12073

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

Conversation

PatrickWalter214
Copy link
Contributor

@PatrickWalter214 PatrickWalter214 commented Oct 22, 2022

This PR adds the ability to split the authorities claim on a configurable regex, which was previously set ot a hardcoded regex " ". The IAM solution I used provided the authorities separated by another character than ' ' and I realized that with the JwtGrantedAuthoritiesConverter I was not able to set a custom regex. The solution in this PR makes the JwtGrantedAuthoritiesConverter more flexible by supporting this use case while keeping the previous default behaviour.

I signed the individual CLA to provide this PR.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 22, 2022
@jzheaux
Copy link
Contributor

jzheaux commented Oct 26, 2022

Thanks for the PR, @PatrickWalter214!

Since this is a new feature, it needs to go into the next minor release, which is 6.1. Will you please:

  1. Rebase the PR with main so it gets merged to the correct version
  2. Change the @since to be 6.1

@jzheaux jzheaux self-assigned this Oct 26, 2022
@jzheaux jzheaux added type: enhancement A general enhancement in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 26, 2022
@jzheaux jzheaux added this to the 6.1.0-M1 milestone Oct 26, 2022
Before this commit splitting the authorities claim was done by a
hardcoded regex " ". This commit allows to configure to set any regex
to split the authorities claim while keeping the previously
hardcoded regex as a default.
@PatrickWalter214 PatrickWalter214 force-pushed the add-configurable-authorities-split-regex branch from e698cd0 to 64d8ed1 Compare October 27, 2022 23:59
@PatrickWalter214 PatrickWalter214 changed the base branch from 5.6.x to main October 28, 2022 00:01
@PatrickWalter214
Copy link
Contributor Author

Thank you for reviewing my PR @jzheaux!

I performed the steps you mentioned with my latest commit.

@jzheaux jzheaux merged commit e93ed6d into spring-projects:main Nov 1, 2022
@jzheaux
Copy link
Contributor

jzheaux commented Nov 1, 2022

Thanks, @PatrickWalter214! This is now merged into main.

@jzheaux
Copy link
Contributor

jzheaux commented Nov 1, 2022

Oops, @PatrickWalter214, my muscle memory got the best of me. 😅 This is not mergeable until after the 6.0 release. I've created a new PR with your commit and will merge it after 6.0 releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants