Authentication
Login tokens, personal API keys and project keys, and when to use each.
Every authenticated API request sends a token in the Authorization header:
Authorization: Bearer <token>Aperture accepts three kinds of token.
| Login token | Personal API key | Project key | |
|---|---|---|---|
| Get it from | aperture-cli login, POST /signin | Dashboard API Keys, POST /users/keys | Project settings CI Keys, POST /projects/{id}/keys |
| Looks like | JWT | JWT | apk_… |
| Acts as | You | You | The project only |
| Can do | Everything you can | Everything you can, except the websocket | Only its scopes |
| Expires | After 52 weeks | After 52 weeks | Never |
| Revoke | Not possible | Disable or delete the key | Disable, rotate or delete the key |
| Use for | The CLI on your machine, the dashboard | Scripts and integrations | CI/CD pipelines |
Tokens are shown once, when they are created (and, for project keys, when rotated). Aperture stores only a hash.
Project key scopes
A project key works only on its own project, and only for the routes its scopes allow. Scopes are chosen when the key is created and can't be changed.
| Scope | Allows |
|---|---|
deploy | Deploying jobs (POST /jobs/deploy) |
run | Running, scheduling and cancelling (POST /jobs/run, POST /jobs/schedule, PUT /jobs/{execution_id}/cancel) |
read | Listing jobs and reading job details with executions (GET /jobs/project/{project_id}, GET /jobs/{id}/details) |
Every other route rejects project keys with 401, including trigger and
webhook management. Creating, rotating and deleting project keys requires the
owner or admin role.
See Deploying from CI for a full example.
Inbound trigger tokens
Inbound triggers use their own trg_… tokens, which can only
start runs of one job. They aren't accepted anywhere else.