Skip to content

Access Keys: scripts and agents call the API with a user key (0.1.11) - #9

Merged
reoring merged 1 commit into
mainfrom
access-keys
Nov 11, 2026
Merged

reoring merged 1 commit into
mainfrom
access-keys

Conversation

@reoring

@reoring reoring commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Why

Tracker's edge accepted only the browser session cookie. apth tokens got a 302, the Project had no tracker Access Key space, and agents filed issues by signing in headless with a person's credentials.

What

  • catalog/entry.yaml: bearerPassThrough and an accessKeys space (audience tracker, prefix trk, scopes tracker:read / tracker:write), the same shape as agent-guide.
  • cmd/server/internal/api/keys.go (keyActor): an assertion must carry this Project, a user subject, and tracker:read for GET or tracker:write otherwise. The key acts as its user with the Viewer role; the Platform role is not looked up, so Admin-only routes stay with signed-in users.
  • Assertions are never forwarded to Directory: people stay stored snapshots, GET /people answers unavailable, avatars answer 403 key_subject.
  • Raw keys answer 401 raw_key_not_accepted.
  • Contract: design/API.md § Access Keys (v0.1.11); OpenAPI error codes; release version 0.1.11.

Review focus (authentication boundary)

  • The audience is identical in every Project, so the appthrust.io/project claim is the tenant boundary. The avatar route authenticates outside route() and refuses keys separately.
  • A key issued to an Admin user is a Viewer.

Verification

  • go vet ./cmd/..., go test ./cmd/... against a disposable Postgres 17 (TestAccessKeyActsAsItsUserWithinScopeAndProject ran, not skipped), bun test hack.
  • Not verified: the live edge. That needs the 0.1.11 catalog publication and the installation update; the README release steps name the readback (space Ready, exchanged key reads /me).

The edge accepted only the browser session, so agents signed in headless
with a person's credentials to file issues. Declare the tracker Access Key
space (tracker:read, tracker:write) with bearerPassThrough, and accept the
assertion: Project-bound, user subject only, acting as that user with the
Viewer role. Assertions are never forwarded to Directory.
@reoring
reoring merged commit 1821e89 into main Nov 11, 2026
3 checks passed
@reoring
reoring deleted the access-keys branch November 11, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant