feat: SPIFFE-based Dynamic Client Registration (DCR)#349
Draft
Alan-Cha wants to merge 1 commit into
Draft
Conversation
Implements issue #1421 - eliminate admin credentials from client registration using SPIFFE JWT-SVID authentication. Changes: - Add internal/spire/client.go: SPIRE workload API client wrapper - Add internal/keycloak/dcr.go: DCR client for JWT-SVID authentication - Add --enable-dcr-registration flag (disabled by default, experimental) - Add --spire-socket-path flag for SPIRE agent socket location - Update ClientRegistrationReconciler to support both DCR and admin paths - Refactor registration logic into registerClientWithDCR() and registerClientWithAdminCreds() methods DCR benefits over admin credentials: - Short-lived JWT-SVID tokens (auto-rotates hourly) - Limited DCR permissions instead of full realm admin - Better audit trail (operator SPIFFE ID vs generic 'admin' user) - No manual credential rotation required When --enable-dcr-registration=true: 1. Operator fetches JWT-SVID from SPIRE 2. Uses JWT-SVID to authenticate with Keycloak DCR endpoint 3. Registers OAuth client with limited DCR permissions 4. No admin credentials needed When false (default): - Uses existing admin credential path from kagenti-system namespace - Backward compatible with existing deployments Note: DCR requires testing with Keycloak to verify JWT-SVID acceptance at the DCR endpoint. This is currently unverified and marked experimental. Assisted-By: Claude Code Signed-off-by: Alan Cha <Alan.cha1@ibm.com>
This was referenced May 18, 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.
Summary
Implements #1421 - Eliminate admin credentials from client registration using SPIFFE JWT-SVID authentication with Keycloak's Dynamic Client Registration (DCR) endpoint.
Problem
Currently, the operator uses admin credentials to register OAuth clients via Keycloak Admin API. This has several security issues:
Solution
Use the operator's SPIFFE JWT-SVID to authenticate with Keycloak's Dynamic Client Registration (DCR) endpoint instead.
Benefits
Implementation
New Components
internal/spire/client.go- SPIRE workload API client wrapperinternal/keycloak/dcr.go- DCR client implementationFeature flags:
--enable-dcr-registration(default: false, experimental)--spire-socket-path(default: unix:///run/spire/sockets/agent.sock)Updated Components
ClientRegistrationReconciler- Refactored to support both paths:registerClientWithDCR()- New DCR path with JWT-SVIDregisterClientWithAdminCreds()- Legacy path (default)Usage
Enable DCR (experimental)
Requirements
Testing Status
This needs verification before enabling:
Possible outcomes:
Rollout Plan
Backward Compatibility
Related
Assisted-By: Claude Code