Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static void setCertificateThumbprint(RoutingContext context, OidcTenantC
}

private static void setDPopProof(RoutingContext context, OidcTenantConfig oidcTenantConfig, String token) {
if (OidcConstants.DPOP_SCHEME.equals(oidcTenantConfig.token().authorizationScheme())) {
if (OidcUtils.isDPoPScheme(oidcTenantConfig.token().authorizationScheme())) {

List<String> proofs = context.request().headers().getAll(OidcConstants.DPOP_SCHEME);
if (proofs == null || proofs.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -916,4 +916,8 @@ public static String decryptToken(TenantConfigContext resolvedContext, String to
}
return token;
}

Copy link

Copilot AI May 27, 2025

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.

Suggested change
/**
* 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.

Copy link
Member

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!

Copy link
Member Author

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 :-).

public static boolean isDPoPScheme(String authorizationScheme) {
return OidcConstants.DPOP_SCHEME.equalsIgnoreCase(authorizationScheme);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@

public class OidcUtilsTest {

@Test
public void testDpopScheme() throws Exception {

assertTrue(OidcUtils.isDPoPScheme("DPoP"));
assertTrue(OidcUtils.isDPoPScheme("dpop"));
assertFalse(OidcUtils.isDPoPScheme("pop"));

}

@Test
public void testGetSingleSessionCookie() throws Exception {

Expand Down
Loading