Grants
A grant binds a user to one permission on one target:target_kind is one of credential, host, group, set, backup, or global. target_id is
null for global grants and required for every other kind.
Grants are soft-revoked — revoking sets revoked_at rather than deleting the row, so the trail
survives. A user may hold only one active grant per permission/target combination.
Admins bypass grant resolution entirely.
Groups cascade
A group contains resources, not users. Granting a user a permission on a group cascades to every resource in it at resolve time, so adding a host to a group immediately extends existing group-targeted grants to that host.Groups are groups of resources. Custos has no concept of a user group or team.
Managing a group
group.manage is full authority over the group’s contents: a manager can grant any user, including
themselves, any permission on the group, and it applies to every resource inside. Granting someone
group.manage is therefore delegating control of everything in the group.
Because of that, adding a resource to a group requires full control of the resource: every
permission of its kind (the host, credential, set, or backup list in
GET /permissions), held directly or through another group. Admins
always qualify. Members qualify for credentials, sets, and backup jobs they created, since creators
get every permission on what they make. Hosts grant nothing at enrollment, so in practice an admin
adds them. The resource picker (GET /groups/{id}/available-resources) only offers what you could
add.
Adding is a lasting delegation: the resource stays in the group if the person who added it later
loses their own grants. Remove it from the group to take control back.
Global vs scoped permissions
Creation is global — there is no resource to scope it to yet. Everything else is scoped to a single resource, or to a group containing it.Permission catalogue
GET /permissions returns what can be granted on each target kind, straight from the server’s
catalogue. Clients should build grant pickers from it instead of a hardcoded list, so a new
permission appears everywhere at once.
How host.access reaches a host
Granting or revoking host.access recomputes the affected host’s authorized-key snapshot and pushes
it immediately over the daemon’s live WebSocket — directly for a host target, fanned out for a group
target. Offline hosts reconcile on their next connect.
User status
Suspending a user kills their sessions and pushes fresh snapshots, cutting SSH as well as API access. It is reversible. Removing a user deletes their login identities and revokes their grants and sessions, but keeps the user row, their keys, and their log entries so the audit trail stays readable.Permission requests
A member withoutcredential.read on a credential can request it
(POST /credentials/{id}/permission-requests); an admin reviews it
(PATCH /permission-requests/{id}). Approval creates the grant.