mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-19 17:25:19 +03:00
A program with no browser — the desktop app — had a client for RFC 8628 and nothing to point it at. This serves the other half: a device authorization request that hands back a code, a page a person enters that code on, and a token endpoint that answers the poll. Both of the paths the client already implements are now reachable. Polling faster than the advertised interval gets slow_down, and each warning widens the interval so ignoring one costs more than the last; refusing gets access_denied, so a request nobody started stops instead of being polled until it ages out. The interval is capped, because it only ever grows and a code has to stay pollable for the whole of its life. The codes live in the same storage as the other short-lived grants rather than in a table, since that is what they are. User codes are drawn from an alphabet with no vowels and no look-alike pairs, and are accepted back in whatever case and spacing a person retyped them in.
46 lines
853 B
JSON
46 lines
853 B
JSON
{
|
|
"name": "@nestri/auth",
|
|
"version": "0.0.1",
|
|
"files": [
|
|
"src"
|
|
],
|
|
"type": "module",
|
|
"sideEffects": false,
|
|
"exports": {
|
|
"./ui/code": {
|
|
"types": "./src/ui/code.tsx",
|
|
"import": "./src/ui/code.tsx"
|
|
},
|
|
"./*": {
|
|
"types": "./src/*.ts",
|
|
"import": "./src/*.ts"
|
|
},
|
|
"./**/*": {
|
|
"types": "./src/**/*.ts",
|
|
"import": "./src/**/*.ts"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"build": "bun run script/build.ts",
|
|
"test": "bun test"
|
|
},
|
|
"dependencies": {
|
|
"@standard-schema/spec": "1.0.0-beta.3",
|
|
"aws4fetch": "1.0.20",
|
|
"jose": "5.9.6"
|
|
},
|
|
"devDependencies": {
|
|
"@cloudflare/workers-types": "catalog:",
|
|
"@tsconfig/node22": "catalog:",
|
|
"@types/node": "catalog:",
|
|
"arctic": "2.2.2",
|
|
"hono": "catalog:",
|
|
"typescript": "catalog:",
|
|
"valibot": "1.0.0-beta.15"
|
|
},
|
|
"peerDependencies": {
|
|
"arctic": "^2.2.2",
|
|
"hono": "catalog:"
|
|
}
|
|
}
|