diff --git a/cloud/apps/sandbox-control/src/auth.ts b/cloud/apps/sandbox-control/src/auth.ts index 1f98caae46c..9b8f61c9d2b 100644 --- a/cloud/apps/sandbox-control/src/auth.ts +++ b/cloud/apps/sandbox-control/src/auth.ts @@ -20,7 +20,7 @@ const ClaimsSchema = z.object({ sub: ID, org: ID.optional(), /** The caller's role in `org`, minted by Orca Cloud auth; absent means no admin rights. */ - org_role: z.enum(['owner', 'admin', 'member']).optional(), + orgRole: z.enum(['owner', 'admin', 'member']).optional(), purpose: z.literal('sandbox') }) @@ -81,7 +81,7 @@ async function verify( return { userId: claims.sub, accountId: accountIdFor(claims), - ...(claims.org ? { orgId: claims.org, ...(claims.org_role ? { orgRole: claims.org_role } : {}) } : {}) + ...(claims.org ? { orgId: claims.org, ...(claims.orgRole ? { orgRole: claims.orgRole } : {}) } : {}) } } catch { return null diff --git a/cloud/apps/sandbox-control/test/secrets.test.ts b/cloud/apps/sandbox-control/test/secrets.test.ts index 7e5b9ad975b..2cf8169b8bf 100644 --- a/cloud/apps/sandbox-control/test/secrets.test.ts +++ b/cloud/apps/sandbox-control/test/secrets.test.ts @@ -34,7 +34,7 @@ afterEach(() => { async function setup(overrides: Record = {}, deps: Parameters[1] = {}) { const h = await createHarness({ SECRETS_KEK: KEK, ...overrides }, deps) const as = async (sub: string, org?: string, role?: string) => - h.token(sub, org, 'sandbox', role ? { org_role: role } : {}) + h.token(sub, org, 'sandbox', role ? { orgRole: role } : {}) async function put(scope: string, name: string, value: string, bearer: string, repo?: string) { const query = repo ? `?repo=${encodeURIComponent(repo)}` : '' return h.call('PUT', `/v1/secrets/${scope}/${name}${query}`, { body: { value }, bearer }) diff --git a/cloud/docs/vercel-driver-design.md b/cloud/docs/vercel-driver-design.md index afd769c86df..9211dca6ad8 100644 --- a/cloud/docs/vercel-driver-design.md +++ b/cloud/docs/vercel-driver-design.md @@ -215,7 +215,7 @@ Product decision: "API-key injection" in the Conductor parity matrix (form 2 = t - **API** (desktop JWT): `GET /v1/secrets?scope=org|personal|repo[&repo=owner/name]`, `PUT /v1/secrets/:scope/:NAME` `{value}`, `DELETE …`. Write-only values: responses carry name, scope, kind, updatedAt, updatedBy and a last-4 hint for values ≥16 chars. Owners: org = the org account (`org:`), personal = `user:`, repo = - `#github.com//`. Org secrets and an org account's repo secrets need `org_role` owner/admin on + `#github.com//`. Org secrets and an org account's repo secrets need `orgRole` owner/admin on the token (any member lists names); personal secrets are the user's alone; dev tokens stay under `dev:`. - **Validation**: `^[A-Z_][A-Z0-9_]*$` ≤128; reserved names (PATH, HOME, NODE_OPTIONS, proxy/CA vars, GIT_SSH*, GH_TOKEN/GITHUB_TOKEN, …) and prefixes (LD_, DYLD_, ORCA_, VERCEL_, BASH_FUNC_, GIT_CONFIG). Values ≤8 KiB, no NUL; @@ -237,7 +237,7 @@ Product decision: "API-key injection" in the Conductor parity matrix (form 2 = t because (1) SSE model streams through Vercel forwardURL → Worker are not yet tested live, and (2) with a key routed, api.anthropic.com denies everything else, including a subscription OAuth Bearer or a plain `ANTHROPIC_AUTH_TOKEN` in the same VM. Enable on dev after a live streaming test with the rebuilt image. -- Needs: golden image rebuild (new `orca-sandbox-start`), and Orca Cloud auth minting `org_role` on sandbox tokens. +- Needs: golden image rebuild (new `orca-sandbox-start`), and Orca Cloud auth minting `orgRole` on sandbox tokens (stablyai/orca-cloud#695). ## GitHub installation binding, guardrails, retention (2026-11-09)