Patrick Buckley
dd8543fce9
fix(admin): add create-admin CLI; stop run.sh onboarding into a role-less user
...
The installer's "Finish setup" told users to run `turnstone-admin create-user`,
which creates a user with no role. Web login derives scopes solely from assigned
roles (empty perms -> read only), so that account logs in read-only and every
admin action fails with "Forbidden: token lacks 'approve' scope". Creating any
user also flips setup_required to false, so the browser first-run wizard -- the
only path that assigns the builtin-admin role -- never appears.
- run.sh: point "Finish setup" at the web setup wizard; use create-admin as the
headless fallback instead of create-user
- admin.py: add `create-admin` -- creates a user + assigns builtin-admin, or
promotes an existing role-less user (idempotent); guards on the seeded admin
role and enforces the wizard's 8-char password floor for fresh accounts
- tests: cover fresh-grant (approve reaches the derived login scope), the
promote/recovery path, idempotency, and both validation exits
Fixes #824
(cherry picked from commit a4876c00e2 )
2026-07-11 19:06:23 -07:00
..
2026-07-11 19:05:48 -07:00
2026-07-08 17:30:55 -07:00
2026-07-11 19:05:36 -07:00
2026-07-05 01:57:54 -07:00
2026-07-04 20:54:20 -07:00
2026-07-03 19:16:16 -07:00
2026-07-11 19:06:23 -07:00
2026-07-11 19:05:48 -07:00
2026-06-16 00:48:14 -07:00
2026-06-16 19:49:31 -07:00
2026-06-15 02:48:50 -07:00
2026-06-15 02:48:50 -07:00
2026-07-11 19:05:48 -07:00
2026-07-11 19:05:48 -07:00
2026-07-11 19:05:36 -07:00
2026-07-08 17:30:55 -07:00
2026-07-05 01:57:54 -07:00
2026-07-05 01:57:54 -07:00
2026-07-05 01:57:54 -07:00
2026-06-27 23:36:24 -07:00
2026-07-01 21:06:31 -07:00
2026-07-05 01:59:38 -07:00
2026-07-05 01:59:38 -07:00
2026-07-03 00:29:26 -07:00
2026-07-08 17:30:55 -07:00
2026-07-02 00:32:11 -07:00
2026-07-03 00:29:26 -07:00
2026-07-08 17:30:55 -07:00
2026-07-05 01:57:54 -07:00
2026-07-08 17:30:55 -07:00
2026-06-26 03:28:06 -07:00
2026-07-06 22:16:20 -07:00
2026-06-26 03:28:06 -07:00
2026-07-05 01:57:54 -07:00
2026-07-08 17:30:55 -07:00
2026-06-16 17:10:12 -07:00
2026-06-17 18:07:45 -07:00
2026-06-26 04:57:20 -07:00
2026-07-05 01:59:38 -07:00
2026-07-05 01:59:38 -07:00
2026-06-26 19:37:01 -07:00
2026-07-03 00:29:26 -07:00
2026-07-03 00:29:26 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-06-16 03:41:51 -07:00
2026-07-08 17:30:56 -07:00
2026-07-11 19:06:23 -07:00
2026-07-11 19:06:22 -07:00
2026-06-30 19:30:20 -07:00
2026-07-06 22:16:20 -07:00
2026-07-06 22:16:20 -07:00
2026-06-25 20:42:22 -07:00
2026-07-04 03:27:55 -07:00
2026-07-03 22:11:15 -07:00
2026-07-04 03:27:55 -07:00
2026-07-04 03:27:55 -07:00
2026-06-17 18:07:45 -07:00
2026-07-06 22:16:20 -07:00
2026-06-17 18:07:45 -07:00
2026-06-17 18:07:45 -07:00
2026-07-06 22:16:20 -07:00
2026-07-06 22:16:20 -07:00
2026-07-06 22:16:20 -07:00
2026-06-26 17:24:06 -07:00
2026-06-26 17:24:06 -07:00
2026-06-26 19:37:01 -07:00
2026-06-26 17:24:06 -07:00
2026-07-03 00:29:26 -07:00
2026-07-04 16:48:52 -07:00
2026-07-08 17:30:56 -07:00
2026-07-06 22:16:21 -07:00
2026-07-11 19:05:36 -07:00
2026-07-06 22:16:21 -07:00
2026-06-15 02:48:50 -07:00
2026-07-04 16:48:52 -07:00
2026-07-06 22:16:21 -07:00
2026-07-08 17:30:55 -07:00
2026-07-06 22:16:20 -07:00
2026-07-11 19:06:23 -07:00
2026-07-06 22:16:21 -07:00
2026-06-16 00:48:14 -07:00
2026-07-02 19:23:04 -07:00
2026-06-16 00:48:14 -07:00
2026-07-03 00:29:26 -07:00
2026-07-06 22:16:20 -07:00
2026-07-06 22:16:20 -07:00
2026-07-03 00:29:26 -07:00
2026-07-06 22:16:20 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-01 18:01:50 -07:00
2026-06-26 17:24:06 -07:00
2026-07-01 18:01:50 -07:00
2026-07-06 22:16:20 -07:00
2026-07-03 19:16:36 -07:00
2026-07-03 00:29:26 -07:00
2026-07-05 01:59:38 -07:00
2026-07-11 19:06:22 -07:00
2026-07-03 00:29:26 -07:00
2026-06-16 00:48:14 -07:00
2026-07-11 19:06:23 -07:00
2026-07-01 21:05:57 -07:00
2026-07-08 17:30:55 -07:00
2026-07-03 00:29:26 -07:00
2026-07-08 17:30:56 -07:00
2026-07-08 17:30:56 -07:00
2026-07-08 17:30:56 -07:00
2026-07-03 00:29:26 -07:00
2026-07-08 17:30:56 -07:00
2026-07-08 17:30:56 -07:00
2026-07-01 21:05:57 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-06 22:16:20 -07:00
2026-07-04 20:54:20 -07:00
2026-07-03 00:29:26 -07:00
2026-07-02 19:23:04 -07:00
2026-06-30 03:47:12 -07:00
2026-07-03 00:29:26 -07:00
2026-06-26 08:38:31 -07:00
2026-07-08 17:30:55 -07:00
2026-07-11 19:06:23 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-11 19:06:23 -07:00
2026-07-03 00:29:26 -07:00
2026-07-08 17:30:55 -07:00
2026-07-03 17:30:33 -07:00
2026-07-03 19:16:36 -07:00
2026-07-03 19:16:36 -07:00
2026-07-03 19:16:36 -07:00
2026-07-03 19:16:36 -07:00
2026-07-08 17:30:56 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-06-28 20:24:20 -07:00
2026-06-28 20:24:20 -07:00
2026-07-03 19:16:36 -07:00
2026-06-16 03:41:51 -07:00
2026-06-16 17:10:12 -07:00
2026-07-01 21:06:31 -07:00
2026-07-11 19:05:36 -07:00
2026-06-16 17:10:12 -07:00
2026-07-11 19:05:36 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-08 17:30:55 -07:00
2026-07-03 19:16:16 -07:00
2026-07-08 17:30:55 -07:00
2026-07-11 19:05:48 -07:00
2026-07-05 01:57:54 -07:00