API keys
What a team API key can publish, app-wide versus bound keys, and revoking and rotating them.
An API key lets a pipeline publish with updater-cli without a person signing
in. It is a Xeonr Auth API key with the prefix xk_, owned by a
team and carrying the scopes updater:apps:read and updater:releases:edit. Send it as the CLI's
UPDATER_TOKEN, or as Authorization: Bearer xk_… to the API directly.
Keys are managed on the team's API keys page,
https://updater.xeonr.io/<team>/api-keys.
| Who | |
|---|---|
| See the team's keys | Anyone in the team |
| Create a key | The team's admins |
| Revoke a key | The team's admins |
What a key reaches
A key belongs to one team and only ever reaches that team's apps. Which of them depends on how it was created:
- App-wide. Every app the team owns, now and later.
- Bound. Only the apps it names. Each must be the team's when the key is created.
A request for an app outside the key's reach is refused. For another team's
app the answer is app <id> not found, the same as for an app that does not
exist. For one of the team's apps that a bound key does not name, it is
this API key is not bound to app <id>.
Deleting an app removes it from every key bound to it. A key bound to that app alone is revoked.
What a key can do
A key can do what publishing needs, and nothing that changes how an app is set up.
| A key can | A key cannot |
|---|---|
| Read the app's config, branches, targets and modules | Create, change or delete branches, targets or modules |
| List and read releases and their artifacts | Delete or rescind a release |
| Create, update and publish releases | Change the app's settings or domains |
| Upload and confirm release artifacts | Read or rotate the signing secret |
| Create, update and publish module releases, and upload their artifacts | Create or delete apps |
| List, create and update distributions, and upload their files | Create, list or revoke API keys |
That covers every command updater-cli has. Anything else answers
permission_denied with permission denied.
Authentication lists the
methods a key may call.
Expiry
A key can have an expiry date, set when it is created, or none. It is refused from that moment, and the API keys page shows when it expired. A key's expiry cannot be changed afterwards; create a new key instead.
Revoking a key
On the API keys page, open the key's menu and choose Revoke…. It is refused within about 30 seconds, wherever it is used. Revoking cannot be undone.
Revoke a key as soon as it may have leaked, such as when it was printed in a job log, committed, or held by someone who has left the team. Show revoked lists revoked keys too, with when each was revoked, for the record.
Rotating a key
There is no rotate action. Rotate by overlapping two keys:
- Create a new key with the same reach as the old one.
- Replace the
UPDATER_TOKENCI/CD variable with the new secret. - Run a publish, or
updater-cli config, to check that the new key works. - Revoke the old key.
The page shows when each key was last used, under Last used. If the old key is still being used after step 2, some other pipeline still has it.