Add Client resource type and scopes to authorization schema#5
Conversation
…valuation implementation for ClientsPermissionsV2 Closes #35564 Signed-off-by: Martin Kanis <mkanis@redhat.com>
WalkthroughThis change set introduces fine-grained admin authorization controls for Keycloak client resources. It extends the admin permissions schema to support clients, implements a new Changes
Sequence Diagram(s)sequenceDiagram
participant Admin as Admin User
participant API as Admin REST API
participant MgmtPerms as MgmtPermissionsV2
participant ClientPerms as ClientPermissionsV2
participant Authz as AuthorizationProvider
participant Realm as RealmModel
Admin->>API: Request client operation (e.g., update client)
API->>MgmtPerms: Get client permissions
MgmtPerms->>ClientPerms: clients()
ClientPerms->>Authz: Evaluate permission (e.g., canConfigure)
Authz->>Realm: Lookup client resource & scopes
Authz-->>ClientPerms: Permission result (allow/deny)
ClientPerms-->>MgmtPerms: Boolean result
MgmtPerms-->>API: Boolean result
API-->>Admin: Success or Forbidden
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (10)
🧰 Additional context used🪛 Gitleaks (8.27.2)services/src/main/java/org/keycloak/services/resources/admin/permissions/ClientPermissionsV2.java53-53: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) 🔇 Additional comments (25)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Test 5
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests