Status: Private beta. This page follows the security schemes in selfhost-v1.yaml. The server that enforces them is still being built.
The server has its own keys and roles. There is no Allternit account and no call to an Allternit sign-in service.

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 setup mints the first admin key and prints it once.
  • After that, an admin creates keys with POST /v1/api_keys (name, role, optional expires_at). The ask_... secret is returned once. The server stores only a hash.
  • GET /v1/api_keys lists 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. The aek_... secret is returned once.
  • It can claim work, renew and complete items for its own environment. It gets 403 on /v1/agents and every other non-worker route.
  • DELETE /v1/environments/{id}/keys/{key_id} revokes it at once. Workers using it get 401 on 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

Set auth.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_claim and maps its value through role_map.
  • When no value matches, default_role applies. none refuses the sign-in.
  • /v1/server/info lists oidc in auth_modes when it is set, so clients can offer SSO.
The server fetches your issuer’s discovery document and signing keys, so it needs to reach the issuer URL. See Networking.