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

Enhance TestSecurity OIDC to support UserInfo and OidcConfigurationMetadata #17075

Merged

Conversation

sberyozkin
Copy link
Member

Fixes #16697

I will follow up asap with addressing #17074

@sberyozkin sberyozkin force-pushed the test_sec_oidc_userinfo_metadata branch from 0a03e19 to d3fe365 Compare May 11, 2021 14:16
@sberyozkin
Copy link
Member Author

@stuartwdouglas OK, I've reworked this PR and the new annotation idea works great, thanks for suggesting it.
There is no need to throw the exceptions in case no capability is present because the new (optional) annotations are introduced by test-framework/security-jwt (@JwtSecurity) and test-framework/security-oidc (@OidcSecurity). test-framework/security has only been updated to pass all available annotations to TestSecurityAugmentor - this way any new authentication mechanism specific extension can add as many annotations as needed.
@TestSecurity can still be used for simple JWT/OIDC quarkus-smallrye-jwt/quarkus-oidc endpoints.
The only minor issue is that test-framework/security-jwt (@JwtSecurity) and test-framework/security-oidc (@OidcSecurity) have their own @Claim annotation (since testing quarkus-smallrye-jwt is not possible with @OidcSecurity and quarkus-oidc with JwtSecurity) - but I'm not worried about it.
How does it look now ?
Cheers

@sberyozkin
Copy link
Member Author

Or security-jwt/security-oidc can find the needed annotations without security passing Annotation[] directly to TestSecurityAugmentor - I just did not want to duplicate the code for finding the annotations - but that code can be turned into a static utility code and reused

@sberyozkin sberyozkin merged commit e2696e4 into quarkusio:main May 13, 2021
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone May 13, 2021
@sberyozkin sberyozkin deleted the test_sec_oidc_userinfo_metadata branch May 13, 2021 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance TestSecurity OIDC module to support the injection of UserInfo and OidcConfigurationMetadata
2 participants