Skip to Content
Xeonr Developer Docs
Access and tokens

Access and tokens

How branchd decides what a key, a bot or a sign-in may do, and which credential to use for which job.

Every request to branchd, whether through the API, git over HTTPS, the container registry or Go modules, is allowed only when all of these allow it:

  1. Scopes: which features, at which level. Every credential carries scopes such as forge:contents:read (clone) or forge:package:edit (push images). See Scopes and levels.
  2. Resources: which repositories and groups. A credential either reaches everything its owner can, or is limited to named repositories and groups. A group covers everything under it.
  3. The owner's current role. A key or token never does more than the person or bot it belongs to may do today. Lose a role, and every credential you hold loses it at once.

A level such as read or write is only a shortcut for a set of scopes. What a credential stores, and what branchd checks, is always the scopes.

Which credential to use

You want to…Use
Work from your own machine with the branchd CLI, git and Dockerbranchd auth login. It signs you in and keeps the token fresh.
Give one script or tool a narrow login that reaches only some repositoriesA scoped login (--repo, --group, --scopes)
Give a script, CI system or registry client a long-lived credential that acts as youA personal API key (xk_…)
Give automation a credential that belongs to a team, not a personA bot and one of its keys
Let another company's application act for branchd usersOAuth, with the least scopes it needs
Run a job in a branchd pipelineThe job token, already in $BRANCHD_TOKEN

Sending a credential

WhereHow
APIAuthorization: Bearer <token or xk_ key>
git over HTTPSThe key or token as the password. The username is ignored.
Container registry (registry.branchd.run)docker login registry.branchd.run -u token --password-stdin, with the key on stdin. The username is ignored.

On this page