@songsid/agend 2.3.5-alpha.11 → 2.3.5-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts-view.d.ts +3 -0
- package/dist/accounts-view.js +2 -2
- package/dist/accounts-view.js.map +1 -1
- package/dist/auth-api.js +12 -28
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.js +16 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/credential-profile.d.ts +16 -0
- package/dist/backend/credential-profile.js +44 -0
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/muse.d.ts +3 -1
- package/dist/backend/muse.js +31 -1
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +12 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/create-host-account.d.ts +17 -0
- package/dist/create-host-account.js +47 -0
- package/dist/create-host-account.js.map +1 -0
- package/dist/daemon.d.ts +23 -0
- package/dist/daemon.js +114 -8
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.js +7 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +32 -8
- package/dist/fleet-manager.js +146 -31
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +1 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +1 -1
- package/dist/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +7 -7
- package/dist/public-web-link.d.ts +5 -0
- package/dist/public-web-link.js +8 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/settings-api.js +5 -17
- package/dist/settings-api.js.map +1 -1
- package/dist/signin-keepalive.d.ts +25 -1
- package/dist/signin-keepalive.js +44 -1
- package/dist/signin-keepalive.js.map +1 -1
- package/dist/ui/accounts-view.js +9 -7
- package/dist/ui/hub-strings.js +6 -6
- package/dist/ui/panel-chat.js +2 -1
- package/dist/ui/panel-fleet.js +7 -1
- package/dist/ui/panel-settings.js +7 -1
- package/dist/ui/settings-access-overview.js +167 -0
- package/dist/ui/settings-access-strings.js +1 -1
- package/dist/ui/settings-devices.js +5 -5
- package/dist/ui/settings-layout.js +3 -1
- package/dist/ui/settings-strings.js +8 -8
- package/dist/ui/shared/app-shell.js +1 -1
- package/dist/ui/shared/app-store.js +2 -0
- package/dist/ui/shared/app.css +50 -12
- package/dist/ui/shared/chat-render.js +17 -5
- package/dist/ui/shared/device-roles.js +1 -1
- package/dist/ui/shared/signin.js +130 -43
- package/dist/ui/shared/usage-dialog.js +27 -15
- package/dist/ui/shared/web-authorize.js +2 -2
- package/dist/ui/signin.html +19 -8
- package/dist/usage/format-rich.js +1 -1
- package/dist/usage/format-rich.js.map +1 -1
- package/dist/usage/usage-api.d.ts +8 -2
- package/dist/usage/usage-api.js +12 -5
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +5 -0
- package/dist/web-api.js +58 -0
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +2 -0
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-remote-access.d.ts +71 -3
- package/dist/web-remote-access.js +197 -6
- package/dist/web-remote-access.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/shared/signin-authenticator.js +0 -60
- package/dist/ui/signin-authenticator.html +0 -60
|
@@ -37,6 +37,8 @@ export interface SignInTarget {
|
|
|
37
37
|
update?: string;
|
|
38
38
|
/** Which account this sign-in is (a masked e-mail and a plan), Claude Code only, from the host's own `claude auth status`. Local administrators only: this list is never served to anyone else. */
|
|
39
39
|
identity?: AccountIdentity;
|
|
40
|
+
/** M-2825: the sign-in's file says it is over (its end date passed, or blanked after a refused refresh): reconnect it. */
|
|
41
|
+
reconnect?: true;
|
|
40
42
|
}
|
|
41
43
|
export interface WebLoginRequester {
|
|
42
44
|
/** The session's handle (web-session.ts): what the sign-in is bound to. */
|
|
@@ -1 +1 @@
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MAAM,GAAG,SAAS,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -19,7 +19,10 @@ export declare const TOTP_PAUSE_MAX_MS: number;
|
|
|
19
19
|
/**
|
|
20
20
|
* #3486 (new-device sign-in with an admin's own authenticator): the wrong-code limits of that sign-in, which are NOT the
|
|
21
21
|
* confirmation limiter above — an unauthenticated route must not be able to pause the confirmations of admins already signed in.
|
|
22
|
-
*
|
|
22
|
+
* The browser types the code alone (AGEND-155): a wrong code with no name belongs to no admin, so it is counted in the browser's
|
|
23
|
+
* limiter and the whole sign-in's only (layers 1 and 4; plus a known device's own, below). Layers 2 and 3 are the legacy path where the
|
|
24
|
+
* request still carries a name (`account`, accepted for compatibility). Four layers, so that one person's typos stop only that person,
|
|
25
|
+
* and the shared ones are only ceilings:
|
|
23
26
|
* 1. **this browser** (first to trip): SIGNIN_BROWSER_WRONG_LIMIT wrong codes pause that browser alone — 5 minutes, doubling up to
|
|
24
27
|
* an hour. Memory only; it counts every failure the same, whatever name was typed;
|
|
25
28
|
* 2. **the admin**, 3. **the name typed** (a name that is no admin's is counted exactly like one that is: nothing tells them apart)
|
|
@@ -34,7 +37,12 @@ export declare const SIGNIN_BROWSER_WRONG_LIMIT = 5;
|
|
|
34
37
|
export declare const SIGNIN_BROWSER_PAUSE_MS: number;
|
|
35
38
|
export declare const SIGNIN_BROWSER_PAUSE_MAX_MS: number;
|
|
36
39
|
export declare const SIGNIN_WRONG_LIMIT = 10;
|
|
37
|
-
|
|
40
|
+
/**
|
|
41
|
+
* The whole sign-in's ceiling: wrong codes, from every browser and every way of typing (with a name or without), before a wait that
|
|
42
|
+
* doubles. Tightened from 50 to 20 when the name went away (AGEND-155, #3486): a code with no name can match any of the N admins who
|
|
43
|
+
* have an app, so one wrong guess is worth N times as much to a guesser — docs/SECURITY.md has the arithmetic.
|
|
44
|
+
*/
|
|
45
|
+
export declare const SIGNIN_FLEET_WRONG_LIMIT = 20;
|
|
38
46
|
/** A shared wrong-code count is forgotten after this long without one (a slow guesser must not escape by pacing); the doubling level drops one step per SIGNIN_LEVEL_QUIET_MS without one. */
|
|
39
47
|
export declare const SIGNIN_COUNT_QUIET_MS: number;
|
|
40
48
|
/** This browser's own count forgets sooner: it only holds that browser. */
|
|
@@ -69,6 +77,25 @@ export declare function matchTotp(secret: Uint8Array, code: string, nowMs: numbe
|
|
|
69
77
|
* TOTP_SKEW_PROBE_STEPS out) it would have matched — positive: the phone is ahead of this computer's clock. Else null.
|
|
70
78
|
*/
|
|
71
79
|
export declare function totpSkew(secret: Uint8Array, code: string, nowMs: number): number | null;
|
|
80
|
+
/**
|
|
81
|
+
* AGEND-155: how far, in time steps either side of now, a code-only sign-in looks at EVERY admin's app, always — the accepted window
|
|
82
|
+
* (k = max(TOTP_PAST_STEPS, TOTP_FUTURE_STEPS) steps), plus the further k..2k a collision is looked for in (below), which also covers
|
|
83
|
+
* the clock-skew probe. 3k = 3 steps, so 2·3+1 = 7 codes (7 HMACs) per admin per request, whatever the code typed is, whether a
|
|
84
|
+
* step was already used and whether the admin may sign in.
|
|
85
|
+
*/
|
|
86
|
+
export declare const TOTP_REACH_STEPS: number;
|
|
87
|
+
/**
|
|
88
|
+
* AGEND-155: an app that is removed or replaced keeps counting, for a short while, in the collision rule — never for anything else.
|
|
89
|
+
* A collision refused at a moment when admin B's app matched must stay refused while the other admin's matching step is still accepted;
|
|
90
|
+
* if B then removes or replaces their app, B's old secret is kept here ("retired", saved with the rest, so a restart keeps it) for
|
|
91
|
+
* (4k+2) steps — 3 minutes — which is longer than any step the refused digits could still be accepted for (at most 4k steps after B's
|
|
92
|
+
* app went). It is read by `signInByCode`'s collision check only: it can never sign anyone in, confirm anything or be asked for.
|
|
93
|
+
* The pool is fleet-wide and a fixed size, always compared in full (padded with decoys), so the work does not depend on how many apps
|
|
94
|
+
* were retired. If more are retired within the keep time than the pool holds, the oldest is dropped and code-only sign-in is
|
|
95
|
+
* refused (as an ordinary wrong code) until that one's keep time would have run out (`holdUntil`): nothing is ever forgotten quietly.
|
|
96
|
+
*/
|
|
97
|
+
export declare const TOTP_RETIRED_KEEP_MS: number;
|
|
98
|
+
export declare const TOTP_RETIRED_SLOTS = 8;
|
|
72
99
|
/** The `otpauth://` URI an authenticator app reads from the QR code (or the key typed in by hand). */
|
|
73
100
|
export declare function otpauthUri(secretBase32: string, account: string): string;
|
|
74
101
|
/** The host operator's key (a web-only fleet's one admin; also a chat fleet's host session). */
|
|
@@ -122,8 +149,11 @@ export interface SignInBegan {
|
|
|
122
149
|
halfFleet: boolean;
|
|
123
150
|
halfAdmin: boolean;
|
|
124
151
|
}
|
|
125
|
-
export type SignInVerdict =
|
|
152
|
+
export type SignInVerdict =
|
|
153
|
+
/** `who`: the admin signed in (the one the typed name stood for; with no name, the one admin the code matched). */
|
|
154
|
+
{
|
|
126
155
|
kind: "ok";
|
|
156
|
+
who: string;
|
|
127
157
|
}
|
|
128
158
|
/** `skewSteps`: for a real admin, the code would have matched that many steps out — this computer's clock is likely off (logged, never answered). */
|
|
129
159
|
| {
|
|
@@ -157,6 +187,8 @@ export declare class WebRemoteAccess {
|
|
|
157
187
|
private browserLim;
|
|
158
188
|
/** #3486: what a sign-in for an identifier that is no admin's is compared with — a secret nobody has, so the work done is the same. */
|
|
159
189
|
private readonly decoySecret;
|
|
190
|
+
/** Test seam (AGEND-155): told of every comparison a code-only sign-in makes — the admin's key, or null for the decoy. Never set in production. */
|
|
191
|
+
compareTrace?: (who: string | null) => void;
|
|
160
192
|
constructor(path: string, log: {
|
|
161
193
|
warn(obj: object, msg?: string): void;
|
|
162
194
|
}, now?: () => number, monotonic?: () => number);
|
|
@@ -166,6 +198,12 @@ export declare class WebRemoteAccess {
|
|
|
166
198
|
private rec;
|
|
167
199
|
/** The state with `who`'s record set (undefined: removed). */
|
|
168
200
|
private withRec;
|
|
201
|
+
/**
|
|
202
|
+
* `state` with `secret` (the app `who` is losing) kept as a retired one for TOTP_RETIRED_KEEP_MS. The host operator's is not kept: a
|
|
203
|
+
* web-only fleet has one admin, so there is no other admin to collide with. When the pool is full its oldest entry is dropped and
|
|
204
|
+
* code-only sign-in is held until that entry's own keep time would have run out.
|
|
205
|
+
*/
|
|
206
|
+
private withRetired;
|
|
169
207
|
status(who?: string): RemoteAccessStatus;
|
|
170
208
|
get enrolled(): boolean;
|
|
171
209
|
/** Whether `who` has an authenticator set up. */
|
|
@@ -246,6 +284,36 @@ export declare class WebRemoteAccess {
|
|
|
246
284
|
key: string;
|
|
247
285
|
known: boolean;
|
|
248
286
|
}): SignInVerdict;
|
|
287
|
+
/**
|
|
288
|
+
* AGEND-155 (#3486): a new browser types ONLY the code; the server works out whose it is. The code is compared with the app of EVERY
|
|
289
|
+
* candidate — each one, every time, three time steps each, never stopping at a match — so the work is the same whoever (or nobody)
|
|
290
|
+
* it belongs to. `candidates` is every admin with an app, `eligible` saying whether they are still an admin of their connection
|
|
291
|
+
* (asked of each by the caller, so that does not stop early either); with none, one comparison with a decoy secret is made. `known`:
|
|
292
|
+
* the admins whose "known device" mark this browser carries (valid as their app and the epoch stand now), `browser.key` the mark's
|
|
293
|
+
* own key when there is one, else the cookie id's.
|
|
294
|
+
* - exactly one candidate matches (eligible, a step newer than their `lastStep`, and — unless this
|
|
295
|
+
* browser is a known device of that admin — no wait in force for the whole sign-in): that admin is signed in and their step spent;
|
|
296
|
+
* - none matches: a wrong code. The same answer — and the same counting — as a code that is right for no one;
|
|
297
|
+
* - two apps match (for a right code, ≈ 3 in 10⁶ per other admin; "match" = the raw codes of the two apps, one in the accepted window and
|
|
298
|
+
* the other within 2k steps of it, whoever has spent what): nobody is signed in, **nothing is spent**, and it is a wrong code in every way:
|
|
299
|
+
* counted in the same counters, answered with the same 401, so neither the answer nor a count says "your code collided with someone's".
|
|
300
|
+
* Not spending the step means a collision cannot be used to burn an admin's step; the person waits for the next code. Because it is a
|
|
301
|
+
* rule on the raw codes, those digits stay refused for as long as any step they matched is still accepted — after a step was spent, an
|
|
302
|
+
* admin was demoted, a limit moved, or one of the two steps aged out — and a restart changes nothing (no state is kept for it).
|
|
303
|
+
* Counting: a wrong code has no admin to blame, so it is counted in this browser's limiter, the whole sign-in's, and — for a known
|
|
304
|
+
* device — in the known-path limiter of each admin whose mark it carries (by mark × admin, as with a name). The per-admin and per-name
|
|
305
|
+
* counts do not apply to it (they stay for a request that still sends a name). What can pause an attempt: this browser's wait and the
|
|
306
|
+
* whole sign-in's (a known device: its mark's and its admins' known-path waits), the same answer for any code. An admin's own ceiling
|
|
307
|
+
* (started only by named attempts) does not apply here: otherwise anyone could block an admin's code-only sign-in by typing wrong
|
|
308
|
+
* codes under that admin's name. A success clears that admin's own counts and
|
|
309
|
+
* this browser's, never the whole sign-in's.
|
|
310
|
+
*/
|
|
311
|
+
signInByCode(code: string, browser: {
|
|
312
|
+
key: string;
|
|
313
|
+
}, candidates: {
|
|
314
|
+
who: string;
|
|
315
|
+
eligible: boolean;
|
|
316
|
+
}[], known: string[]): SignInVerdict;
|
|
249
317
|
/**
|
|
250
318
|
* Saved: true. Not saved: false (warned once until it works again) — memory keeps the new state, and it is written
|
|
251
319
|
* again by the next change or every OUTSIDE_SAVE_RETRY_MS until it is (#3008 review, Prism P2 1).
|
|
@@ -49,7 +49,10 @@ export const TOTP_PAUSE_MAX_MS = 24 * 60 * 60_000;
|
|
|
49
49
|
/**
|
|
50
50
|
* #3486 (new-device sign-in with an admin's own authenticator): the wrong-code limits of that sign-in, which are NOT the
|
|
51
51
|
* confirmation limiter above — an unauthenticated route must not be able to pause the confirmations of admins already signed in.
|
|
52
|
-
*
|
|
52
|
+
* The browser types the code alone (AGEND-155): a wrong code with no name belongs to no admin, so it is counted in the browser's
|
|
53
|
+
* limiter and the whole sign-in's only (layers 1 and 4; plus a known device's own, below). Layers 2 and 3 are the legacy path where the
|
|
54
|
+
* request still carries a name (`account`, accepted for compatibility). Four layers, so that one person's typos stop only that person,
|
|
55
|
+
* and the shared ones are only ceilings:
|
|
53
56
|
* 1. **this browser** (first to trip): SIGNIN_BROWSER_WRONG_LIMIT wrong codes pause that browser alone — 5 minutes, doubling up to
|
|
54
57
|
* an hour. Memory only; it counts every failure the same, whatever name was typed;
|
|
55
58
|
* 2. **the admin**, 3. **the name typed** (a name that is no admin's is counted exactly like one that is: nothing tells them apart)
|
|
@@ -64,7 +67,12 @@ export const SIGNIN_BROWSER_WRONG_LIMIT = 5;
|
|
|
64
67
|
export const SIGNIN_BROWSER_PAUSE_MS = 5 * 60_000;
|
|
65
68
|
export const SIGNIN_BROWSER_PAUSE_MAX_MS = 60 * 60_000;
|
|
66
69
|
export const SIGNIN_WRONG_LIMIT = 10;
|
|
67
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The whole sign-in's ceiling: wrong codes, from every browser and every way of typing (with a name or without), before a wait that
|
|
72
|
+
* doubles. Tightened from 50 to 20 when the name went away (AGEND-155, #3486): a code with no name can match any of the N admins who
|
|
73
|
+
* have an app, so one wrong guess is worth N times as much to a guesser — docs/SECURITY.md has the arithmetic.
|
|
74
|
+
*/
|
|
75
|
+
export const SIGNIN_FLEET_WRONG_LIMIT = 20;
|
|
68
76
|
/** A shared wrong-code count is forgotten after this long without one (a slow guesser must not escape by pacing); the doubling level drops one step per SIGNIN_LEVEL_QUIET_MS without one. */
|
|
69
77
|
export const SIGNIN_COUNT_QUIET_MS = 24 * 60 * 60_000;
|
|
70
78
|
/** This browser's own count forgets sooner: it only holds that browser. */
|
|
@@ -169,6 +177,30 @@ export function totpSkew(secret, code, nowMs) {
|
|
|
169
177
|
}
|
|
170
178
|
return null;
|
|
171
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* AGEND-155: how far, in time steps either side of now, a code-only sign-in looks at EVERY admin's app, always — the accepted window
|
|
182
|
+
* (k = max(TOTP_PAST_STEPS, TOTP_FUTURE_STEPS) steps), plus the further k..2k a collision is looked for in (below), which also covers
|
|
183
|
+
* the clock-skew probe. 3k = 3 steps, so 2·3+1 = 7 codes (7 HMACs) per admin per request, whatever the code typed is, whether a
|
|
184
|
+
* step was already used and whether the admin may sign in.
|
|
185
|
+
*/
|
|
186
|
+
export const TOTP_REACH_STEPS = Math.max(3 * Math.max(TOTP_PAST_STEPS, TOTP_FUTURE_STEPS), TOTP_SKEW_PROBE_STEPS);
|
|
187
|
+
/**
|
|
188
|
+
* AGEND-155: an app that is removed or replaced keeps counting, for a short while, in the collision rule — never for anything else.
|
|
189
|
+
* A collision refused at a moment when admin B's app matched must stay refused while the other admin's matching step is still accepted;
|
|
190
|
+
* if B then removes or replaces their app, B's old secret is kept here ("retired", saved with the rest, so a restart keeps it) for
|
|
191
|
+
* (4k+2) steps — 3 minutes — which is longer than any step the refused digits could still be accepted for (at most 4k steps after B's
|
|
192
|
+
* app went). It is read by `signInByCode`'s collision check only: it can never sign anyone in, confirm anything or be asked for.
|
|
193
|
+
* The pool is fleet-wide and a fixed size, always compared in full (padded with decoys), so the work does not depend on how many apps
|
|
194
|
+
* were retired. If more are retired within the keep time than the pool holds, the oldest is dropped and code-only sign-in is
|
|
195
|
+
* refused (as an ordinary wrong code) until that one's keep time would have run out (`holdUntil`): nothing is ever forgotten quietly.
|
|
196
|
+
*/
|
|
197
|
+
export const TOTP_RETIRED_KEEP_MS = (4 * Math.max(TOTP_PAST_STEPS, TOTP_FUTURE_STEPS) + 2) * TOTP_STEP_SECONDS * 1000;
|
|
198
|
+
export const TOTP_RETIRED_SLOTS = 8;
|
|
199
|
+
/** The codes of one app for every step from now−TOTP_REACH_STEPS to now+TOTP_REACH_STEPS (index 0 is the earliest): fixed work, no early exit. */
|
|
200
|
+
function codeReach(secret, nowMs) {
|
|
201
|
+
const first = totpStep(nowMs) - TOTP_REACH_STEPS;
|
|
202
|
+
return Array.from({ length: 2 * TOTP_REACH_STEPS + 1 }, (_, i) => hotp(secret, first + i));
|
|
203
|
+
}
|
|
172
204
|
/** The `otpauth://` URI an authenticator app reads from the QR code (or the key typed in by hand). */
|
|
173
205
|
export function otpauthUri(secretBase32, account) {
|
|
174
206
|
const label = encodeURIComponent(`AgEnD:${account}`);
|
|
@@ -231,6 +263,8 @@ export class WebRemoteAccess {
|
|
|
231
263
|
browserLim = new Map();
|
|
232
264
|
/** #3486: what a sign-in for an identifier that is no admin's is compared with — a secret nobody has, so the work done is the same. */
|
|
233
265
|
decoySecret = randomBytes(SECRET_BYTES);
|
|
266
|
+
/** Test seam (AGEND-155): told of every comparison a code-only sign-in makes — the admin's key, or null for the decoy. Never set in production. */
|
|
267
|
+
compareTrace;
|
|
234
268
|
constructor(path, log, now = Date.now, monotonic = () => performance.now()) {
|
|
235
269
|
this.path = path;
|
|
236
270
|
this.log = log;
|
|
@@ -260,6 +294,12 @@ export class WebRemoteAccess {
|
|
|
260
294
|
}
|
|
261
295
|
const count = (n) => (Number.isSafeInteger(n) && n >= 0 ? n : 0);
|
|
262
296
|
const signin = readLimWith(v.signin, SIGNIN_FLEET_WRONG_LIMIT);
|
|
297
|
+
const now0 = this.now();
|
|
298
|
+
const retired = (Array.isArray(v.retired) ? v.retired : []).filter((r) => !!r && typeof r === "object"
|
|
299
|
+
&& typeof r.who === "string" && r.who.length <= 400 && typeof r.secret === "string"
|
|
300
|
+
&& (base32Decode(r.secret)?.length ?? 0) >= 16 && Number.isSafeInteger(r.until)
|
|
301
|
+
&& r.until > now0 && r.until <= now0 + TOTP_RETIRED_KEEP_MS).slice(-TOTP_RETIRED_SLOTS);
|
|
302
|
+
const holdUntil = Number.isSafeInteger(v.holdUntil) && v.holdUntil > now0 ? Math.min(v.holdUntil, now0 + TOTP_RETIRED_KEEP_MS) : 0;
|
|
263
303
|
const idents = {};
|
|
264
304
|
if (v.idents && typeof v.idents === "object" && !Array.isArray(v.idents)) {
|
|
265
305
|
for (const [k, l] of Object.entries(v.idents).slice(-SIGNIN_IDENT_MAX)) {
|
|
@@ -269,6 +309,7 @@ export class WebRemoteAccess {
|
|
|
269
309
|
}
|
|
270
310
|
}
|
|
271
311
|
this.state = { v: 1, ...(totp ? { totp } : {}), ...(Object.keys(admins).length ? { admins } : {}), ...(signin ? { signin } : {}), ...(Object.keys(idents).length ? { idents } : {}),
|
|
312
|
+
...(retired.length ? { retired } : {}), ...(holdUntil ? { holdUntil } : {}),
|
|
272
313
|
// Never on without an app set up: a file that says otherwise is read as off.
|
|
273
314
|
outside: v.outside === true && !!totp,
|
|
274
315
|
wrong: Math.min(count(v.wrong), TOTP_WRONG_LIMIT - 1), level: Math.min(count(v.level), 32),
|
|
@@ -299,6 +340,22 @@ export class WebRemoteAccess {
|
|
|
299
340
|
delete admins[who];
|
|
300
341
|
return { ...rest, ...(Object.keys(admins).length ? { admins } : {}) };
|
|
301
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* `state` with `secret` (the app `who` is losing) kept as a retired one for TOTP_RETIRED_KEEP_MS. The host operator's is not kept: a
|
|
345
|
+
* web-only fleet has one admin, so there is no other admin to collide with. When the pool is full its oldest entry is dropped and
|
|
346
|
+
* code-only sign-in is held until that entry's own keep time would have run out.
|
|
347
|
+
*/
|
|
348
|
+
withRetired(state, who, secret) {
|
|
349
|
+
if (who === HOST_ADMIN_KEY)
|
|
350
|
+
return state;
|
|
351
|
+
const now = this.now(), live = (state.retired ?? []).filter(r => r.until > now);
|
|
352
|
+
let hold = state.holdUntil && state.holdUntil > now ? state.holdUntil : 0;
|
|
353
|
+
while (live.length >= TOTP_RETIRED_SLOTS)
|
|
354
|
+
hold = Math.max(hold, live.shift().until);
|
|
355
|
+
live.push({ who, secret, until: now + TOTP_RETIRED_KEEP_MS });
|
|
356
|
+
const { holdUntil: _old, ...rest } = state;
|
|
357
|
+
return { ...rest, retired: live, ...(hold ? { holdUntil: hold } : {}) };
|
|
358
|
+
}
|
|
302
359
|
status(who = HOST_ADMIN_KEY) {
|
|
303
360
|
const r = this.rec(who);
|
|
304
361
|
return { enrolled: !!r, enrolledAt: r?.enrolledAt ?? null, outside: this.state.outside, strict: !!r?.strict,
|
|
@@ -404,7 +461,8 @@ export class WebRemoteAccess {
|
|
|
404
461
|
// wrong-code pause is reset only by an enrolment made on the AgEnD computer itself (`physicalHost`, the caller's proof of where
|
|
405
462
|
// it came from): the host operator's identity used remotely — a host cookie on another device — never clears it.
|
|
406
463
|
const reset = p.who === HOST_ADMIN_KEY && opts.physicalHost === true;
|
|
407
|
-
this.state = p.who === HOST_ADMIN_KEY ? { ...this.withRec(this.state, p.who, rec), ...(reset ? { wrong: 0, level: 0, pausedUntil: 0 } : {}), handles: [] }
|
|
464
|
+
this.state = p.who === HOST_ADMIN_KEY ? { ...this.withRec(this.state, p.who, rec), ...(reset ? { wrong: 0, level: 0, pausedUntil: 0 } : {}), handles: [] }
|
|
465
|
+
: this.withRec(old ? this.withRetired(this.state, p.who, old.secret) : this.state, p.who, rec);
|
|
408
466
|
if (!this.flush()) {
|
|
409
467
|
// Not set up: the state before stands — and if it was itself still owed to the disk (an unsaved Off), it still is.
|
|
410
468
|
this.restore(before, wasDirty);
|
|
@@ -420,9 +478,11 @@ export class WebRemoteAccess {
|
|
|
420
478
|
* saved yet (retried — a restart before that would read the old file).
|
|
421
479
|
*/
|
|
422
480
|
remove(who = HOST_ADMIN_KEY) {
|
|
423
|
-
|
|
481
|
+
const old = this.rec(who);
|
|
482
|
+
if (!old)
|
|
424
483
|
return true;
|
|
425
|
-
this.state = who === HOST_ADMIN_KEY ? { ...blank(), ...(this.state.admins ? { admins: this.state.admins } : {}), ...(this.state.signin ? { signin: this.state.signin } : {}), ...(this.state.idents ? { idents: this.state.idents } : {})
|
|
484
|
+
this.state = who === HOST_ADMIN_KEY ? { ...blank(), ...(this.state.admins ? { admins: this.state.admins } : {}), ...(this.state.signin ? { signin: this.state.signin } : {}), ...(this.state.idents ? { idents: this.state.idents } : {}),
|
|
485
|
+
...(this.state.retired ? { retired: this.state.retired } : {}), ...(this.state.holdUntil ? { holdUntil: this.state.holdUntil } : {}) } : this.withRec(this.withRetired(this.state, who, old.secret), who, undefined);
|
|
426
486
|
return this.flush();
|
|
427
487
|
}
|
|
428
488
|
/**
|
|
@@ -511,7 +571,7 @@ export class WebRemoteAccess {
|
|
|
511
571
|
this.browserLim.set(browser.key, beforeBrowser);
|
|
512
572
|
return { kind: "unavailable" };
|
|
513
573
|
}
|
|
514
|
-
return { kind: "ok" };
|
|
574
|
+
return { kind: "ok", who };
|
|
515
575
|
}
|
|
516
576
|
// Wrong, or no such admin, or the admin's ceiling: the same counters, the same write — and the same clock-skew look (the decoy when there is no admin).
|
|
517
577
|
const skew = totpSkew(secret, code, now);
|
|
@@ -540,6 +600,137 @@ export class WebRemoteAccess {
|
|
|
540
600
|
const started = Math.max(w.wait, ...(known ? [k.wait] : [f.wait, i.wait]));
|
|
541
601
|
return started > 0 ? { kind: "paused", retryAfterMs: started, began } : { kind: "wrong", ...(rec && skew !== null ? { skewSteps: skew } : {}), began };
|
|
542
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* AGEND-155 (#3486): a new browser types ONLY the code; the server works out whose it is. The code is compared with the app of EVERY
|
|
605
|
+
* candidate — each one, every time, three time steps each, never stopping at a match — so the work is the same whoever (or nobody)
|
|
606
|
+
* it belongs to. `candidates` is every admin with an app, `eligible` saying whether they are still an admin of their connection
|
|
607
|
+
* (asked of each by the caller, so that does not stop early either); with none, one comparison with a decoy secret is made. `known`:
|
|
608
|
+
* the admins whose "known device" mark this browser carries (valid as their app and the epoch stand now), `browser.key` the mark's
|
|
609
|
+
* own key when there is one, else the cookie id's.
|
|
610
|
+
* - exactly one candidate matches (eligible, a step newer than their `lastStep`, and — unless this
|
|
611
|
+
* browser is a known device of that admin — no wait in force for the whole sign-in): that admin is signed in and their step spent;
|
|
612
|
+
* - none matches: a wrong code. The same answer — and the same counting — as a code that is right for no one;
|
|
613
|
+
* - two apps match (for a right code, ≈ 3 in 10⁶ per other admin; "match" = the raw codes of the two apps, one in the accepted window and
|
|
614
|
+
* the other within 2k steps of it, whoever has spent what): nobody is signed in, **nothing is spent**, and it is a wrong code in every way:
|
|
615
|
+
* counted in the same counters, answered with the same 401, so neither the answer nor a count says "your code collided with someone's".
|
|
616
|
+
* Not spending the step means a collision cannot be used to burn an admin's step; the person waits for the next code. Because it is a
|
|
617
|
+
* rule on the raw codes, those digits stay refused for as long as any step they matched is still accepted — after a step was spent, an
|
|
618
|
+
* admin was demoted, a limit moved, or one of the two steps aged out — and a restart changes nothing (no state is kept for it).
|
|
619
|
+
* Counting: a wrong code has no admin to blame, so it is counted in this browser's limiter, the whole sign-in's, and — for a known
|
|
620
|
+
* device — in the known-path limiter of each admin whose mark it carries (by mark × admin, as with a name). The per-admin and per-name
|
|
621
|
+
* counts do not apply to it (they stay for a request that still sends a name). What can pause an attempt: this browser's wait and the
|
|
622
|
+
* whole sign-in's (a known device: its mark's and its admins' known-path waits), the same answer for any code. An admin's own ceiling
|
|
623
|
+
* (started only by named attempts) does not apply here: otherwise anyone could block an admin's code-only sign-in by typing wrong
|
|
624
|
+
* codes under that admin's name. A success clears that admin's own counts and
|
|
625
|
+
* this browser's, never the whole sign-in's.
|
|
626
|
+
*/
|
|
627
|
+
signInByCode(code, browser, candidates, known) {
|
|
628
|
+
const now = this.now(), fleet = settle(this.state.signin ?? NO_LIM, now);
|
|
629
|
+
const byBrowser = settle(this.browserLim.get(browser.key) ?? NO_LIM, now, SIGNIN_BROWSER_QUIET_MS);
|
|
630
|
+
const marks = known.filter((w, i) => known.indexOf(w) === i && this.rec(w));
|
|
631
|
+
const isKnown = marks.length > 0;
|
|
632
|
+
const knownLim = (w) => settle(this.rec(w)?.klim ?? NO_LIM, now);
|
|
633
|
+
const waits = [byBrowser.pausedUntil, ...(isKnown ? marks.map(w => knownLim(w).pausedUntil) : [fleet.pausedUntil])].map(p => Math.min(p - now, TOTP_PAUSE_MAX_MS));
|
|
634
|
+
const wait = Math.max(...waits);
|
|
635
|
+
const idle = { fleet: false, admin: false, waitMs: 0, halfFleet: false, halfAdmin: false };
|
|
636
|
+
if (wait > 0)
|
|
637
|
+
return { kind: "paused", retryAfterMs: wait, began: idle };
|
|
638
|
+
// Every candidate, always, the same work: all TOTP_REACH_STEPS-each-side codes of their app (7 HMACs), compared in full, no early exit;
|
|
639
|
+
// only afterwards is anything decided by what was spent, who may sign in here, and what is open. With no app at all, one app's worth
|
|
640
|
+
// of work is done with a decoy secret.
|
|
641
|
+
const typed = code.replace(/\s/g, ""), valid = /^\d{6}$/.test(typed), R = TOTP_REACH_STEPS, at = totpStep(now), k = Math.max(TOTP_PAST_STEPS, TOTP_FUTURE_STEPS);
|
|
642
|
+
const same = (candidate) => timingSafeEqual(Buffer.from(candidate), Buffer.from(valid ? typed : "x".repeat(candidate.length))) && valid;
|
|
643
|
+
const rows = [];
|
|
644
|
+
for (const c of candidates) {
|
|
645
|
+
const rec = this.rec(c.who);
|
|
646
|
+
if (!rec)
|
|
647
|
+
continue;
|
|
648
|
+
this.compareTrace?.(c.who);
|
|
649
|
+
rows.push({ who: c.who, eligible: c.eligible, lastStep: rec.lastStep, eq: codeReach(base32Decode(rec.secret), now).map(same) });
|
|
650
|
+
}
|
|
651
|
+
const compared = rows.length > 0;
|
|
652
|
+
if (!compared) {
|
|
653
|
+
this.compareTrace?.(null);
|
|
654
|
+
codeReach(this.decoySecret, now).map(same);
|
|
655
|
+
}
|
|
656
|
+
// The retired apps (see TOTP_RETIRED_KEEP_MS): a fixed number of slots, every one compared in full — an empty slot with a decoy — so the work is the
|
|
657
|
+
// same whatever has been removed or replaced. They take part in the collision check below and in nothing else.
|
|
658
|
+
const retired = (this.state.retired ?? []).filter(r => r.until > now).slice(-TOTP_RETIRED_SLOTS);
|
|
659
|
+
for (let slot = 0; slot < TOTP_RETIRED_SLOTS; slot++) {
|
|
660
|
+
const r = retired[slot];
|
|
661
|
+
const eq = codeReach(r ? base32Decode(r.secret) : this.decoySecret, now).map(same);
|
|
662
|
+
if (r)
|
|
663
|
+
rows.push({ who: r.who, eligible: false, lastStep: Number.MAX_SAFE_INTEGER, eq, retired: true });
|
|
664
|
+
}
|
|
665
|
+
const accepted = (i) => i - R >= -TOTP_PAST_STEPS && i - R <= TOTP_FUTURE_STEPS;
|
|
666
|
+
// A code that matches TWO admins' apps — in the accepted window for one, within 2k steps of it for the other — is refused, whatever has
|
|
667
|
+
// happened to either since: spent steps, demotion, limits and time (while any of the steps it matched is still accepted) do not
|
|
668
|
+
// matter, because only the raw codes of the apps are looked at. It needs no memory, so a restart cannot lose it. Without this a refused
|
|
669
|
+
// collision could be used later (after one admin spent their step, or after one of the steps aged out) to sign the same digits in as the other.
|
|
670
|
+
let ambiguous = (this.state.holdUntil ?? 0) > now; // a retired app that was still needed had to be dropped: refused until its keep time is over
|
|
671
|
+
for (const x of rows)
|
|
672
|
+
for (const y of rows) {
|
|
673
|
+
if (x.who === y.who)
|
|
674
|
+
continue; // one admin's old and new app do not collide with each other
|
|
675
|
+
for (let i = 0; i < x.eq.length; i++)
|
|
676
|
+
for (let j = 0; j < y.eq.length; j++)
|
|
677
|
+
ambiguous = ambiguous || (accepted(i) && x.eq[i] && y.eq[j] && Math.abs(i - j) <= 2 * k);
|
|
678
|
+
}
|
|
679
|
+
const hits = [], skews = [];
|
|
680
|
+
for (const r of rows) {
|
|
681
|
+
if (r.retired)
|
|
682
|
+
continue; // never a way in
|
|
683
|
+
let step = null;
|
|
684
|
+
for (let i = 0; i < r.eq.length; i++)
|
|
685
|
+
if (step === null && accepted(i) && r.eq[i] && at + i - R > r.lastStep)
|
|
686
|
+
step = at + i - R;
|
|
687
|
+
// A known device is not held by the whole sign-in's wait for its own admin; for anyone else it is (the wait was not checked above).
|
|
688
|
+
// The admin's own ceiling (started by named attempts) is not read: it holds the named path only.
|
|
689
|
+
const open = marks.includes(r.who) || fleet.pausedUntil <= now;
|
|
690
|
+
if (step !== null && r.eligible && open && !ambiguous)
|
|
691
|
+
hits.push(r.who);
|
|
692
|
+
else
|
|
693
|
+
for (let i = 0; i < r.eq.length; i++)
|
|
694
|
+
if (r.eq[i] && !accepted(i) && Math.abs(i - R) <= TOTP_SKEW_PROBE_STEPS)
|
|
695
|
+
skews.push(i - R); // the clock-skew look: log only
|
|
696
|
+
}
|
|
697
|
+
if (hits.length === 1) {
|
|
698
|
+
const who = hits[0], rec = this.rec(who), row = rows.find(r => r.who === who);
|
|
699
|
+
let step = -1;
|
|
700
|
+
for (let i = 0; i < row.eq.length; i++)
|
|
701
|
+
if (step < 0 && accepted(i) && row.eq[i] && at + i - R > rec.lastStep)
|
|
702
|
+
step = at + i - R;
|
|
703
|
+
const before = this.state, beforeBrowser = this.browserLim.get(browser.key);
|
|
704
|
+
const { lim: _lim, klim: _klim, ...clean } = rec;
|
|
705
|
+
this.state = this.withRec(this.state, who, { ...clean, lastStep: step });
|
|
706
|
+
this.browserLim.delete(browser.key);
|
|
707
|
+
if (!this.flush()) {
|
|
708
|
+
this.state = this.withRec(before, who, { ...clean, lastStep: step });
|
|
709
|
+
if (beforeBrowser)
|
|
710
|
+
this.browserLim.set(browser.key, beforeBrowser);
|
|
711
|
+
return { kind: "unavailable" };
|
|
712
|
+
}
|
|
713
|
+
return { kind: "ok", who };
|
|
714
|
+
}
|
|
715
|
+
// Wrong (or no one's, or a collision): the browser's own count, the whole sign-in's, a known device's known-path counts. Nothing else.
|
|
716
|
+
const f = bumpLim(fleet, SIGNIN_FLEET_WRONG_LIMIT, TOTP_PAUSE_MS, TOTP_PAUSE_MAX_MS, now, SIGNIN_COUNT_QUIET_MS, SIGNIN_FLEET_WRONG_LIMIT / 2);
|
|
717
|
+
const w = bumpLim(byBrowser, SIGNIN_BROWSER_WRONG_LIMIT, SIGNIN_BROWSER_PAUSE_MS, SIGNIN_BROWSER_PAUSE_MAX_MS, now, SIGNIN_BROWSER_QUIET_MS);
|
|
718
|
+
this.browserLim.delete(browser.key);
|
|
719
|
+
this.browserLim.set(browser.key, w.lim);
|
|
720
|
+
while (this.browserLim.size > SIGNIN_BROWSER_MAX)
|
|
721
|
+
this.browserLim.delete(this.browserLim.keys().next().value);
|
|
722
|
+
let next = this.state;
|
|
723
|
+
const ks = marks.map(who => ({ who, ...bumpLim(knownLim(who), SIGNIN_KNOWN_WRONG_LIMIT, TOTP_PAUSE_MS, TOTP_PAUSE_MAX_MS, now, SIGNIN_COUNT_QUIET_MS, SIGNIN_KNOWN_WRONG_LIMIT / 2) }));
|
|
724
|
+
for (const k of ks)
|
|
725
|
+
next = this.withRec(next, k.who, { ...this.rec(k.who), klim: k.lim });
|
|
726
|
+
this.state = { ...next, signin: f.lim };
|
|
727
|
+
this.flush();
|
|
728
|
+
const kWait = Math.max(0, ...ks.map(k => k.wait));
|
|
729
|
+
const began = { fleet: f.wait > 0, admin: kWait > 0, waitMs: Math.max(f.wait, kWait), halfFleet: f.half, halfAdmin: ks.some(k => k.half) };
|
|
730
|
+
const started = Math.max(w.wait, isKnown ? kWait : f.wait);
|
|
731
|
+
return started > 0 ? { kind: "paused", retryAfterMs: started, began }
|
|
732
|
+
: { kind: "wrong", ...(hits.length === 0 && compared && !ambiguous && skews.length === 1 ? { skewSteps: skews[0] } : {}), began };
|
|
733
|
+
}
|
|
543
734
|
/**
|
|
544
735
|
* Saved: true. Not saved: false (warned once until it works again) — memory keeps the new state, and it is written
|
|
545
736
|
* again by the next change or every OUTSIDE_SAVE_RETRY_MS until it is (#3008 review, Prism P2 1).
|