Skip to Content
iOSOnAnd docs

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 /signup and /login with an email and a password (10 to 256 characters). Logging in with exactly ADMIN_EMAIL and ADMIN_PASSWORD (.dev.vars locally, 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_PEPPER set, 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.

CallsCounted perLimit a minute
login, signup, link, password change and reset, gist proofIP20
login, link, password change, reset requestemail5
Reddit fetch, fork sync, repo claim and verifyaccount, else IP10
uploadsaccount, else IP20
other writesaccount, else IP60
readsIP300

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.

LevelWhoCan
publicanyoneread everything; log in, sign up, run the gist proof
loginany logged-in userclaim a device or a repo, withdraw your own claim, manage your keys, link or unlink GitHub
maintaineradmin, or a maintainer of that deviceset its statuses, update the device, add, sync and update its forks, upload media for it
repoadmin, or the maintainer of that repoupdate the repo, add claimed support rows and lineage, step down
uploaderadmin, or who uploaded itdelete an upload
posteradmin, or a maintainer of any deviceadd Reddit posts
adminusers.is_admin = 1everything, 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:

  1. 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.
  2. 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 sets reproduced or merged.
  • An area with scope oneios (return-to-oneui, ipc, kernel-mem) only takes writes for a device whose base is oneios; anything else is 400 area 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.

StatusMeaningExample errorExample hint
401not logged inauth requiredPOST /api/auth/login with {email,password}, or send Authorization: Bearer <api-token>
401bad keyinvalid token, token expiredlog in again, or create a new key
403logged in, not allowednot a maintainer of s24-ultraclaim this device: POST /api/claims {"device":"s24-ultra"}; ...
403key scopetoken scopeneeds media:write
403admin-only actionadmin requiredonly a tracker admin can do this
403posting without a claimmaintainers onlyposting updates needs an approved claim on any device: ...
400OneiOS-only areaarea not applicableipc only applies to OneiOS-based ports
409duplicate claimclaim already pendingclaim #12 waits for an admin; DELETE /api/claims/12 to withdraw it
409repo takenrepo already maintainedwho maintains it and how they step down
409duplicate rowdevice exists, fork already tracked, post already trackedwhich endpoint updates it instead
409GitHub account takengithub already linkedunlink it from the other user first
410reset link spentreset link expired or usedask for a new link at /forgot-password
429too many callsrate limitedwait 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.

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.