Repository navigation
[BUG] Restore Helm-configured controller authentication end to end #2968
Description
controller.auth.mode and controller.auth.userIdClaim need to work end to end in the shipped Helm deployment. Setting trusted-proxy currently does not select ProxyAuthenticator: the controller calls app.Run(ctx, app.Options{}), which selects UnsecureAuthenticator. Using another authenticator requires a custom library integration through app.Options.Authenticator.
The chart previously rendered these values into environment variables that the controller does not consume:
| Helm value | Environment variable | Intended behavior |
|---|---|---|
controller.auth.mode |
AUTH_MODE |
Select unsecure (default) or trusted-proxy authentication |
controller.auth.userIdClaim |
AUTH_USER_ID_CLAIM |
Choose the user identity claim; empty uses sub |
#2967 removes these ineffective settings as part of the environment-variable cleanup. This issue tracks restoring them together with the controller wiring and end-to-end tests.
Reproduction
On the chart before #2967, configure oauth2-proxy with an OIDC provider and set:
controller:
auth:
mode: trusted-proxy
userIdClaim: emailThe chart emits AUTH_MODE=trusted-proxy and AUTH_USER_ID_CLAIM=email, but the shipped controller still uses UnsecureAuthenticator. Browser sign-in does not activate controller authentication or make it use the configured identity claim. This finding comes from the source audit; the deployed flow needs regression coverage.
Expected behavior and acceptance criteria
- Restore the Helm values and render
KAGENT_AUTH_MODEandKAGENT_AUTH_USER_ID_CLAIM, following the naming convention introduced in refactor: standardize environment settings and generate their reference #2967. Consume them in controller startup, selectingProxyAuthenticatorthrough the existingapp.Options.Authenticatorboundary. A standard Helm installation should not require a custom controller binary. - Preserve
unsecureas the default and reject unsupported mode values at startup instead of silently falling back to it. - Pass the configured user-ID claim to
ProxyAuthenticator. Cover the defaultsubclaim, a custom claim such asemail, the existing fallback tosubwhen the custom claim is absent, and rejection when no usable identity exists. - Add E2E coverage using the shipped controller, rendered chart, oauth2-proxy, and a test OIDC provider. Verify that sign-in produces the expected controller caller identity through the UI/nginx API path, authenticated API/MCP requests and agent invocation work, and missing or malformed credentials are rejected on protected controller endpoints. Include a regression check for default
unsecurebehavior. - Exercise invalid/expired credential rejection at the proxy and document the required ingress/network isolation.
ProxyAuthenticatordecodes claims without validating JWT signatures or expiry, so the deployment must preserve the trusted-proxy boundary. - Register the restored settings in
go/core/pkg/env, regeneratedocs/env.md, and update the Helm and OIDC deployment documentation with a working configuration.
Relevant code and documentation:
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
refactor: standardize environment settings and generate their referen…
fix: wire Helm authentication settings into controller startup (#2971)
refactor: standardize environment settings and generate their referen…
fix: wire Helm authentication settings into controller startup (kagen…