Repository navigation
ClientUpdaterSourceGroupsCondition and ClientUpdaterSourceRolesCondition prevent usage of CIMD - #52601
ClientUpdaterSourceGroupsCondition and ClientUpdaterSourceRolesCondition prevent usage of CIMD#52601reda-alaoui wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Fixes Keycloak issue #52152 where configuring ClientUpdaterSourceGroupsCondition / ClientUpdaterSourceRolesCondition could break Client ID Metadata Document (CIMD) create/update flows by throwing on non-CRUD contexts.
Changes:
- Update source-groups/roles client policy conditions to avoid throwing on unexpected context types.
- Add CIMD create/update regression tests covering both groups and roles conditions.
- Generalize the redirect-uris policy helper to support a configurable condition provider/config.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/base/src/test/java/org/keycloak/tests/client/policies/ClientIdMetadataDocumentTest.java | Adds regression tests for CIMD with updater-source conditions and extends a policy helper to accept a pluggable condition. |
| services/src/main/java/org/keycloak/services/clientpolicy/condition/ClientUpdaterSourceRolesCondition.java | Avoids throwing ClientPolicyException on unsupported context types by returning a vote instead. |
| services/src/main/java/org/keycloak/services/clientpolicy/condition/ClientUpdaterSourceGroupsCondition.java | Avoids throwing ClientPolicyException on unsupported context types by returning a vote instead. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ion prevent usage of CIMD Closes keycloak#52152 Signed-off-by: Réda Housni Alaoui <reda-alaoui@hey.com>
Signed-off-by: Réda Housni Alaoui <reda-alaoui@hey.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix is covered by regression tests, with no unresolved issues.
Review effort: Balanced
Findings: None
Resolved since last review (6)
These two new tests are nearly identical aside from the condition provider/config they pass in. To… Replacing the exception with an unconditionalClientPolicyVote.NOfor unexpected context types… Same concern as in the roles condition: returningNOon unexpected context types may silently… These parameters are generic condition inputs for the policy, but the names are tightly coupled to… The+ 3offset is a magic number repeated in both tests. Consider introducing a named constant… The+ 3offset is a magic number repeated in both tests. Consider introducing a named constant…
0b9d71e to
3f7fad8
Compare
# Conflicts: # tests/base/src/test/java/org/keycloak/tests/client/policies/ClientIdMetadataDocumentTest.java
|
@mposolda @graziang could one of you review this? It fixes #52152: |


Closes #52152