F1 of the go-live plan (staff admin area at app.breakpilot.com/admin), registry side.
New route group admin, for the portal's service client only:
Route
What
GET /v1/admin/tenants?q=&status=&kind=
search slug, name or admin email (LIKE wildcards escaped); each item carries activity: 30-day usage totals per metric and last audit time, in one query per page
GET /v1/admin/tenants/{id}
tenant, activity, entitlements, subscriptions, licences, latest 25 audit entries, Keycloak members (best effort, members_error on failure)
POST /v1/admin/tenants/{id}/trial {days}
moves the trial end and the trial entitlements; reopens a tenant that an expired trial made read-only, but only if it never had a subscription
POST /v1/admin/tenants/{id}/invites/resend {email}
resends the Keycloak execute-actions mail to an existing member
GET /v1/admin/audit
audit across tenants
Staff attribution:emitAudit records X-Staff-Subject / X-Staff-Email as actor (type staff) when the calling client holds admin. A product client or a user token cannot claim it.
Store: TenantFilter.Query and TenantActivity in memory and Postgres. Keycloak: ResendInvite. OpenAPI documented.
Deploy: add admin to portal-svc-* in AUTHZ_RULES (orca-platform).
Tests: both stores (Postgres via testcontainers), plus a unit test that only admin clients can claim a staff actor.
F1 of the go-live plan (staff admin area at `app.breakpilot.com/admin`), registry side.
New route group `admin`, for the portal's service client only:
| Route | What |
|---|---|
| `GET /v1/admin/tenants?q=&status=&kind=` | search slug, name or admin email (LIKE wildcards escaped); each item carries `activity`: 30-day usage totals per metric and last audit time, in one query per page |
| `GET /v1/admin/tenants/{id}` | tenant, activity, entitlements, subscriptions, licences, latest 25 audit entries, Keycloak members (best effort, `members_error` on failure) |
| `POST /v1/admin/tenants/{id}/trial {days}` | moves the trial end and the trial entitlements; reopens a tenant that an expired trial made read-only, but only if it never had a subscription |
| `POST /v1/admin/tenants/{id}/invites/resend {email}` | resends the Keycloak execute-actions mail to an existing member |
| `GET /v1/admin/audit` | audit across tenants |
**Staff attribution:** `emitAudit` records `X-Staff-Subject` / `X-Staff-Email` as actor (type `staff`) when the calling client holds `admin`. A product client or a user token cannot claim it.
Store: `TenantFilter.Query` and `TenantActivity` in memory and Postgres. Keycloak: `ResendInvite`. OpenAPI documented.
Deploy: add `admin` to `portal-svc-*` in `AUTHZ_RULES` (orca-platform).
Tests: both stores (Postgres via testcontainers), plus a unit test that only admin clients can claim a staff actor.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
A new route group "admin" (the portal's service client only) serves
the staff admin area: tenant search with 30-day usage and last
activity, one detail call with entitlements, subscriptions, licences,
members and recent audit, trial extension (moves trial entitlements
with it and reopens a trial that expired into read-only), invite
resend, and the audit log across tenants.
Changes made from the admin area are audited under the staff member
the portal names in X-Staff-Subject / X-Staff-Email; the header only
counts from a client that holds the admin group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
F1 of the go-live plan (staff admin area at
app.breakpilot.com/admin), registry side.New route group
admin, for the portal's service client only:GET /v1/admin/tenants?q=&status=&kind=activity: 30-day usage totals per metric and last audit time, in one query per pageGET /v1/admin/tenants/{id}members_erroron failure)POST /v1/admin/tenants/{id}/trial {days}POST /v1/admin/tenants/{id}/invites/resend {email}GET /v1/admin/auditStaff attribution:
emitAuditrecordsX-Staff-Subject/X-Staff-Emailas actor (typestaff) when the calling client holdsadmin. A product client or a user token cannot claim it.Store:
TenantFilter.QueryandTenantActivityin memory and Postgres. Keycloak:ResendInvite. OpenAPI documented.Deploy: add
admintoportal-svc-*inAUTHZ_RULES(orca-platform).Tests: both stores (Postgres via testcontainers), plus a unit test that only admin clients can claim a staff actor.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB