From faf1781b93551200790b464d89472827f473b8bf Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Thu, 30 Jul 2026 12:24:55 -0400 Subject: [PATCH 1/2] Phase 4: delete the staff allowlist; the Support role gate fails closed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stored Support role is now the only staff gate (live seed verified 2026-07-30): SUPPORT_STAFF_EMAILS / SUPPORT_STAFF_PRINCIPALS parsing and the legacy staffAccessContext are deleted whole, per the plan's rule that the allowlist must not survive as a quiet second gate. A host wired without a role store answers staff routes 503 support_not_configured; a role-store failure is 503 service_unavailable — never a quiet allow or a misleading 403. Staff UI copy and composition docs updated to role-only. Co-Authored-By: Claude Fable 5 --- docs/ROLE_ADOPTION_PLAN.md | 4 +- docs/SUPPORT_COMPOSITION.md | 11 +- src/pages/staff/support.astro | 8 +- src/pages/staff/support/ticket.astro | 2 +- worker/src/index.ts | 5 +- worker/src/support-access.ts | 83 ------------ worker/src/support-api.test.ts | 183 +++++++++++---------------- worker/src/support-api.ts | 76 +++++------ worker/src/support-desk.ts | 10 -- 9 files changed, 114 insertions(+), 268 deletions(-) diff --git a/docs/ROLE_ADOPTION_PLAN.md b/docs/ROLE_ADOPTION_PLAN.md index bf8774d..cf0822c 100644 --- a/docs/ROLE_ADOPTION_PLAN.md +++ b/docs/ROLE_ADOPTION_PLAN.md @@ -78,11 +78,11 @@ The lockout-safe order proven on retiregolden.org, transplanted: ## Phase 4 — retire the allowlist -- [ ] Delete the allowlist path whole (`SUPPORT_STAFF_EMAILS` / +- [x] Delete the allowlist path whole (`SUPPORT_STAFF_EMAILS` / `SUPPORT_STAFF_PRINCIPALS` parsing and the legacy staff context) — it must not survive as a quiet second gate. After this, a role-store failure is a controlled **503, fail closed, no fallback**. -- [ ] Delete the env vars from the Worker configuration and update +- [x] Delete the env vars from the Worker configuration and update `SUPPORT_COMPOSITION.md`'s staff section to role-only. ## Phase 5 — the shared admin surface (GATED) diff --git a/docs/SUPPORT_COMPOSITION.md b/docs/SUPPORT_COMPOSITION.md index 76f8bd1..731302c 100644 --- a/docs/SUPPORT_COMPOSITION.md +++ b/docs/SUPPORT_COMPOSITION.md @@ -80,11 +80,12 @@ nothing was granted because `Support` was already held through another assignment — so a later revocation stays revoked while the env var lingers. Delete the var once the first operator holds the role. -**Legacy allowlist (Phase 4 deletes it).** `SUPPORT_STAFF_EMAILS` / -`SUPPORT_STAFF_PRINCIPALS` are still honored beside the role path during the -lockout-safe retirement order; if the role store errors, the gate logs and -falls through to the allowlist. Parsing and the legacy resolver are deleted -whole in Phase 4 once the live bootstrap seed is confirmed. +**Fail-closed posture.** The role store is the only gate: a host wired +without one answers staff routes with **503** `support_not_configured`, and a +role-store failure is **503** `service_unavailable` — never a quiet allow or +a misleading 403. The former `SUPPORT_STAFF_EMAILS` / +`SUPPORT_STAFF_PRINCIPALS` allowlist was deleted whole in Phase 4 of +`docs/ROLE_ADOPTION_PLAN.md`. `principalId` is always the Identity principal / account id from the server-side session (`__Host-pegma_session`). Browser-supplied identity fields diff --git a/src/pages/staff/support.astro b/src/pages/staff/support.astro index 5ec40a9..8b9e7ea 100644 --- a/src/pages/staff/support.astro +++ b/src/pages/staff/support.astro @@ -10,8 +10,8 @@ import Base from '../../layouts/Base.astro';

Staff · Support Desk

Support queue

- Review and act on product feedback tickets. Access is limited to operators - listed in the host staff allowlist — this is not a public control plane. + Review and act on product feedback tickets. Access requires the stored + Support operator role — this is not a public control plane.

@@ -30,8 +30,8 @@ import Base from '../../layouts/Base.astro';