Public: anyone can read this; the crew can change it.

The terminal access-codes screen says when an admin's code acts as admin, and asks before minting one #12483

Merged opened this

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

Merged

The terminal's access-codes screen now marks an admin's codes as acting as admin, and asks for the same confirm on any scope that the web form does. The new test and `bun x tsc --noEmit` pass, and so does `bun scripts/gate.ts`. I ran only `test/tui-signins.test.ts`, not the full suite, which the forge runs on push.

shipped production is serving it deploy 9cda780

opened this

The terminal's access-codes screen now marks an admin's codes as acting as admin, and asks for the same confirm on any scope that the web form does. The new test and bun x tsc --noEmit pass, and so does bun scripts/gate.ts. I ran only test/tui-signins.test.ts, not the full suite, which the forge runs on push.

  • Rows: an admin's token rows now read name · scope · acts as admin, for example carol-ci · ro · acts as admin. An everyday account's rows are unchanged.
  • Minting: when an admin mints in the terminal, ro and rw now meet the same "Make an admin access code" confirm as admin. The confirm names the scope, and cancel is the default. An everyday account still mints ro/rw with no confirm and is still refused admin.
  • Test: test/tui-signins.test.ts has one new test covering both points. It checks the row text for an admin and for an everyday account, that minting ro as admin shows the confirm and then mints, and that the everyday account mints with no confirm.
  • Plan: I did not post a plan on the issue; the keep_plan tool isn't available in this session.
  • Push hook: the pre-push hook refused my first push for lacking a "Try:" commit, so I added an empty commit carrying one.

The change is in src/tui/screens/signins.ts. To try it, open the terminal as an admin, go to Signed in, press m, take the defaults, and the confirm appears.

Closes #12476

commented

The terminal's access-codes screen now marks an admin's codes as acting as admin, and asks for the same confirm on any scope that the web form does. The new test and bun x tsc --noEmit pass, and so does bun scripts/gate.ts. I ran only test/tui-signins.test.ts, not the full suite, which the forge runs on push.

  • Rows: an admin's token rows now read name · scope · acts as admin, for example carol-ci · ro · acts as admin. An everyday account's rows are unchanged.
  • Minting: when an admin mints in the terminal, ro and rw now meet the same "Make an admin access code" confirm as admin. The confirm names the scope, and cancel is the default. An everyday account still mints ro/rw with no confirm and is still refused admin.
  • Test: test/tui-signins.test.ts has one new test covering both points. It checks the row text for an admin and for an everyday account, that minting ro as admin shows the confirm and then mints, and that the everyday account mints with no confirm.
  • Plan: I did not post a plan on the issue; the keep_plan tool isn't available in this session.
  • Push hook: the pre-push hook refused my first push for lacking a "Try:" commit, so I added an empty commit carrying one.

The change is in src/tui/screens/signins.ts. To try it, open the terminal as an admin, go to Signed in, press m, take the defaults, and the confirm appears.

commented

In the terminal's Signed in screen, an admin's access codes now read name · scope · acts as admin. An admin minting any scope (ro, rw or admin) now meets the same "Make an admin access code" confirm that only admin met before. An everyday account's rows and minting are unchanged. ro or rw from an everyday account mints straight away, and admin is still refused.

  • Code: the change is in src/tui/screens/signins.ts. The confirm now names the scope, and cancel is the default.
  • Tests: test/tui-signins.test.ts has one new test that shows both behaviours for an admin and for an everyday account.
  • Check failure fixed: test/tokens-oauth-client.test.ts failed in the forge's check because its account is an admin. Its two expected row strings now include acts as admin; the old expectations were stale, not the code.
  • Not fixed: the six packs mirrors failures in the check passed when I ran test/packs-mirror.test.ts here. I changed nothing for them, and the next check run will show whether they recur.
  • Run here: bun x tsc --noEmit, bun scripts/gate.ts, and the two test files above all pass. I did not run the full suite.

To try it, open the terminal as an admin, go to Signed in and press m. Take the defaults and the confirm appears.

Approved

Clean. The admin flag comes from the verified session user, not client input. Admin rows say acts as admin, and every scope an admin mints goes through the confirm with cancel as the default. An everyday account is unchanged and admin is still refused to it. The new test covers both cases, and the stale expectations in tokens-oauth-client.test.ts are right to change because that account is an admin. No dependency, no secret, and no README change. Not blocking: the header comment line in signins.ts runs long.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs