feat: personal API tokens
Pull request / title (pull_request) Successful in 0s
CI / test (pull_request) Successful in 1m9s
CI / image (apps/api/Dockerfile, t5de-hub-api) (pull_request) Skipped
CI / image (apps/web/Dockerfile, t5de-hub-web) (pull_request) Skipped

Tokens for scripts, made, listed and revoked on the account page. Each grants some of the person's own permissions
at chosen places (a product of theirs, a catalog whose team they're on, or the hub for moderators); every check is
the intersection with what they hold now. Tokens work only on routes that check a permission (session-only routes
answer token_not_allowed), are shown once and stored as hashes, note their last use, and mark the audit entries of
what they do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-11-05 14:58:58 -08:00
1 parent 58a3e70a63
commit 2b88a52bcb
17 files changed
+4358 -98

No files matched your search

+3 -1
View File
@@ -7,7 +7,9 @@ requests and type the website's client (Eden). This is the overview.
- `/api/v1/*`: the hub's own routes.
The website reaches the API through its own origin (Next.js rewrites `/api` to it), so sessions are first-party
cookies. T5DE's proxy calls it directly with `Authorization: Bearer <session token>`.
cookies. T5DE's proxy calls it directly with `Authorization: Bearer <session token>`. Scripts use personal API
tokens (`Authorization: Bearer t5de_pat_...`, docs/console.md): those work only on routes that check a permission
(the rest answer 403 `token_not_allowed`, and a wrong, revoked or expired token 401 `bad_token`).
Errors are `{"error": "<code>", "message": "<text for people>"}` with a 4xx/5xx status; `message` can be shown as
is. Codes: `invalid`, `signed_out`, `forbidden`, `not_found`, `no_such_imvu_account`, `already_linked`,