From 23cb3d4a634c0b04acff808ffde6aa7f0cd06a98 Mon Sep 17 00:00:00 2001 From: vthwang Date: Mon, 3 Aug 2026 13:31:11 -0700 Subject: [PATCH] feat: add co-admins to the platform stack's VTA from the admin panel Signed-off-by: vthwang --- CLAUDE.md | 52 +++ docs/platform-stack-admin-grant-design.md | 427 ++++++++++++++++++ internal/apidocs/openapi.yaml | 185 ++++++++ .../handler/admin_platform_stack_admins.go | 318 +++++++++++++ .../handler/admin_platform_stack_grant.go | 224 +++++++++ .../admin_platform_stack_grant_test.go | 107 +++++ internal/k8s/fullstack_names.go | 9 + internal/model/vta_admin_grant.go | 52 +++ internal/router/router.go | 15 + migrations/000027_vta_admin_grants.down.sql | 3 + migrations/000027_vta_admin_grants.up.sql | 61 +++ 11 files changed, 1453 insertions(+) create mode 100644 docs/platform-stack-admin-grant-design.md create mode 100644 internal/handler/admin_platform_stack_admins.go create mode 100644 internal/handler/admin_platform_stack_grant.go create mode 100644 internal/handler/admin_platform_stack_grant_test.go create mode 100644 internal/model/vta_admin_grant.go create mode 100644 migrations/000027_vta_admin_grants.down.sql create mode 100644 migrations/000027_vta_admin_grants.up.sql diff --git a/CLAUDE.md b/CLAUDE.md index 103ecd3..da010af 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -172,6 +172,8 @@ To create additional admins, an authenticated admin calls `POST /api/v1/admin/ad | `POST` | `/api/v1/admin/setup-sessions/:id/vtc/install-ack` | admin | Admin twin of the user route | | `POST` | `/api/v1/admin/platform-stack` | admin | Create the platform stack: domain row + 4 proxied DNS records + `full_stack` session, in one action. The only route that mints a `domains` row for our own zone | | `GET` | `/api/v1/admin/platform-stack` | admin | Its state, plus the `config_values` to copy into the environment once it's running | +| `GET` | `/api/v1/admin/platform-stack/admins` | admin | What was added from here — a history of grants, not the VTA's admin list (nothing stores a copy of that). Free, stored state only. See "Co-admins on the platform stack" below | +| `POST` | `/api/v1/admin/platform-stack/admins` | admin | Self-service: add a `did:key` as **unrestricted super admin** on that VTA — the same authority the stack's first admin got. **Stops the VTA for ~1 minute**, serialises against itself (409 while another is running). Requires `did`, `label` and `{"confirm": "