Permissions
Who may read and write what, how a user becomes a maintainer, passwords and resets, rate limits, API key scopes, and what 401, 403, 409 and 429 mean.
Reads are public. Every write needs a login: a session cookie from /login, or
Authorization: Bearer <token> with a tracker token from node cli.mjs login or an
API key.
Log in
- People sign up and log in at
/signupand/loginwith an email and a password (10 to 256 characters). Logging in with exactlyADMIN_EMAILandADMIN_PASSWORD(.dev.varslocally, wrangler secrets in production) creates that account if needed and makes it an admin. - Link GitHub on
/profile: the page asks for the URL of a secret gist that holds a one-time nonce. A GitHub account that is already linked to another user returns 409; unlink it there first. The linked GitHub login is what the repo owner check compares. - Agents log in with
cli.mjs; see Agent system.
Passwords
- Stored as PBKDF2-SHA256 (100,000 rounds, the most Workers allow) with a per-user salt. With
PASSWORD_PEPPERset, the password is first run through HMAC-SHA256 with that secret, which never enters the database, so a leaked database alone cannot be cracked. Older hashes are upgraded at the next login. - A login for an email with no account takes as long as a wrong password, and both answer the same 401.
- Change it on
/profile(POST /api/auth/password). It needs the current password, logs out every other session, and revokes your API keys only when you tick the box (revoke_tokens). - Forgot it:
/forgot-password(POST /api/auth/password-reset) mails a link that works once, for 30 minutes. The answer is the same whether or not the email has an account. The link opens/reset-password; setting a password there (POST /api/auth/password-reset/confirm) logs out every session, revokes every API key and logs you in.
Rate limits
Every API call counts against a per-minute limit. Over it is 429 rate limited with
Retry-After: 60.
| Calls | Counted per | Limit a minute |
|---|---|---|
| login, signup, link, password change and reset, gist proof | IP | 20 |
| login, link, password change, reset request | 5 | |
| Reddit fetch, fork sync, repo claim and verify | account, else IP | 10 |
| uploads | account, else IP | 20 |
| other writes | account, else IP | 60 |
| reads | IP | 300 |
A logged-in admin is not counted for writes, uploads or calls out to GitHub and Reddit (sync
scripts write hundreds of rows), but is counted for sign-in. The limits are Workers rate-limit bindings (ratelimits in wrangler.jsonc, mirrored in
src/lib/ratebuckets.ts). They count per Cloudflare location, so they are approximate.
Trust levels
Each endpoint has one of these levels. GET /api/docs and the
API reference (x-auth on each operation) list the level of every endpoint.
| Level | Who | Can |
|---|---|---|
| public | anyone | read everything; log in, sign up, run the gist proof |
| login | any logged-in user | claim a device or a repo, withdraw your own claim, manage your keys, link or unlink GitHub |
| maintainer | admin, or a maintainer of that device | set its statuses, update the device, add, sync and update its forks, upload media for it |
| repo | admin, or the maintainer of that repo | update the repo, add claimed support rows and lineage, step down |
| uploader | admin, or who uploaded it | delete an upload |
| poster | admin, or a maintainer of any device | add Reddit posts |
| admin | users.is_admin = 1 | everything, plus review claims, add devices, areas and users, delete rows, set reproduced or merged, kind, base, photos, merged/ported/primary support, run the Reddit fetch |
You maintain a device when you hold an approved claim on it. There are two ways to get one:
- Claim the repo (Maintain a repo): approved at once when your GitHub login owns the repo, or after a proof file (or an admin) otherwise. The approval also makes you a maintainer of the repo's phone.
- Claim the device:
node cli.mjs claim-add <slug> --note "..."(POST /api/claims); an admin approves it (claim-approve). Use this when there is no repo yet.
Rules on top of the levels:
- A fork with no device is admin-only, except for its repo maintainer.
- A maintainer files forks as
fork-claim. Only an admin setsreproducedormerged. - An area with scope
oneios(return-to-oneui,ipc,kernel-mem) only takes writes for a device whosebaseisoneios; anything else is 400area not applicable.
GET /api/auth/me (CLI: whoami) returns maintains (device slugs), maintains_repos,
can_post, is_admin and, with a key, token_scopes.
API key scopes
A key may carry all, read, status:write, fork:write, post:write or media:write. The
scope only narrows the key; your level above still decides. A scope miss is 403
{"error":"token scope","hint":"needs <scope>"}; an expired key is 401. The check runs in one
place, requireUser in src/lib/auth.ts, for every write. API keys lists which
paths need which scope.
Refused requests
Every error is JSON {error, hint}. The CLI prints both.
| Status | Meaning | Example error | Example hint |
|---|---|---|---|
| 401 | not logged in | auth required | POST /api/auth/login with {email,password}, or send Authorization: Bearer <api-token> |
| 401 | bad key | invalid token, token expired | log in again, or create a new key |
| 403 | logged in, not allowed | not a maintainer of s24-ultra | claim this device: POST /api/claims {"device":"s24-ultra"}; ... |
| 403 | key scope | token scope | needs media:write |
| 403 | admin-only action | admin required | only a tracker admin can do this |
| 403 | posting without a claim | maintainers only | posting updates needs an approved claim on any device: ... |
| 400 | OneiOS-only area | area not applicable | ipc only applies to OneiOS-based ports |
| 409 | duplicate claim | claim already pending | claim #12 waits for an admin; DELETE /api/claims/12 to withdraw it |
| 409 | repo taken | repo already maintained | who maintains it and how they step down |
| 409 | duplicate row | device exists, fork already tracked, post already tracked | which endpoint updates it instead |
| 409 | GitHub account taken | github already linked | unlink it from the other user first |
| 410 | reset link spent | reset link expired or used | ask for a new link at /forgot-password |
| 429 | too many calls | rate limited | wait a minute and retry |
A status write checks in this order: 401 anonymous, 404 unknown device, 403 not an editor of that
device (or a key without status:write), 404 unknown area, 400 area not applicable, 400 bad state.
Cookie writes and CSRF
A write with an Origin from another site is refused with 403. A write with the session cookie
must also send Content-Type: application/json or the header X-Requested-With: iosonand (the
site sends it on uploads); when Sec-Fetch-Site is present it must be same-origin or
same-site. Bearer-token clients such as the CLI are not affected.