• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vocdoni / saas-backend / 28012901941
63%

Build:
DEFAULT BRANCH: main
Ran 23 Jun 2026 08:33AM UTC
Jobs 1
Files 112
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Jun 2026 08:27AM UTC coverage: 61.944% (+0.2%) from 61.746%
28012901941

push

github

altergui
feat(apikeys): scoped API keys for organizations

Add API keys so integrators can call the API programmatically without a JWT
session.

Model & storage: a new apiKeys collection (migration 0013) stores only the
SHA-256 hash of each secret plus a display prefix, scopes, creator, timestamps,
optional expiry and a revoked flag. The plaintext secret (vsk_…) is shown once
at creation. The down migration is a no-op (dropping the collection would
destroy live credentials); keys list most-recent-first.

Auth: the authenticator middleware recognizes a Bearer credential with the vsk_
prefix and resolves it against the apiKeys collection instead of parsing a JWT,
loading the key's owning user into the context so all existing per-organization
role checks work unchanged. Last-used time is stamped best-effort.

Authorization (deny-by-default): API keys are accepted only on an explicit
allowlist of integrator/managed-org endpoints; every other endpoint (auth,
password, OAuth, team/invites, tickets, checkout, API-key management itself, …)
rejects API-key auth. Within the allowlist each route requires a scope
(quota:read, managed:read, managed:write, voting:write, members:write) that the
key must hold.

Endpoints (admin only): POST/GET /organizations/{address}/apikeys and
DELETE /organizations/{address}/apikeys/{keyID}.

Tests cover key generation/hashing, scope validation, the route allowlist, the
storage layer, and the full API lifecycle (create → use within scope → rejected
for missing scope / non-allowlisted endpoint → revoke → 401). Swagger regenerated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

207 of 286 new or added lines in 8 files covered. (72.38%)

9517 of 15364 relevant lines covered (61.94%)

44.13 hits per line

Uncovered Changes

Lines Coverage ∆ File
48
53.4
api/apikeys_handlers.go
13
80.6
db/apikeys.go
8
68.89
10.56% api/middlewares.go
6
77.78
migrations/0013_api_keys.go
2
86.67
api/apicommon/apikeys.go
2
92.86
api/apikeys.go
Jobs
ID Job ID Ran Files Coverage
1 28012901941.1 23 Jun 2026 08:33AM UTC 112
61.94
GitHub Action Run
Source Files on build 28012901941
  • Tree
  • List 112
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • e578c7b0 on github
  • Prev Build on main (#28011667355)
  • Next Build on main (#28024292654)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc