Repository navigation
Make TokenUtil Jackson-agnostic to fix upstream Keycloak Client nightly sync - #51886
Conversation
5ec4c5a to
83ed9f3
Compare
There was a problem hiding this comment.
Pull request overview
Makes TokenUtil Jackson-version-agnostic to restore Keycloak Client nightly synchronization and prevent regressions.
Changes:
- Replaces
JsonSerializationusage withKeycloakJsonMapper. - Extends Jackson-agnostic source checks to cover
TokenUtil.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
core/src/main/java/org/keycloak/util/TokenUtil.java |
Uses the agnostic mapper for role conversion. |
core/src/test/java/org/keycloak/json/JacksonAgnosticClassesTest.java |
Generalizes checks and adds TokenUtil enforcement. |
core/src/test/java/org/keycloak/json/JacksonAgnosticRepresentationsTest.java |
Removed in favor of the generalized test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
83ed9f3 to
a3ac8ed
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
core/src/test/java/org/keycloak/json/JacksonAgnosticClassesTest.java:67
- This filter hard-codes
/, whilePath.toString()inaddViolationuses the platform separator. On Windows every TokenUtil violation is therefore filtered out and this enforcement test always passes; construct the expected relative path withPathsinstead.
List<String> tokenUtilViolations = violations.stream().filter(v -> v.contains("util/TokenUtil.java")).collect(Collectors.toList());
closes: keycloak#51884 Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
a3ac8ed to
4d7554a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
core/src/test/java/org/keycloak/json/JacksonAgnosticClassesTest.java:67
- This filter assumes Unix path separators, but
Path.toString()produces backslashes on Windows, causingtokenUtilViolationsto stay empty and the enforcement test to pass even whenTokenUtilhas violations. Normalize the recorded path before matching.
List<String> tokenUtilViolations = violations.stream().filter(v -> v.contains("util/TokenUtil.java")).collect(Collectors.toList());
RefreshTokenis using this util.