Repository navigation
feat(admin): close worker admin support access with scoped capabilities - #9616
pandemicsyn wants to merge 31 commits into
Conversation
…into feat/admin-worker-capability
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe follow-up commit correctly records a denied Assumptions: Files Reviewed (3 files)
Previous Review Summaries (6 snapshots, latest commit 3122785)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3122785)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryThe new user-target town binding correctly closes the cross-user events read, but it denies before the admin decision, so blocked support attempts leave no admin-audit row; the cached-capability expiry regression test is still vacuous. Assumptions: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous review (commit dfaff1d)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe three prior findings are fixed in Assumptions: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (6 files)
Fix these issues in Kilo Cloud Previous review (commit ec160d8)Status: 3 Issues Found | Recommendation: Address before merge Executive SummaryThe incremental fixes close the legacy-elevation audit gap and the in-flight capability widening, but the cache loop can return an entry it has already deleted after expiry, and the town route still hard-codes a Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (18 files)
Previous review (commit 0db16a6)Status: 5 Issues Found | Recommendation: Address before merge Executive SummaryThe highest-risk gap remains in the capability mint path: a capability request still returns a one-hour legacy Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (26 changed files + 1 targeted re-check)
Fix these issues in Kilo Cloud Previous review (commit 22f1d21)Status: 3 Issues Found | Recommendation: Address before merge Executive SummaryThe incremental changes tighten capability scope and minting, but the capability-token path now mints an unscoped legacy admin token without an admin-access audit record, and the previously reported town-target mismatch in Assumptions: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (31 files)
Previous review (commit 58f522a)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryAdmin capability access is silently broken for the user-scoped town-events route, and the Worker read-introspection cache grows without bound over an isolate's lifetime. Assumptions: Overview
Issue Details (click to expand)WARNING| File | Line | Issue | [Snapshot truncated.] Additional previous summary content was truncated to keep this comment within platform limits. Reviewed by deepseek-flash-latest · Input: 62.4K · Output: 12.4K · Cached: 775.4K Review guidance: REVIEW.md from base branch |
…t/admin-worker-capability # Conflicts: # packages/web-shared/src/lib/admin/privileged-inventory.ts
What changes
Part 3 of the admin lockdown stack. Replaces the forgeable
isAdminflag that Gastown and Wasteland use for admin support access with a short-lived (≤ 5 min), signed, per-town capability that web checks live on every use. It ships dormant, so admin access works as today until the switches below are flipped.Services changed:
apps/web,services/gastown,services/wasteland. No other Worker changes.Always on: Workers refuse legacy admin tokens with no expiry or lasting more than 1 hour. Nothing in production issues those.
Before merge / deploy
WORKER_ADMIN_CAPABILITY_PRIVATE_JWKand Worker varWORKER_ADMIN_CAPABILITY_PUBLIC_KEYSon Gastown and Wasteland. Either can stay empty until you enable capabilities.INTERNAL_API_SECRETSecrets Store entry (Wasteland already does).LEGACY_ADMIN_CLAIM_MODE=honor, capability issuance off).To close the gap later (config only, needs #9615 live)
WORKER_ADMIN_CAPABILITY_ISSUANCE=on.WORKER_ADMIN_LEGACY_CLAIM_ISSUANCE=off.LEGACY_ADMIN_CLAIM_MODE=reject.Rollback: Workers back to
honor, then legacy issuance back on.Verification
Automated tests only (worker-utils, Gastown unit and integration, Wasteland, web).
Visual Changes
N/A