Commit 8b856fa
fix(backend): use backend SA for runner secret validation
The CreateSession handler was using the caller's K8s client (reqK8s)
to validate ambient-runner-secrets exists. Session ServiceAccounts
created by the operator only have agenticsessions CRD permissions,
not secret-read permission, causing 500 errors when sessions try to
create other sessions via backend tools.
Switch to the backend's own service account (K8sClient) for this
validation check. This is safe because:
- The check is a pre-flight validation, not a user-scoped operation
- The operator also uses its own SA for the same check (line 661)
- Session SA permissions are intentionally minimal (least-privilege)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent df0003d commit 8b856fa
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
| |||
0 commit comments