Repository navigation
Validate authorization resource URI templates on every import path - #55634
Merged
pedroigor merged 1 commit intoNov 27, 2026
Merged
Conversation
Every path that creates or imports resources now rejects a URI template the resource endpoints already reject, instead of only the resource endpoints enforcing it. Closes keycloak#55592 Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The documentation overstates URI validation coverage for Admin API client updates and fails to distinguish legacy matching examples from templates allowed during creation or import.
2 open issues
What changed in this PR
This PR addresses #55592 by applying existing authorization resource URI-template validation to shared import processing, preventing import paths from persisting templates that resource endpoints reject.
Changes:
- Validate resource URIs during authorization settings conversion.
- Add rejection and rollback checks for settings import, client creation, realm import, partial import, and dynamic registration updates.
- Document the import compatibility change and legacy wildcard matching behavior.
| File | Description |
|---|---|
tests/base/src/test/java/org/keycloak/tests/client/ClientRegistrationTest.java |
Tests rejection of invalid URIs during registration updates. |
tests/base/src/test/java/org/keycloak/tests/authz/admin/ResourceServerUriTemplateValidationTest.java |
Adds settings, client creation, and realm import validation tests. |
tests/base/src/test/java/org/keycloak/tests/admin/partialimport/PartialImportClientTest.java |
Tests rejection and rollback of invalid partial imports. |
server-spi-private/src/main/java/org/keycloak/models/utils/RepresentationToModel.java |
Validates resource URI templates during settings import. |
docs/documentation/upgrading/topics/changes/changes-27_0_0.adoc |
Documents stricter import validation and upgrade implications. |
docs/documentation/authorization_services/topics/resource-create.adoc |
Clarifies wildcard recognition and legacy matching behavior. |
Review effort: Balanced
pedroigor
approved these changes
Nov 27, 2026
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.

Every path that creates or imports resources now rejects a URI template the resource endpoints already reject, instead of only the resource endpoints enforcing it.
Closes #55592