Skip to Content
Xeonr Developer Docs
Access and tokens

Scopes and levels

branchd's feature scopes, what each one allows, and the read, write, maintain and admin levels that bundle them.

A scope names one feature at one level. The verbs are read, edit and admin, and each implies the ones before it: admin ⊃ edit ⊃ read. Ask for, or issue, only the scopes the job needs. A key that can pull images cannot clone, and a token that can clone cannot push.

The same scopes are checked everywhere: the API, git over HTTPS, the container registry, Go modules and release downloads.

Feature scopes

ScopeAllows
forge:contents:readClone and fetch, read files, commits and blame, compare, fetch Go modules
forge:contents:editPush, and create or delete branches and tags
forge:repository:readRead repositories and their settings
forge:repository:editChange repository settings
forge:repository:adminCreate, delete, rename and transfer repositories; visibility, access and grants, webhooks and mirrors
forge:group:readSee groups and their settings
forge:group:editCreate and change groups, their labels and settings
forge:group:adminA group's access, bots and runner pools
forge:pull-request:readRead pull requests and their comments
forge:pull-request:editOpen, edit, close and comment on pull requests
forge:pull-request:mergeMerge pull requests, where branch rules allow
forge:review:readRead reviews
forge:review:editReview and approve pull requests
forge:check:readRead checks on commits
forge:check:editReport checks on commits. A check reported this way never counts as a required check.
forge:branch-rule:readRead branch rules
forge:branch-rule:editChange branch rules
forge:release:readRead releases and download their assets
forge:release:editCreate, edit and publish releases
forge:package:readPull container images, and see tags and retention
forge:package:editPush container images
forge:package:adminSet and apply retention, and delete images. Deleting also needs a key at the maintain level (it must hold forge:branch-rule:edit).
forge:pipeline:readRead runs, logs and drafts
forge:pipeline:editRun, retry and cancel pipelines, fire schedules, edit drafts
forge:pipeline:adminChange pipeline settings, variables and secrets

Webhooks and mirrors are under forge:repository:admin because both hold or send secrets.

Some scopes are never put on a key: your SSH keys (forge:ssh-key:*), session credentials and your profile. A key can never manage keys, SSH keys, session credentials, bots or access grants, whatever scopes it has.

Levels

A level is a named bundle of scopes, offered by the console and by the CLI's --level as a shortcut. Each level contains the one before it.

LevelAdds
readEvery feature's :read: group, repository, contents, pull-request, review, check, branch-rule, release, package, pipeline
writecontents:edit, pull-request:edit, review:edit, check:edit, release:edit, package:edit, pipeline:edit
maintainpull-request:merge, branch-rule:edit, repository:edit, pipeline:admin
adminrepository:admin, group:edit, group:admin, package:admin

A key below the maintain level stays at write access even where your role is higher. It cannot create or force-update protected branches or tags, or delete images.

Choosing scopes: examples

JobScopes
Clone repositories in CIforge:contents:read
Pull images from the registryforge:package:read
Push imagesforge:package:edit
Publish releases from a buildforge:release:edit, forge:contents:read
Report a status check from an external systemforge:check:edit
A review bot that comments on pull requestsforge:pull-request:edit, forge:contents:read

On this page