Repository navigation
Conversation
Phase 3 of API bearer token authentication (Epic rossoctl#639). - Add RBAC role constants: kagenti-viewer, kagenti-operator, kagenti-admin - Add create_realm_roles() to create roles in Keycloak realm - Add assign_role_to_user() to assign realm roles to users - Create RBAC roles during agent-oauth-secret job execution - Assign kagenti-admin role to test user for full API access Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the existing agent-oauth-secret Keycloak bootstrap job to ensure Kagenti’s RBAC realm roles exist in Keycloak (and to grant the admin role to the configured test user), supporting Phase 3 of the bearer-token/RBAC rollout.
Changes:
- Add RBAC role constants (
kagenti-viewer/operator/admin) and anRBAC_ROLESlist. - Add Keycloak helpers to create realm roles and assign a realm role to a user.
- Invoke role creation after realm creation and assign
kagenti-adminto the test user.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Move change_current_realm() inside try blocks for proper error handling - Use skip_exists=False for create_realm_role to avoid misleading log - Gate admin role assignment behind KEYCLOAK_TEST_USER_ADMIN env var Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Member
Author
|
all All 4 copilot review comments addressed: |
This was referenced Feb 12, 2026
Member
Author
|
Closing in favor of #672, which now includes realm role creation directly in the API OAuth secret job. This is a better fit since the RBAC roles are specific to backend API authorization, not agent auth. |
3 tasks done
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.
Summary
Phase 3 of API bearer token authentication (Epic #639).
This PR ensures the three RBAC roles exist in Keycloak by extending the existing agent-oauth-secret job.
Changes
ROLE_VIEWER,ROLE_OPERATOR,ROLE_ADMINconstants (matching backend)create_realm_roles()method to create roles in Keycloak realmassign_role_to_user()method to assign realm roles to userscreate_realm_roles(RBAC_ROLES)after realm creationkagenti-adminrole to test user for full API accessTesting
Deploy to dev cluster and verify:
kagenti-adminrole assignedStacked PR
This is PR 3/5 in the API authentication stack:
🤖 Generated with Claude Code