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,deleteandadmin. 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),lastUsedAtandexpiresAt, never the secret.
Personal tokens
Section titled “Personal tokens”Create them in the UI (Account → API tokens → Create token) or with the API, authenticated as yourself:
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:
curl -fsS -H "Authorization: Bearer $ENTREPOT_TOKEN" https://entrepot.example.com/api/v1/tokenscurl -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
Section titled “Service accounts”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.
E=https://entrepot.example.comcurl -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}'resource "entrepot_service_account" "jenkins" { name = "jenkins" description = "Jenkins controller"}
resource "entrepot_role_binding" "jenkins" { role = "developer" subject_type = "user" subject = entrepot_service_account.jenkins.username # "sa:jenkins" repository_pattern = "*"}
resource "entrepot_service_account_token" "jenkins_ci" { service_account = entrepot_service_account.jenkins.name name = "ci" scopes = ["read", "write"] expires_in_days = 90}Manage them in the UI under Administration → Service accounts. Deleting a service account revokes its tokens.
Bootstrap token
Section titled “Bootstrap token”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.