Skip to content

Build a console

A console is a client of the gateway’s routes, like a CLI or a script. It holds the user’s IdP token and calls routes by slug. The paths below follow identity’s reference routes.

Send the IdP’s access token as Authorization: Bearer. There are no Plat5 sessions: the same token reaches every tree the user is in (access).

  • GET /user returns the user (name is null until known).
  • PATCH /user { name } sets or clears their name (a user’s name).
  • GET /user/nodes?kind=organization lists every org they can see, for an org switcher. Each node carries its ancestors, so the console builds its own URLs from the chain.

Paths carry slugs: /orgs/acme/projects/web/…. Lists return only what the caller can see, so a project-only member sees their projects rather than a 403 (lists). A filtered page can return fewer than limit items with has_more: true; keep walking until has_more is false (reference/lists.md).

Each page or action maps to the request it needs. Ask the gateway once per page or navigation in a single batch at POST /access/routes:

POST /access/routes
{ "checks": [
{ "method": "GET", "path": "/orgs/acme/bindings" },
{ "method": "POST", "path": "/orgs/acme/projects" },
{ "method": "DELETE", "path": "/orgs/acme/projects/web" }
] }
→ { "checks": [ { "allowed": false }, { "allowed": true }, { "allowed": false } ] }

Ask by route rather than permission name so permission renames in config don’t break the UI (up to 100 checks per call, reference/gateway.md).

GET …/membership on a node (available whenever roles is configured — built-in RBAC or authorizer + roles) returns the caller’s member id, status, active bindings, and (in built-in RBAC) permissions ([] when authorizer is set) — use it to show the caller’s roles and mark “you” in member lists. When authorizer is used without roles, this route returns 404.

Both answers are advisory: the gateway still enforces every request when it is made.

Display error.message (reference/errors.md). Through the gateway, a missing node and a denied one return the same 403; on permission-gated routes, details.permissions lists which permissions would have admitted the call.

When a creation form includes product-specific fields owned by one of your services, submit in two steps: create the node through identity (POST /orgs/acme/projects { display_name }), then PUT the service’s fields to your service’s route for the new node. If the second call fails, keep the form open and retry only the idempotent PUT.

Default identity permissions: Built-in access-management reads (GET …/members, GET …/bindings, GET …/groups, GET …/service-accounts, GET …/security-policy) require <kind>:bindings:read (and writes require <kind>:bindings:write). The default starting plat5.yml grants the member role only <kind>:read, so a member calling GET /<roots>/{root}/members receives 403 unless you grant <kind>:bindings:read to that role in plat5.yml or adjust the route in services/identity.yml. Inspect every expanded route and required permission in services/identity.yml or with plat5 routes list.

  • GET /orgs/{organization}/members lists the org’s non-removed members (active and suspended), with type: "user" | "service_account" (filterable via ?type=). Use PATCH /orgs/{organization}/members/{member_id}/status to reversibly suspend or reactivate a member without rotating their member_id, and DELETE /orgs/{organization}/members/{member_id} to remove a member (works on both users and service accounts).
  • GET/PATCH /orgs/{organization}/security-policy configures org-wide allow_personal_keys, allow_member_keys, allowed_cidrs, and required_idp_claims.
  • GET/POST/PATCH/DELETE /user/keys manages personal user keys ("{brand}-uk-1-…" with optional allowed_roots), GET/POST/PATCH/DELETE /orgs/{organization}/membership/keys manages the caller’s own org-scoped member keys ("{brand}-mk-1-…"), GET/DELETE /orgs/{organization}/members/{member_id}/keys lets org admins inspect and revoke any member’s keys, and …/service-accounts/{id}/keys manages service account keys ("{brand}-mk-1-…"). All keys support optional allowed_cidrs, scopes, and expires_at / expires_in. On POST (201), the one-time secret is returned in "key"; subsequent GET responses omit "key" and return "key_prefix" instead.
  • When roles is configured (roles only or authorizer + roles) — when authorizer is used without roles, these routes return 404:
    • GET …/bindings lists every active binding that counts at the node (member and group) by ID (member_id / group_id, role, inherited, expires_at). A member or group can hold multiple distinct roles on the same node. Removing bindings does not remove the member; they stay active with zero permissions/roles until explicitly removed.
    • GET /orgs/{organization}/groups and …/groups/{group_id}/members manage in-tree groups; bind a group on any node just like a member.
    • GET …/roles lists roles bindable at that node, for role pickers (GET /orgs/{organization}/roles?all=true returns every role in the org). In roles-only mode with custom_roles enabled, GET /orgs/{organization}/permissions populates a custom-role editor and POST/PATCH/DELETE /orgs/{organization}/roles manage custom roles (these custom-role and permission-catalog routes return 404 whenever authorizer is configured).
  • Adding a member by IdP subject (POST /orgs/{organization}/members) is not exposed in the default routes; offer it only when POST /access/routes answers true for it.
  • Invites live at the root: POST /orgs/{organization}/invites. Whenever roles is configured (roles only or authorizer + roles), pass role (bound at the org), grants (roles bound on specific child nodes, for project-only access), or both. When authorizer is used without roles, omit both role and grants. On POST (201), the one-time invite secret is returned in "token" ("{brand}-i-1-…"), while subsequent GET responses return "token_prefix".
  • The invitee redeems with POST /user/invites/redeem sending { "token": "…" }; the response returns { member_id, node } (the root node). Plat5 sends no email.
  • Node deletes are soft until purge_after. List deleted nodes with ?status=deleted, and restore with POST …/restore (lifecycle). Find deleted orgs with GET /user/nodes?kind=organization&status=deleted.
  • DELETE /orgs/{organization}/membership leaves an org. DELETE /user deletes the account.