-
Notifications
You must be signed in to change notification settings - Fork 3k
Use case-insensitive DPoP scheme check #48091
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
Use case-insensitive DPoP scheme check #48091
Conversation
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.
Pull Request Overview
Enables case-insensitive handling of the DPoP authorization scheme and centralizes the logic in OidcUtils
.
- Introduce
isDPoPScheme
inOidcUtils
for case-insensitive comparisons - Update
BearerAuthenticationMechanism
to use the new utility method - Add unit tests covering uppercase and lowercase scheme values
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
OidcUtils.java | Added isDPoPScheme to perform a case-insensitive check against DPOP_SCHEME |
BearerAuthenticationMechanism.java | Updated the DPoP check to use OidcUtils.isDPoPScheme |
OidcUtilsTest.java | Added testDpopScheme to verify behavior with different casing |
Comments suppressed due to low confidence (2)
extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/OidcUtilsTest.java:37
- [nitpick] Consider renaming this test to
testIsDPoPScheme
to clearly reflect the method under test and align with naming conventions.
public void testDpopScheme() throws Exception {
extensions/oidc/runtime/src/test/java/io/quarkus/oidc/runtime/OidcUtilsTest.java:40
- Add an assertion for a mixed-case input (e.g., "dPoP") to ensure full coverage of case-insensitivity.
assertTrue(OidcUtils.isDPoPScheme("dpop"));
} | ||
return token; | ||
} | ||
|
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.
[nitpick] Add a brief Javadoc comment explaining the purpose of this method, its parameters, and that it performs a case-insensitive comparison.
/** | |
* Checks if the provided authorization scheme matches the DPoP (Demonstration of Proof-of-Possession) scheme. | |
* | |
* @param authorizationScheme the authorization scheme to check; may be null | |
* @return {@code true} if the authorization scheme matches the DPoP scheme (case-insensitive), {@code false} otherwise | |
*/ |
Copilot uses AI. Check for mistakes.
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.
Let's not clutter our code with useless javadoc for very simple methods, thanks!
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.
@gsmet Sounds good, as I was about to ask for feedback on this one, as I was hesitating a bit :-).
@sberyozkin I think it should go in 3.20 too, right? AFAICS, DPoP was introduced in 3.19. I added the label. Shout loudly if it was a mistake :) |
Thanks @gsmet, indeed, should also be backported to 3.20 |
Status for workflow
|
Fixes #48085
We already have an integration test with the
DPoP
value, so I just moved the check toOidcUtils
to test a few more variations