You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(webhook): validate/warn when AgentRuntime.spec.auth.outbound route has multiple audiences #518
The AgentRuntime CRD defines spec.auth.outbound[].audiences as an array (future-proofing), but AuthBridge's routing.Route struct only supports a singletarget_audience string.
Currently, the webhook silently takes the first audience and ignores any others:
// pod_mutator.goiflen(outboundRoute.Audiences) >0 {
route["target_audience"] =outboundRoute.Audiences[0] // Only first is used
}
The second audience is dropped without any feedback.
Proposed Solution
Add validation at webhook admission time:
iflen(outboundRoute.Audiences) >1 {
mutatorLog.Info("Multiple audiences specified but only first will be used",
"route", outboundRoute.Destination.Host,
"audiences", outboundRoute.Audiences,
"using", outboundRoute.Audiences[0])
// Consider: add a warning event on the AgentRuntime CR
}
Alternative: Reject the AgentRuntime entirely if multiple audiences are specified (stricter, but clearer failure mode).
Context
AuthBridge source: cortex/authbridge/authlib/routing/router.go - Route struct has Audience string
CRD definition: operator/api/v1alpha1/agentruntime_types.go - has Audiences []string
The array format was chosen for future-proofing, but creates a mismatch with current AuthBridge capabilities
This was already resolved by #517 (commit 8c2bf23), merged the day after this issue was filed. pod_mutator.go now logs a warning when multiple audiences are specified and uses the first one, with a comment linking back to this issue:
iflen(outboundRoute.Audiences) >1 {
mutatorLog.Info("multiple audiences specified but only first will be used",
"namespace", namespace, "crName", crName,
"route", outboundRoute.Destination.Host,
"audiences", outboundRoute.Audiences,
"using", outboundRoute.Audiences[0])
}
Verified present on main. The "reject entirely" alternative was not adopted; the warning-log approach was. The optional idea of also emitting a Kubernetes Event on the AgentRuntime CR was not implemented — happy to open a follow-up if that's still wanted.
Activity
refactor: extract AuthProxy path constants and add multiple-audience …
Alan-Cha commentedon Sep 21, 2026
This was already resolved by #517 (commit 8c2bf23), merged the day after this issue was filed.
pod_mutator.gonow logs a warning when multiple audiences are specified and uses the first one, with a comment linking back to this issue:Verified present on
main. The "reject entirely" alternative was not adopted; the warning-log approach was. The optional idea of also emitting a Kubernetes Event on the AgentRuntime CR was not implemented — happy to open a follow-up if that's still wanted.