Wire AllowedAudiences from AgentRuntime CRD to AuthProxy sidecar#370
Conversation
eaf4cbd to
574e4a6
Compare
huang195
left a comment
There was a problem hiding this comment.
Adds spec.identity.allowedAudiences []string to the AgentRuntime CRD and wires it through to the per-agent authbridge ConfigMap's pipeline.inbound.plugins[jwt-validation].config.allowed_audiences. Closes #368. Both proxy-sidecar and envoy-sidecar code paths thread an allowedAudiences parameter through ensurePerAgentConfigMap. Two new tests cover AR-set-injects and nil-doesn't-inject.
Areas reviewed: Go (CRD type, deepcopy, override extraction, ResolvedConfig, pod mutator, tests), kubebuilder annotations, kagenti commit/PR conventions
Commits: 1, signed-off (DCO passing)
CI status: 14/15 passing; E2E pending
Three meta-level items, easy to apply before merge:
-
Commit-message attribution: trailer uses
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>. Kagenti convention (root CLAUDE.md "Commit Attribution Policy" + theai-assisted-by-trailerpre-commit hook) isAssisted-By: Claude (Anthropic AI) <noreply@anthropic.com>. The pre-commit hook should have rewritten this — worth checking whether it ran.git rebase --signoff+ manual edit fixes it. -
PR body footer: reads
🤖 Generated with [Claude Code](https://claude.com/claude-code). Same kagenti convention applies (root CLAUDE.md "PR Bodies" section): footer should beAssisted-By: Claude (Anthropic AI) <noreply@anthropic.com>, not "Generated with". One-line edit to the PR description. -
PR title: no emoji prefix. Kagenti
repo:prconvention is<emoji> <Short descriptive title>—feat:would be replaced by ✨ (or add ✨ as a prefix to the existing title). Not blocking.
Four inline comments below — one suggestion (dead code in ResolvedConfig), three nits / suggestions for hardening.
Verdict: APPROVE — feature works as advertised, dead-code finding (the inline #1 below) doesn't block merge but is worth cleaning up in a follow-up so future engineers don't reasonably assume ResolvedConfig.AllowedAudiences is the canonical source of truth.
|
@akram please rebase and resolve conflict? |
Add spec.identity.allowedAudiences to the AgentRuntime CRD so per-agent JWT audience overrides flow through the operator into the authbridge sidecar's jwt-validation plugin config. This is a transitional mechanism to support application-to-agent flows until the auth model is finalized. Closes rossoctl#368 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Akram <akram.benaissi@gmail.com>
574e4a6 to
456808c
Compare
done (rebased and solved conflicts), and review's comments have been addressed |
Summary
spec.identity.allowedAudiencesfield to the AgentRuntime CRD, allowing per-agent JWT audience overridesAgentRuntimeOverrides→ResolvedConfig→ per-agent ConfigMap generationallowed_audiencesinto thepipeline.inbound.plugins[jwt-validation].configsection of the per-agent ConfigMapExample usage
Changed files
api/v1alpha1/agentruntime_types.goAllowedAudiences []stringtoIdentitySpecinternal/webhook/injector/agentruntime_config.goAgentRuntimeOverridesinternal/webhook/injector/resolved_config.goResolvedConfig, merge with AR precedenceinternal/webhook/injector/pod_mutator.goinjectAllowedAudiences()helper, pass through both call sitesinternal/webhook/injector/pod_mutator_test.goapi/v1alpha1/zz_generated.deepcopy.goconfig/crd/bases/agent.kagenti.dev_agentruntimes.yamlCloses #368
Test plan
go test ./internal/webhook/injector/...)redbank-demo-test-envoynamespace:allowedAudiences: ["redbank-demo-test-envoy", "account"]allowed_audiencesappears in per-agent ConfigMaps underpipeline.inbound.plugins[jwt-validation].configinbound authorized)allowedAudiencesin CR have noallowed_audiencesin ConfigMap🤖 Generated with Claude Code