Repository navigation
Conversation
Adds focused unit coverage for basic auth parsing, URI query decoding, JSON attribute deserialization, and ID token session state compatibility. Closes keycloak#49325 Signed-off-by: cr7yash <yashaqua@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds additional unit tests to cover edge cases and backward-compatibility behaviors for several core utilities.
Changes:
- Add tests for query-string decoding behavior (spaces/plus handling and empty parameters).
- Add Basic Auth parsing test where the password contains colons.
- Add tests for deprecated
IDToken#getSessionState()compatibility and non-string JSON attribute deserialization.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| core/src/test/java/org/keycloak/util/UriUtilsTest.java | Adds coverage for UriUtils.decodeQueryString decoding and empty parameter behavior. |
| core/src/test/java/org/keycloak/util/BasicAuthHelperTest.java | Adds coverage for parsing Basic Auth headers when the password contains :. |
| core/src/test/java/org/keycloak/representations/IDTokenTest.java | Adds a regression test asserting deprecated session-state behavior maps to session ID. |
| core/src/test/java/org/keycloak/json/StringListMapDeserializerTest.java | Adds coverage ensuring non-string JSON primitive values are coerced into strings. |
Comment on lines
+81
to
+84
| MultivaluedHashMap<String, String> actual = UriUtils.decodeQueryString("first%20name=Jane+Doe&empty"); | ||
|
|
||
| assertEquals("Jane Doe", actual.getFirst("first name")); | ||
| assertEquals("", actual.getFirst("empty")); | 8000
|
|
||
| @Test | ||
| public void testDecodeQueryString() { | ||
| MultivaluedHashMap<String, String> actual = UriUtils.decodeQueryString("first%20name=Jane+Doe&empty"); |
Signed-off-by: cr7yash <yashaqua@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds focused unit coverage for basic auth parsing, URI query decoding, JSON attribute deserialization, and ID token session state compatibility.
Closes #49325