mirror of
https://github.com/nestriness/nestri.git
synced 2026-11-26 17:09:52 +02:00
A session the issuer minted for the installer exists to make one call: POST /machine/install-token. The installer runs on a machine that may not belong to the person who approved it, so anything else that session could do with the account is exposure with no use. The auth middleware now refuses a token whose audience is `installer` on every other route with 403 `forbidden`, "This sign-in can only add a host". It is checked once, in the middleware, so a route added later cannot forget it. Tokens for every other audience behave as before.
1.2 KiB
1.2 KiB
Installer sign-in (work in progress; deleted in the final commit)
Branch: feat/installer-sign-in
Done
-
- installer device client, 15 min, no refresh (engine
clientTTL, apps/authclientTTL)
- installer device client, 15 min, no refresh (engine
-
- per-address limit on POST /device/authorize (engine
deviceVerification.requestLimit), 429 slow_down + Retry-After
- per-address limit on POST /device/authorize (engine
-
- confirm wording per client (engine
deviceConfirm, apps/authdeviceConfirm), preview entry
- confirm wording per client (engine
-
- api middleware: aud
installeronly on POST /machine/install-token, else 403 (test: apps/api/test/install-token.test.ts)
- api middleware: aud
Left
- issuer:
installerdevice client, 15 min access, no refresh token - issuer: per-address limit on POST /device/authorize (10 per 600 s)
- issuer: confirm screen wording for
installer - api:
installeraudience accepted only on POST /machine/install-token - api: 5 install tokens per user per hour, 3 outstanding
- api: 10 machines per team, at mint and at registration
- install.sh: token optional
Resume
Test db: postgres://postgres:postgres@127.0.0.1:5434/nestri_installer
(migrate with DATABASE_URL=... bun run db:migrate from the repo root;
run tests with TEST_DATABASE_URL and DATABASE_URL both set to it).