mirror of
https://github.com/nestriness/nestri.git
synced 2026-12-03 12:36:31 +02:00
Starting a device grant takes no secret and costs the caller nothing, so one address could create grants as fast as it liked: rows nobody will ever answer, and a wider target for anyone guessing user codes. Guesses were already limited per address; asking was not. POST /device/authorize now allows 10 requests per address per 10 minutes by default (`deviceVerification.requestLimit` and `requestWindow`), counted the same way as wrong user codes. Past that it answers 429 with `Retry-After` and an OAuth error body using `slow_down`, the code a device client already treats as "wait".
22 lines
962 B
Markdown
22 lines
962 B
Markdown
# Installer sign-in (work in progress; deleted in the final commit)
|
|
|
|
Branch: feat/installer-sign-in
|
|
|
|
## Done
|
|
- 1. installer device client, 15 min, no refresh (engine `clientTTL`, apps/auth `clientTTL`)
|
|
- 2. per-address limit on POST /device/authorize (engine `deviceVerification.requestLimit`), 429 slow_down + Retry-After
|
|
|
|
## Left
|
|
1. issuer: `installer` device client, 15 min access, no refresh token
|
|
2. issuer: per-address limit on POST /device/authorize (10 per 600 s)
|
|
3. issuer: confirm screen wording for `installer`
|
|
4. api: `installer` audience accepted only on POST /machine/install-token
|
|
5. api: 5 install tokens per user per hour, 3 outstanding
|
|
6. api: 10 machines per team, at mint and at registration
|
|
7. 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).
|