8000 Re-validate stored client URIs on partial client updates by graziang · Pull Request #55232 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Re-validate stored client URIs on partial client updates - #55232

Open
graziang wants to merge 1 commit into
keycloak:mainfrom
graziang:issue-53952
Open

graziang wants to merge 1 commit into
keycloak:mainfrom
graziang:issue-53952

Conversation

@graziang
@graziang graziang commented Nov 16, 2026 •
Copy link
Copy Markdown
Contributor

Before this PR on UPDATE both executors validated only the submitted representation, so URI fields omitted from a partial update kept their stored value unchecked.

  • On UPDATE both executors validate the state the request produces: a URI field the payload omits keeps its stored value and is checked again.
  • The merge mirrors RepresentationToModel.updateClientProperties, so an empty value clears the field and removes a non-compliant URI.
  • Derived web origins are checked too, on registration as well, otherwise a client could be created in a state that blocks every later update.
  • Registration is otherwise unchanged, as there is no stored client to merge with.
  • Partial updates now fail while a client still holds a non-compliant URI, so the change is in the 27.0.0 upgrading guide.

Closes #53952

@graziang
graziang requested a review from a team as a code owner November 16, 2026 15:32
Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:32
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The validation merge omits web-origin defaulting, allowing a description-only update to bypass a webOrigins pattern policy and persist a disallowed origin.

1 open issue
What changed in this PR

This PR addresses #53952 by extending the shared client URI catalog to revalidate stored values during partial updates, building on #54062.

Changes:

  • Merge submitted URI fields with stored values for both secure URI executors.
  • Add unit and integration tests for rejecting non-compliant stored URIs and accepting replacements.
  • Document partial-update validation and upgrade implications.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​client/​policies/​SamlClientUrisExecutorTest.java Tests stored URI revalidation under the HTTPS policy.
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​client/​policies/​ClientUrisPatternExecutorTest.java Tests partial updates under a URI pattern policy.
services/​src/​test/​java/​org/​keycloak/​validation/​ClientUriPolicyTest.java Covers stored and replacement URIs across update contexts.
services/​src/​test/​java/​org/​keycloak/​validation/​ClientUriFieldTest.java Tests URI merging and explicit clearing.
services/​src/​main/​java/​org/​keycloak/​validation/​ClientUriField.java Adds shared validation using proposed and stored values.
services/​src/​main/​java/​org/​keycloak/​services/​clientpolicy/​executor/​SecureClientUrisPatternExecutor.java Validates merged URI values on updates.
services/​src/​main/​java/​org/​keycloak/​services/​clientpolicy/​executor/​SecureClientUrisExecutor.java Uses merged URI values and effective redirect context.
docs/​documentation/​upgrading/​topics/​changes/​changes-27_0_0.adoc Explains stricter update validation after upgrading.
docs/​documentation/​server_admin/​topics/​clients/​client-policies.adoc Documents partial-update policy behavior.
< 8000 /markdown-accessiblity-table>

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 16, 2026 15:55
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the URI-validation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

8000

…xecutors

Closes keycloak#53952

Signed-off-by: Giuseppe Graziano <g.graziano94@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 16:59
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the partial-update URI validation changes.

No open issues 🎉

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secure client URI executors do not re-validate stored URIs on partial client update

2 participants

0