feat: add agent audience scope to platform clients during registration#172
Merged
mrsabath merged 1 commit intoMar 6, 2026
Merged
Conversation
11 tasks
The client-registration sidecar now creates an audience scope for the agent and adds it to platform clients (e.g., the kagenti UI client) so AuthBridge-protected agents are reachable from the UI without manual Keycloak configuration. New env vars (all optional with sensible defaults): - PLATFORM_CLIENT_IDS: comma-separated client IDs (default: "kagenti") - KEYCLOAK_AUDIENCE_SCOPE_ENABLED: toggle scope management (default: "true") Closes: rossoctl#169 Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Mariusz Sabath <mrsabath@gmail.com>
mrsabath
force-pushed
the
feat/audience-scope-platform-clients
branch
from
March 6, 2026 17:57
9a9f8c3 to
69a0a76
Compare
Alan-Cha
reviewed
Mar 6, 2026
Alan-Cha
approved these changes
Mar 6, 2026
This was referenced Mar 6, 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
kagentiUI client)PLATFORM_CLIENT_IDS(default:kagenti),KEYCLOAK_AUDIENCE_SCOPE_ENABLED(default:true)Problem
When an agent with AuthBridge is deployed, the
client-registrationsidecar registers it as a Keycloak client, but existing clients (like the UI) don't get the agent's audience scope. This means the UI can't chat with AuthBridge-protected agents — the token's audience doesn't include the agent's SPIFFE ID.Solution
After registering the client, the sidecar now:
agent-{namespace}-{name}-aud) with an audience mapperPLATFORM_CLIENT_IDSAll operations are idempotent. The feature is enabled by default and can be disabled with
KEYCLOAK_AUDIENCE_SCOPE_ENABLED=false.Files changed
AuthBridge/client-registration/client_registration.py— Core audience scope logickagenti-webhook/internal/webhook/injector/container_builder.go— PassPLATFORM_CLIENT_IDSenv var to sidecarkagenti-webhook/internal/webhook/injector/container_builder_test.go— Test for new env varAuthBridge/demos/single-target/k8s/configmaps-webhook.yaml— Document new config optionTest plan
TestBuildClientRegistrationContainer_HasPlatformClientIDsEnv)kagentiUI clientCloses #169
🤖 Generated with Claude Code