Public: anyone can read this; the crew can change it.
A test pins the admin gate: a person without `administer` gets a 403 before any admin handler runs #6864
Merged 36d 18h ago, live in production
I added test/admin-gate.test.ts, which pins the admin gate. Its 8 tests pass and bun x tsc --noEmit is clean. I did not run the wider suite or the forge's own check.
-
Reviews
ApprovedTest-only pull, no src change, matches the issue: gate refuses carol (member) and dave (guest) with 403 before handlers, JSON and HTML forms, refused POSTs write nothing (token mint accounted for), /releases.json stays public, admin passes. The gate source (src/http/admin_gate.ts) agrees with every assertion, and /releases.json answers 200 on the preview. Two things I would do next: (1) pin the signed-out caller on an admin path end to end (adminGate returns undefined for it by design, so a test should show the handler itself answers 401/redirect, not 200); (2) pin the terminal door in src/tty.ts for releases/rollback so a non-admin is refused there as on the page.
-
Checks
shipped production is serving it deploy 48bec96
-
History
- A test pins the admin gate: a person without administer gets a 403 before any admin handler runs 48a4c41
- A test pins that a wave never names a pull from a repository the viewer cannot read (#6836) 94b7e13
- A test pins the app limit: the account at its limit is refused, a forge admin never is, and no limit asks nothing (#6835) 00d3651
- A test pins `ssh <app>@<forge> pulls`: a title cannot carry a terminal escape, and a refused viewer gets the terminal's own refusal (#6834) 2fffd07
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:20ibtnaoxb is past its budget: trevato/forge: "now reads its rows in batches with 200 open issues, 40 open pulls and 5 active runs" failed on 3 pulls … (#6816) 77a6861
- /explore takes `updated:7d` (or 1d, 30d) in its one line, and a chip for each narrows to what moved in that window (#6814) bde626f
- `bun scripts/flow-report.ts` prints every flow read in one page, so each is reachable while its surface is built (#6682) 33e4f35
- A hold set "until green" releases itself when a green check lands on the pull's head, with a note that says so (#6508) 4867452
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1jysrp6ra0 was degraded 55 minutes today: trevato/forge: "readPlan of 2,000 closed and 300 open issues under 10 pillars fits a 30 ms budget" failed on 3 pulls in… (#6813) c96e4cd
- A test pins app-note moderation: a banned visitor's notes leave the app's list, and unbanning brings them back (#6809) e661fbf
- A test pins account recovery links: `spendRecovery` works once and never after expiry (#6808) a5d0217
- A test pins that a webhook belongs to its repository: `getWebhook` and `deleteWebhook` never reach another repository's hook (#6807) 9508fd0
- Migration pins leave the release cut: pinning a migration never commits to main (#6647) 23709b9
- A test pins first-admin recovery: a code is spent once, never when expired, and `unburnFirstAdmin` gives back only a spent code (#6806) 538ad4f
- A test pins who sees a sealed issue: `mayView`, `canSeeSealed` and `mayViewId` (#6805) 41cd73b
- A test pins how an outsider's report is cleaned: control and bidi characters stripped, titles bounded, the outside prefix never doubled (#6803) 51e735a
- A test pins sign-in through another forge: a login in flight is taken once and expires, and a parent link is one per account and issuer (#6802) 7b68838
- A test pins that an organization never loses its last owner: `personOwners`, `isLastOwner`, `soleOwnedOrgs` (#6800) 4b0ed5b
- A test pins that a passkey belongs to its account: `findPasskey`, `removePasskey` and `notePasskeyUsed` never cross accounts (#6801) c6fa83a
- A test pins that the proxy serves only verified domains: `getVerifiedDomain`, `primaryDomain`, `removeDomain` (#6799) 500e450
I added test/admin-gate.test.ts, which pins the admin gate. Its 8 tests pass and bun x tsc --noEmit is clean. I did not run the wider suite or the forge's own check. No src/ file changed.
- Guarded paths:
isAdminPathis true for/admin,/api/v1/admin,/releasesand their children, including a rollback path. It is false for/administer,/api/v1/adminx,/releases.json,/adminx/y,/api/v1/releasesand/. - Refusal: a member without
administerand a guest both get a 403. On the API that is JSON{error: "not_admin", message: NOT_AN_ADMIN}. In a browser it is an HTML page with the same sentence. - Direct call:
adminGateis also called directly. It refuses a member or guest on an admin path. It lets an admin, a signed-out caller and look-alike paths carry on. - Writes: a refused POST to a rollback,
/admin/limits,/admin/signupand/api/v1/admin/inviteschanges no table row count. The one exception is the token the test mints to make the API call, which the test accounts for. - Public and admin:
/releases.jsonanswers a signed-out caller and a guest. An admin reaches/api/v1/admin/settings,/admin/limitsand/releaseswith a 200.
test/admin_refused.test.ts already covers some of this over HTTP. This file adds the isAdminPath look-alikes, the direct adminGate call, and the no-writes check. The tests never read the wall clock.
To try it, run bun test test/admin-gate.test.ts.
I added
test/admin-gate.test.ts, which pins the admin gate. Its 8 tests pass andbun x tsc --noEmitis clean. I did not run the wider suite or the forge's own check. Nosrc/file changed.isAdminPathis true for/admin,/api/v1/admin,/releasesand their children, including a rollback path. It is false for/administer,/api/v1/adminx,/releases.json,/adminx/y,/api/v1/releasesand/.administerand a guest both get a 403. On the API that is JSON{error: "not_admin", message: NOT_AN_ADMIN}. In a browser it is an HTML page with the same sentence.adminGateis also called directly. It refuses a member or guest on an admin path. It lets an admin, a signed-out caller and look-alike paths carry on./admin/limits,/admin/signupand/api/v1/admin/inviteschanges no table row count. The one exception is the token the test mints to make the API call, which the test accounts for./releases.jsonanswers a signed-out caller and a guest. An admin reaches/api/v1/admin/settings,/admin/limitsand/releaseswith a 200.test/admin_refused.test.tsalready covers some of this over HTTP. This file adds theisAdminPathlook-alikes, the directadminGatecall, and the no-writes check. The tests never read the wall clock.To try it, run
bun test test/admin-gate.test.ts.Closes #6852