Authentication
The credentials the Updater accepts, which API methods each may call, and what a refusal looks like.
The Updater has two surfaces, and each takes its own credentials.
| Surface | Path | Used by | Credential |
|---|---|---|---|
| The admin API | https://updater.xeonr.io/xeonr.updater.v1.UpdaterService/<Method> | The console, updater-cli, your own tooling | A Xeonr Auth access token, or a team API key |
| The update protocol | https://updater.xeonr.io/<bucket>/… | electron-updater, the SDKs, install scripts, browsers | None on a public target; an updater token on a private one |
The admin API is the xeonr.updater.v1 package, served over Connect, so each
method is a POST with a JSON body. The
API reference lists every method, request and response.
The update protocol is plain HTTP and is described in
The update protocol.
The admin API
Send a credential on every call as Authorization: Bearer …. A call without
one, or with one that does not verify, answers unauthenticated.
A person's access token
The console signs people in with Xeonr Auth and calls the API
with their access token. That token must be for the Updater's audience,
https://updater.xeonr.io, and issued to the Updater's own client. A token
for another product, or issued to some other OAuth client, is refused.
A person reaches the apps of the teams they belong to. An app is an upl.im
bucket owned by a team, and what a person may do with it follows their
upl.im role in that team (admin, writer or reader) and the scopes their
token carries:
| To | Needs |
|---|---|
| Read apps, releases and artifacts | A role in the app's team |
| Create, change, publish, rescind or delete releases, branches, targets, modules and distributions | A role that may write the team's uploads, and the scope upl:uploads:manage. Without the scope the answer is this operation requires a user token with bucket permissions. |
| Create or delete an app | The admin role, and the scope upl:bucket:manage |
| List the team's API keys | A role in the team |
| Create or revoke an API key | The admin role (managing a team's API keys needs the admin role in it) |
GetUpdaterMe answers which teams the caller is in, the roles they hold in
each and the scopes their calls carry, so a client can tell in advance what
it may do. It needs a person's token; an API key gets permission_denied.
A team API key
An API key (xk_…) is for pipelines that publish without a person. It is
issued by Xeonr Auth to a team, carries the scopes updater:apps:read and
updater:releases:edit, and is
limited to that team's apps, or to the apps it is bound to.
API keys covers creating, binding and revoking them.
A key can call only the publishing methods, which are marked
allow_api_keys in the API definition:
| Area | Methods an API key may call |
|---|---|
| The app | GetConfig, ListBranches, ListTargets, ListModules |
| Releases | ListReleases, GetRelease, CreateRelease, UpdateRelease, PublishRelease |
| Release artifacts | ListArtifacts, UploadArtifact, ConfirmArtifact |
| Module releases | ListModuleReleases, GetModuleRelease, CreateModuleRelease, UpdateModuleRelease, PublishModuleRelease |
| Module artifacts | ListModuleArtifacts, UploadModuleArtifact, ConfirmModuleArtifact |
| Distributions | ListDistributions, CreateDistribution, UpdateDistribution, UploadDistributionFile, ConfirmDistributionFile |
Every other method answers an API key with permission_denied and the
message permission denied, before the request is looked at. That includes
every delete and rescind, branch, target, module and app settings changes,
the signing secret, domains, download stats, GetArtifactDownloadUrl,
GetUpdaterMe, and the API key methods themselves.
Authentication and scopes
Each admin API method declares, in the API definition, who may call it:
- whether an API key may call it (
allow_api_keys, listed above); - the scopes the caller's token or key must carry.
Every method requires one of the Updater's own four scopes, as
<product>:<resource>:<verb> where edit includes read:
| Scope | Carried by | Needed for |
|---|---|---|
updater:apps:read | Every console session; every team API key | Listing apps and reading their config, branches, targets, modules, domains, API keys and download stats |
updater:apps:edit | A console session, when the person consented to it at sign-in | Creating and deleting apps, and changing their config, branches, targets, modules, domains, logo, signing secret and API keys |
updater:releases:read | Every console session | Reading releases, module releases, their artifacts and distributions |
updater:releases:edit | A console session, when the person consented to it at sign-in; every team API key | Creating, publishing, rescinding and deleting releases and module releases, uploading their artifacts, maintaining distributions |
The Updater keeps an app's files in its upl bucket, so a person's writes also need upl's scopes:
| Scope | Carried by | Needed for |
|---|---|---|
upl:uploads:manage | A person's token, when they consented to it at sign-in | Every write a person makes |
upl:bucket:manage | A person's token, when they consented to it at sign-in | CreateApp and DeleteApp |
A call whose token or key lacks a scope the method needs answers
permission_denied. The API reference shows each
method's requirements as they are served.
Errors
| Code | Meaning |
|---|---|
unauthenticated | No credential, or one that is expired, revoked, for another audience or issued to another client. Sign in again, or check the key. |
permission_denied | The credential is valid but may not do this: an API key on a method it cannot call, a missing scope, a missing team role, or a key bound to other apps (this API key is not bound to app <id>). |
not_found | app <id> not found: the app does not exist, or belongs to a team the caller is not in. The two are not told apart. |
unavailable | The sign-in service or API key lookup did not answer. Retry. |
The update protocol
Public targets need no credential. A private target needs an updater
token: a JWT you mint for your own users, signed (HS256) with the app's
signing secret, whose targets claim lists the target names it opens.
{ "sub": "user-123", "targets": ["beta", "internal"], "exp": 1798761600 }Read or rotate the signing secret in the console's app settings, signed in as a team admin. An API key cannot read it. Keep the secret on your server, mint tokens there, and hand each user only their token.
Send the token as Authorization: Bearer <token>, or as ?token=<token>
where a header cannot be set. The Updater's own access tokens, the ones the
console signs people in with, are accepted on private targets too.
The update protocol covers download tickets, which let a browser download a private file without the token appearing in a URL.