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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`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

opened this

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/spend redirects 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/spend returns 200 with the Spend heading, the credential work-plan, the app bob/ledger-app and $12.34. The spend phase is in Server-Timing.
  • Wall clock: spendPage reads new Date() itself, so now can't be passed in. The test pins the clock with setSystemTime and restores it afterwards, so it never reads the real time.
  • Repo seeding: bob's repository is created through core createRepo. The action-level createRepo refused with not_member, because it needs the make-it-yours ability. That ability has nothing to do with this page.

Closes #6856

commented

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/spend redirects 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/spend returns 200 with the Spend heading, the credential work-plan, the app bob/ledger-app and $12.34. The spend phase is in Server-Timing.
  • Wall clock: spendPage reads new Date() itself, so now can't be passed in. The test pins the clock with setSystemTime and restores it afterwards, so it never reads the real time.
  • Repo seeding: bob's repository is created through core createRepo. The action-level createRepo refused with not_member, because it needs the make-it-yours ability. That ability has nothing to do with this page.
Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs