Skip to Content
Xeonr Developer Docs

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.

SurfacePathUsed byCredential
The admin APIhttps://updater.xeonr.io/xeonr.updater.v1.UpdaterService/<Method>The console, updater-cli, your own toolingA Xeonr Auth access token, or a team API key
The update protocolhttps://updater.xeonr.io/<bucket>/…electron-updater, the SDKs, install scripts, browsersNone 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:

ToNeeds
Read apps, releases and artifactsA role in the app's team
Create, change, publish, rescind or delete releases, branches, targets, modules and distributionsA 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 appThe admin role, and the scope upl:bucket:manage
List the team's API keysA role in the team
Create or revoke an API keyThe 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:

AreaMethods an API key may call
The appGetConfig, ListBranches, ListTargets, ListModules
ReleasesListReleases, GetRelease, CreateRelease, UpdateRelease, PublishRelease
Release artifactsListArtifacts, UploadArtifact, ConfirmArtifact
Module releasesListModuleReleases, GetModuleRelease, CreateModuleRelease, UpdateModuleRelease, PublishModuleRelease
Module artifactsListModuleArtifacts, UploadModuleArtifact, ConfirmModuleArtifact
DistributionsListDistributions, 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:

ScopeCarried byNeeded for
updater:apps:readEvery console session; every team API keyListing apps and reading their config, branches, targets, modules, domains, API keys and download stats
updater:apps:editA console session, when the person consented to it at sign-inCreating and deleting apps, and changing their config, branches, targets, modules, domains, logo, signing secret and API keys
updater:releases:readEvery console sessionReading releases, module releases, their artifacts and distributions
updater:releases:editA console session, when the person consented to it at sign-in; every team API keyCreating, 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:

ScopeCarried byNeeded for
upl:uploads:manageA person's token, when they consented to it at sign-inEvery write a person makes
upl:bucket:manageA person's token, when they consented to it at sign-inCreateApp 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

CodeMeaning
unauthenticatedNo credential, or one that is expired, revoked, for another audience or issued to another client. Sign in again, or check the key.
permission_deniedThe 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_foundapp <id> not found: the app does not exist, or belongs to a team the caller is not in. The two are not told apart.
unavailableThe 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.

On this page