Skip to content

API tokens & service accounts

Entrepot issues its own bearer tokens, prefixed ent_. They work everywhere: the management API, every package client (as Authorization: Bearer or as the password with any username) and the Terraform provider.

  • Tokens are stored as SHA-256 hashes. The secret is shown once, when the token is created.
  • Scopes restrict a token to some of the actions read, write, delete and admin. Without scopes a token can do whatever its owner can. A scoped credential cannot create a broader token.
  • Expiry (expiresInDays) is optional; omit it for no expiry.
  • The API reports a token’s hint (ent_AbCd…wXyZ), lastUsedAt and expiresAt, never the secret.

Create them in the UI (Account → API tokens → Create token) or with the API, authenticated as yourself:

Terminal window
curl -fsS -H "Authorization: Bearer $ENTREPOT_TOKEN" -X POST https://entrepot.example.com/api/v1/tokens \
-d '{"name":"laptop","scopes":["read","write"],"expiresInDays":30}'
{"token":{"id":"…","name":"laptop","hint":"ent_AbCd…wXyZ","scopes":["read","write"],"expiresAt":"…","createdAt":"…"},
"secret":"ent_…"}

List and revoke:

Terminal window
curl -fsS -H "Authorization: Bearer $ENTREPOT_TOKEN" https://entrepot.example.com/api/v1/tokens
curl -fsS -H "Authorization: Bearer $ENTREPOT_TOKEN" -X DELETE https://entrepot.example.com/api/v1/tokens/<id>

Personal tokens act as you: they carry your current group memberships as of your last login.

Service accounts are non-human users for systems that can’t use OIDC or GitLab id_tokens: Jenkins, GitHub Actions, Terraform, build agents. In role bindings they are the subject sa:<name> with subjectType: user.

Terminal window
E=https://entrepot.example.com
curl -fsS -H "Authorization: Bearer $ADMIN" -X POST $E/api/v1/service-accounts \
-d '{"name":"jenkins","description":"Jenkins controller"}'
curl -fsS -H "Authorization: Bearer $ADMIN" -X POST $E/api/v1/role-bindings \
-d '{"role":"developer","subjectType":"user","subject":"sa:jenkins","repositoryPattern":"*"}'
curl -fsS -H "Authorization: Bearer $ADMIN" -X POST $E/api/v1/service-accounts/jenkins/tokens \
-d '{"name":"ci","scopes":["read","write"],"expiresInDays":90}'

Manage them in the UI under Administration → Service accounts. Deleting a service account revokes its tokens.

The bootstrap token (auth.bootstrapToken) is a superuser bearer token for first-time setup and emergencies — see Authentication. It isn’t an ent_ token and can’t be scoped; remove it once administrators can sign in through OIDC.