fix(manifests): add OIDC client credentials to control-plane deployment#1445
fix(manifests): add OIDC client credentials to control-plane deployment#1445markturansky merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for cheerful-kitten-f556a0 canceled.
|
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded two OIDC environment variables— Changes
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@components/manifests/base/ambient-control-plane-service.yml`:
- Around line 38-47: The manifest references env vars OIDC_CLIENT_ID and
OIDC_CLIENT_SECRET via secretKeyRef name ambient-api-server keys clientId and
clientSecret, but that Secret only contains sentry.key; update the
ambient-api-server Secret (the resource defined in
ambient-api-server-secrets.yml) to include clientId and clientSecret (or change
the env var references to point to existing secret keys) so the
OIDC_CLIENT_ID/OIDC_CLIENT_SECRET env vars can be resolved at pod startup;
ensure the Secret uses the same key names (clientId, clientSecret) and
appropriate base64-encoded values to match the env var references.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 94ce32d4-4486-4898-8a77-3c0a60963868
📒 Files selected for processing (1)
components/manifests/base/ambient-control-plane-service.yml
| - name: OIDC_CLIENT_ID | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: ambient-api-server | ||
| key: clientId | ||
| - name: OIDC_CLIENT_SECRET | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: ambient-api-server | ||
| key: clientSecret |
There was a problem hiding this comment.
Critical: referenced Secret keys do not exist in the base ambient-api-server Secret
Line 41/42 and Line 46/47 reference ambient-api-server keys clientId and clientSecret, but components/manifests/base/platform/ambient-api-server-secrets.yml currently defines only sentry.key. This will break env var resolution and block pod startup.
Suggested fix
# components/manifests/base/platform/ambient-api-server-secrets.yml
stringData:
+ clientId: ""
+ clientSecret: ""
sentry.key: ""As per coding guidelines, "Prioritize Critical and Major severity issues. Minimize Minor and Trivial findings."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@components/manifests/base/ambient-control-plane-service.yml` around lines 38
- 47, The manifest references env vars OIDC_CLIENT_ID and OIDC_CLIENT_SECRET via
secretKeyRef name ambient-api-server keys clientId and clientSecret, but that
Secret only contains sentry.key; update the ambient-api-server Secret (the
resource defined in ambient-api-server-secrets.yml) to include clientId and
clientSecret (or change the env var references to point to existing secret keys)
so the OIDC_CLIENT_ID/OIDC_CLIENT_SECRET env vars can be resolved at pod
startup; ensure the Secret uses the same key names (clientId, clientSecret) and
appropriate base64-encoded values to match the env var references.
The control-plane was failing to authenticate to the API server with 401 errors because it was sending K8s SA tokens that fail JWT verification against SSO JWKS keys. Add OIDC_CLIENT_ID and OIDC_CLIENT_SECRET env vars (from the ambient-api-server secret) so the CP uses OIDC client credentials flow to obtain SSO JWTs — matching the working MPP approach. Verified on Stage: CP acquires OIDC tokens and all gRPC watch streams establish successfully with no auth errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
127b08c to
4a8b09c
Compare
Summary
OIDC_CLIENT_IDandOIDC_CLIENT_SECRETenv vars to the base control-plane deployment manifest, sourced from theambient-api-serversecretRoot Cause
The rh-trex-ai framework's
AuthStreamInterceptorunconditionally runs JWT verification after pre-auth interceptors, even when the pre-auth bearer token interceptor already authenticated the caller. This means K8s SA tokens (set viaAMBIENT_API_TOKEN) fail withinvalid token: unknown kidbecause their kid is not in the SSO JWKS. The OIDC approach bypasses this by providing actual SSO-issued JWTs.Test plan
using OIDC client credentials token providerandOIDC token acquired🤖 Generated with Claude Code
Summary by CodeRabbit