Add configurable SPIFFE ID template support - #269
Closed
akram wants to merge 1 commit into
Closed
Conversation
akram
force-pushed
the
fix/268-configurable-spiffe-id-template
branch
3 times, most recently
from
April 10, 2026 11:00
3e319bf to
020c4b4
Compare
|
This won't work as the ID need not be restricted to these three data items. If a different format is set, ot most likely will include some other element(s) (e.g. pod name, image etc). |
…egistration controller Fixes rossoctl#268 The client registration controller was hardcoding the SPIFFE ID format as spiffe://{trustDomain}/ns/{namespace}/sa/{serviceAccount}, but SPIRE's ClusterSPIFFEID resources allow custom spiffeIDTemplate configurations. This caused confusion when the operator-generated client IDs didn't match the actual SPIFFE IDs issued to workloads. Add comprehensive end-to-end tests for the ClientRegistration controller that verify OAuth client registration in Keycloak and Secret management. Changes: - Add --spire-id-template flag (default: spiffe://{{.TrustDomain}}/ns/{{.Namespace}}/sa/{{.ServiceAccount}}) - Support SPIRE_ID_TEMPLATE environment variable for configuration - Refactor resolveKeycloakClientID to use text/template for rendering - Update tests to verify template rendering with custom formats - Document the new flag and environment variable in operator docs - Mock Keycloak server that simulates admin API for client registration - authbridge-config and keycloak-admin-secret ConfigMaps/Secrets - Agent Deployments for testing non-SPIRE and SPIRE modes The template supports variables: {{.TrustDomain}}, {{.Namespace}}, {{.ServiceAccount}} Command-line flag takes precedence over environment variable. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Akram <akram.benaissi@gmail.com>
akram
force-pushed
the
fix/268-configurable-spiffe-id-template
branch
from
April 10, 2026 15:16
020c4b4 to
c35437f
Compare
Contributor
Author
|
per discussion, it seems indeed that this would be insufficient way of solving the issue. closing |
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
Fixes #268
The client registration controller was hardcoding the SPIFFE ID format, but ClusterSPIFFEID resources allow custom
spiffeIDTemplateconfigurations. This caused confusion when operator-generated Keycloak client IDs didn't match the actual SPIFFE IDs issued to workloads.Changes
--spire-id-templateflag with sensible default:spiffe://{{.TrustDomain}}/ns/{{.Namespace}}/sa/{{.ServiceAccount}}SPIRE_ID_TEMPLATEenvironment variable for configuration (flag takes precedence)resolveKeycloakClientID()to usetext/templatefor rendering SPIFFE IDsoperator-managed-client-registration.mdTemplate Variables
The template supports:
{{.TrustDomain}}- SPIRE trust domain{{.Namespace}}- Kubernetes namespace{{.ServiceAccount}}- Service account nameConfiguration Precedence
--spire-id-template(highest)SPIRE_ID_TEMPLATETest plan
TestResolveKeycloakClientID)🤖 Generated with Claude Code