Status: Private beta. This page follows the security schemes in
selfhost-v1.yaml. The server that enforces them is still being built.Four kinds of credential
GET /v1/server/info needs no credential, so a client can show the right sign-in screen first. It reveals no secrets.
Roles
A call without a valid credential gets
401 with code unauthorized. A call the role does not allow gets 403 with code forbidden.
Server API keys
allternit-agents-server admin setupmints the first admin key and prints it once.- After that, an admin creates keys with
POST /v1/api_keys(name,role, optionalexpires_at). Theask_...secret is returned once. The server stores only a hash. GET /v1/api_keyslists keys by prefix and metadata, never the secret.DELETE /v1/api_keys/{id}revokes a key at once. The last admin key cannot be revoked (409 last_admin_key).
Environment keys
- An admin creates one with
POST /v1/environments/{id}/keys. Theaek_...secret is returned once. - It can claim work, renew and complete items for its own environment. It gets
403on/v1/agentsand every other non-worker route. DELETE /v1/environments/{id}/keys/{key_id}revokes it at once. Workers using it get401on their next call.- Deleting an environment revokes its keys.
Session secret
A work claim returns a secret that works for that one session until the lease ends. Workers keep it in memory only. See Workers.OIDC sign-in
Setauth.oidc in the settings file to accept id tokens from your identity provider:
- The server checks the token’s issuer and audience against these values.
- It reads the claim named by
role_claimand maps its value throughrole_map. - When no value matches,
default_roleapplies.nonerefuses the sign-in. /v1/server/infolistsoidcinauth_modeswhen it is set, so clients can offer SSO.