Repository navigation
Conversation
Expose JWT client validator validation helpers to subclasses so downstream integrations can customize individual validation steps without copying the full validator implementation. Closes keycloak#49040 Signed-off-by: Puneet Dixit <rvit23bcs086.rvitm@rvei.edu.in>
There was a problem hiding this comment.
Pull request overview
Makes select helper methods on AbstractJWTClientValidator protected so integrators can override individual validation steps without forking the entire class, and adds a compile-time test that subclasses both AbstractJWTClientValidator and FederatedJWTClientValidator to lock in the new extensibility surface.
Changes:
- Change visibility of
validateClientAssertionParameters,validateClient,validateSignature, and bothfailure(...)helpers fromprivatetoprotected. - Add
JWTClientValidatorExtensibilityTestthat subclasses both validators and overrides the now-protected/abstract methods to guarantee they remain extensible.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| services/src/main/java/org/keycloak/authentication/authenticators/client/AbstractJWTClientValidator.java | Widens visibility of 5 helper methods from private to protected. |
| services/src/test/java/org/keycloak/authentication/authenticators/client/JWTClientValidatorExtensibilityTest.java | New compile-time test asserting both validators can be subclassed and overridden. |
There was a problem hiding this comment.
Great work @puneetdixit200 !
I added a few comments that might be worth addressing before moving on.
e316b0f to
b0d6af1
Compare
Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com>
b0d6af1 to
dd8bfa2
Compare
|
Addressed the requested compile-time API stability comment on the extensibility test subclass. Verification:
|
|
Looks good to me! Thanks for great work @puneetdixit200 ! |
There was a problem hiding this comment.
@puneetdixit200 LGTM, but I think the test is not necessary. Please remove it.
@slaskawi Thanks for the review.
The validator method visibility change is enough for the extension point, and reviewers asked to drop the compile-time test. Generated-by: OpenAI Codex Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com>
|
Removed the extensibility test in Verification:
|
* Make JWT client validators extensible Expose JWT client validator validation helpers to subclasses so downstream integrations can customize individual validation steps without copying the full validator implementation. Closes keycloak#49040 Signed-off-by: Puneet Dixit <rvit23bcs086.rvitm@rvei.edu.in> * Simplify validator extensibility test Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> * Remove validator extensibility test The validator method visibility change is enough for the extension point, and reviewers asked to drop the compile-time test. Generated-by: OpenAI Codex Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> --------- Signed-off-by: Puneet Dixit <rvit23bcs086.rvitm@rvei.edu.in> Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> Co-authored-by: Puneet Dixit <rvit23bcs086.rvitm@rvei.edu.in> Co-authored-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com>
Closes #49040
Summary
AbstractJWTClientValidatortoprotectedso downstreamvalidators can override individual validation steps instead of copying the full class.
AbstractJWTClientValidatorandFederatedJWTClientValidator.Testing
./mvnw -pl services -am -Dtest=JWTClientValidatorExtensibilityTest test./mvnw -pl services spotless:checkAI agent usage