Public: anyone can read this; the crew can change it.
A test pins Usage › Spend as a forge admin's: a guest is asked to sign in and anyone else is told not found #6887
Check · Review · Land · Live done — Landed and live in production.
`test/spend-tab.test.ts` now pins Usage › Spend (`/settings/spend`) as a forge admin's page. It is a test only, with no source change. The three tests pass and the type check is clean. I did not run `design-lint`, since nothing in `src/web/` changed.
shipped production is serving it deploy 7b21267
test/spend-tab.test.ts now pins Usage › Spend (/settings/spend) as a forge admin's page. It is a test only, with no source change. The three tests pass and the type check is clean. I did not run design-lint, since nothing in src/web/ changed.
- Guest:
/settings/spendredirects to/signin?next=%2Fsettings%2Fspend, and the response carries no figure. - Signed-in non-admin:
bob, who owns an app with seeded spend, gets a 404 not-found page. It has no$12.34, no credential name and no Spend heading. I did not assert that the app name is absent, because the not-found page's command palette lists the user's own repositories. - Forge admin:
/settings/spendreturns 200 with the Spend heading, the credentialwork-plan, the appbob/ledger-appand$12.34. Thespendphase is inServer-Timing.
- Wall clock:
spendPagereadsnew Date()itself, sonowcan't be passed in. The test pins the clock withsetSystemTimeand restores it afterwards, so it never reads the real time. - Repo seeding:
bob's repository is created through corecreateRepo. The action-levelcreateReporefused withnot_member, because it needs the make-it-yours ability. That ability has nothing to do with this page.
Test-only pull that pins /settings/spend: guest redirected to /signin?next=%2Fsettings%2Fspend (confirmed on the preview), non-admin owner gets 404 with no figures, admin sees the credential, app and $12.34. The clock is pinned and restored, the seeding is honest, and the assertions would fail if the gate were dropped. No source or dependency change. Next two things: (1) assert the 404 for a non-admin on the terminal door too if Spend is exposed there; (2) also cover a POST or other method on the route if one exists, so a write cannot slip past the admin check.
test/spend-tab.test.tsnow pins Usage › Spend (/settings/spend) as a forge admin's page. It is a test only, with no source change. The three tests pass and the type check is clean. I did not rundesign-lint, since nothing insrc/web/changed./settings/spendredirects to/signin?next=%2Fsettings%2Fspend, and the response carries no figure.bob, who owns an app with seeded spend, gets a 404 not-found page. It has no$12.34, no credential name and no Spend heading. I did not assert that the app name is absent, because the not-found page's command palette lists the user's own repositories./settings/spendreturns 200 with the Spend heading, the credentialwork-plan, the appbob/ledger-appand$12.34. Thespendphase is inServer-Timing.spendPagereadsnew Date()itself, sonowcan't be passed in. The test pins the clock withsetSystemTimeand restores it afterwards, so it never reads the real time.bob's repository is created through corecreateRepo. The action-levelcreateReporefused withnot_member, because it needs the make-it-yours ability. That ability has nothing to do with this page.Closes #6856