@flipstream/sdk 0.14.0 → 0.16.0
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/CHANGELOG.md +125 -0
- package/README.md +95 -1
- package/dist/api/datasets.js +8 -8
- package/dist/api/datasets.js.map +1 -1
- package/dist/api/log.js +6 -10
- package/dist/api/log.js.map +1 -1
- package/dist/api/pathArgument.d.ts +7 -0
- package/dist/api/pathArgument.js +12 -0
- package/dist/api/pathArgument.js.map +1 -0
- package/dist/auth/transport.d.ts +6 -2
- package/dist/auth/transport.js +5 -3
- package/dist/auth/transport.js.map +1 -1
- package/dist/core/call.d.ts +4 -0
- package/dist/core/call.js +7 -1
- package/dist/core/call.js.map +1 -1
- package/dist/core/fetch.d.ts +20 -1
- package/dist/core/fetch.js +50 -3
- package/dist/core/fetch.js.map +1 -1
- package/dist/core/hosts.d.ts +11 -0
- package/dist/core/hosts.js +13 -0
- package/dist/core/hosts.js.map +1 -0
- package/dist/core/identify.d.ts +6 -2
- package/dist/core/identify.js +16 -12
- package/dist/core/identify.js.map +1 -1
- package/dist/core/result.d.ts +1 -1
- package/dist/core/shared.d.ts +2 -0
- package/dist/core/shared.js +1 -0
- package/dist/core/shared.js.map +1 -1
- package/dist/core/signal.d.ts +7 -0
- package/dist/core/signal.js +9 -0
- package/dist/core/signal.js.map +1 -1
- package/dist/first-party/asPerson.d.ts +13 -0
- package/dist/first-party/asPerson.js +144 -0
- package/dist/first-party/asPerson.js.map +1 -0
- package/dist/first-party/attempts.d.ts +71 -0
- package/dist/first-party/attempts.js +132 -0
- package/dist/first-party/attempts.js.map +1 -0
- package/dist/first-party/authProxyMark.d.ts +10 -0
- package/dist/first-party/authProxyMark.js +11 -0
- package/dist/first-party/authProxyMark.js.map +1 -0
- package/dist/first-party/browser.d.ts +55 -0
- package/dist/first-party/browser.js +137 -0
- package/dist/first-party/browser.js.map +1 -0
- package/dist/first-party/browserSession.d.ts +95 -0
- package/dist/first-party/browserSession.js +242 -0
- package/dist/first-party/browserSession.js.map +1 -0
- package/dist/first-party/calls/consent.d.ts +89 -0
- package/dist/first-party/calls/consent.js +174 -0
- package/dist/first-party/calls/consent.js.map +1 -0
- package/dist/first-party/calls/device.d.ts +97 -0
- package/dist/first-party/calls/device.js +133 -0
- package/dist/first-party/calls/device.js.map +1 -0
- package/dist/first-party/calls/invitation.d.ts +244 -0
- package/dist/first-party/calls/invitation.js +258 -0
- package/dist/first-party/calls/invitation.js.map +1 -0
- package/dist/first-party/calls/logIn.d.ts +61 -0
- package/dist/first-party/calls/logIn.js +48 -0
- package/dist/first-party/calls/logIn.js.map +1 -0
- package/dist/first-party/calls/reset.d.ts +61 -0
- package/dist/first-party/calls/reset.js +163 -0
- package/dist/first-party/calls/reset.js.map +1 -0
- package/dist/first-party/calls/signUp.d.ts +21 -0
- package/dist/first-party/calls/signUp.js +72 -0
- package/dist/first-party/calls/signUp.js.map +1 -0
- package/dist/first-party/calls/twoStepSetup.d.ts +78 -0
- package/dist/first-party/calls/twoStepSetup.js +168 -0
- package/dist/first-party/calls/twoStepSetup.js.map +1 -0
- package/dist/first-party/claims.d.ts +88 -0
- package/dist/first-party/claims.js +181 -0
- package/dist/first-party/claims.js.map +1 -0
- package/dist/first-party/enrollment.d.ts +10 -0
- package/dist/first-party/enrollment.js +44 -0
- package/dist/first-party/enrollment.js.map +1 -0
- package/dist/first-party/entry.d.ts +573 -0
- package/dist/first-party/entry.js +582 -0
- package/dist/first-party/entry.js.map +1 -0
- package/dist/first-party/hooks.d.ts +81 -0
- package/dist/first-party/hooks.js +19 -0
- package/dist/first-party/hooks.js.map +1 -0
- package/dist/first-party/http.d.ts +191 -0
- package/dist/first-party/http.js +364 -0
- package/dist/first-party/http.js.map +1 -0
- package/dist/first-party/index.d.ts +14 -0
- package/dist/first-party/index.js +3 -0
- package/dist/first-party/index.js.map +1 -0
- package/dist/first-party/landed.d.ts +32 -0
- package/dist/first-party/landed.js +50 -0
- package/dist/first-party/landed.js.map +1 -0
- package/dist/first-party/landedProof.d.ts +12 -0
- package/dist/first-party/landedProof.js +20 -0
- package/dist/first-party/landedProof.js.map +1 -0
- package/dist/first-party/linkToken.d.ts +15 -0
- package/dist/first-party/linkToken.js +28 -0
- package/dist/first-party/linkToken.js.map +1 -0
- package/dist/first-party/links.d.ts +100 -0
- package/dist/first-party/links.js +84 -0
- package/dist/first-party/links.js.map +1 -0
- package/dist/first-party/locks.d.ts +36 -0
- package/dist/first-party/locks.js +64 -0
- package/dist/first-party/locks.js.map +1 -0
- package/dist/first-party/personTransport.d.ts +38 -0
- package/dist/first-party/personTransport.js +177 -0
- package/dist/first-party/personTransport.js.map +1 -0
- package/dist/first-party/proxy/app.d.ts +32 -0
- package/dist/first-party/proxy/app.js +94 -0
- package/dist/first-party/proxy/app.js.map +1 -0
- package/dist/first-party/proxy/bound.d.ts +5 -0
- package/dist/first-party/proxy/bound.js +13 -0
- package/dist/first-party/proxy/bound.js.map +1 -0
- package/dist/first-party/proxy/cases.d.ts +71 -0
- package/dist/first-party/proxy/cases.js +411 -0
- package/dist/first-party/proxy/cases.js.map +1 -0
- package/dist/first-party/proxy/decide.d.ts +31 -0
- package/dist/first-party/proxy/decide.js +139 -0
- package/dist/first-party/proxy/decide.js.map +1 -0
- package/dist/first-party/proxy/freeze.d.ts +2 -0
- package/dist/first-party/proxy/freeze.js +10 -0
- package/dist/first-party/proxy/freeze.js.map +1 -0
- package/dist/first-party/proxy/handler.d.ts +23 -0
- package/dist/first-party/proxy/handler.js +190 -0
- package/dist/first-party/proxy/handler.js.map +1 -0
- package/dist/first-party/proxy/headers.d.ts +7 -0
- package/dist/first-party/proxy/headers.js +20 -0
- package/dist/first-party/proxy/headers.js.map +1 -0
- package/dist/first-party/proxy/hop.d.ts +9 -0
- package/dist/first-party/proxy/hop.js +37 -0
- package/dist/first-party/proxy/hop.js.map +1 -0
- package/dist/first-party/proxy/host.d.ts +5 -0
- package/dist/first-party/proxy/host.js +11 -0
- package/dist/first-party/proxy/host.js.map +1 -0
- package/dist/first-party/proxy/index.d.ts +7 -0
- package/dist/first-party/proxy/index.js +6 -0
- package/dist/first-party/proxy/index.js.map +1 -0
- package/dist/first-party/proxy/pass-back.d.ts +26 -0
- package/dist/first-party/proxy/pass-back.js +47 -0
- package/dist/first-party/proxy/pass-back.js.map +1 -0
- package/dist/first-party/proxy/paths.d.ts +15 -0
- package/dist/first-party/proxy/paths.js +34 -0
- package/dist/first-party/proxy/paths.js.map +1 -0
- package/dist/first-party/proxy/shown.d.ts +5 -0
- package/dist/first-party/proxy/shown.js +16 -0
- package/dist/first-party/proxy/shown.js.map +1 -0
- package/dist/first-party/proxy/stand-in.d.ts +49 -0
- package/dist/first-party/proxy/stand-in.js +341 -0
- package/dist/first-party/proxy/stand-in.js.map +1 -0
- package/dist/first-party/report.d.ts +56 -0
- package/dist/first-party/report.js +38 -0
- package/dist/first-party/report.js.map +1 -0
- package/dist/first-party/result.d.ts +150 -0
- package/dist/first-party/result.js +40 -0
- package/dist/first-party/result.js.map +1 -0
- package/dist/first-party/session/cell.d.ts +201 -0
- package/dist/first-party/session/cell.js +103 -0
- package/dist/first-party/session/cell.js.map +1 -0
- package/dist/first-party/session/closed.d.ts +11 -0
- package/dist/first-party/session/closed.js +15 -0
- package/dist/first-party/session/closed.js.map +1 -0
- package/dist/first-party/session/index.d.ts +3 -0
- package/dist/first-party/session/index.js +3 -0
- package/dist/first-party/session/index.js.map +1 -0
- package/dist/first-party/session/logout.d.ts +102 -0
- package/dist/first-party/session/logout.js +526 -0
- package/dist/first-party/session/logout.js.map +1 -0
- package/dist/first-party/session/owed.d.ts +105 -0
- package/dist/first-party/session/owed.js +128 -0
- package/dist/first-party/session/owed.js.map +1 -0
- package/dist/first-party/session/refresh.d.ts +19 -0
- package/dist/first-party/session/refresh.js +236 -0
- package/dist/first-party/session/refresh.js.map +1 -0
- package/dist/first-party/session/results.d.ts +38 -0
- package/dist/first-party/session/results.js +74 -0
- package/dist/first-party/session/results.js.map +1 -0
- package/dist/first-party/session/session.d.ts +2 -0
- package/dist/first-party/session/session.js +376 -0
- package/dist/first-party/session/session.js.map +1 -0
- package/dist/first-party/session/shared.d.ts +34 -0
- package/dist/first-party/session/shared.js +145 -0
- package/dist/first-party/session/shared.js.map +1 -0
- package/dist/first-party/session/sharedSignal.d.ts +27 -0
- package/dist/first-party/session/sharedSignal.js +55 -0
- package/dist/first-party/session/sharedSignal.js.map +1 -0
- package/dist/first-party/session/signIn.d.ts +48 -0
- package/dist/first-party/session/signIn.js +340 -0
- package/dist/first-party/session/signIn.js.map +1 -0
- package/dist/first-party/session/signInThrough.d.ts +6 -0
- package/dist/first-party/session/signInThrough.js +144 -0
- package/dist/first-party/session/signInThrough.js.map +1 -0
- package/dist/first-party/session/sync.d.ts +17 -0
- package/dist/first-party/session/sync.js +174 -0
- package/dist/first-party/session/sync.js.map +1 -0
- package/dist/first-party/session/tokens.d.ts +18 -0
- package/dist/first-party/session/tokens.js +64 -0
- package/dist/first-party/session/tokens.js.map +1 -0
- package/dist/first-party/session/types.d.ts +270 -0
- package/dist/first-party/session/types.js +3 -0
- package/dist/first-party/session/types.js.map +1 -0
- package/dist/first-party/sessionWire.d.ts +31 -0
- package/dist/first-party/sessionWire.js +91 -0
- package/dist/first-party/sessionWire.js.map +1 -0
- package/dist/first-party/signInHooks.d.ts +85 -0
- package/dist/first-party/signInHooks.js +2 -0
- package/dist/first-party/signInHooks.js.map +1 -0
- package/dist/first-party/state.d.ts +71 -0
- package/dist/first-party/state.js +55 -0
- package/dist/first-party/state.js.map +1 -0
- package/dist/first-party/strip.d.ts +1 -0
- package/dist/first-party/strip.js +8 -0
- package/dist/first-party/strip.js.map +1 -0
- package/dist/first-party/twoStepLock.d.ts +26 -0
- package/dist/first-party/twoStepLock.js +58 -0
- package/dist/first-party/twoStepLock.js.map +1 -0
- package/dist/first-party/twoStepSession.d.ts +21 -0
- package/dist/first-party/twoStepSession.js +31 -0
- package/dist/first-party/twoStepSession.js.map +1 -0
- package/dist/first-party/wire.d.ts +63 -0
- package/dist/first-party/wire.js +5 -0
- package/dist/first-party/wire.js.map +1 -0
- package/dist/flipstream.d.ts +80 -19
- package/dist/flipstream.js +121 -36
- package/dist/flipstream.js.map +1 -1
- package/dist/node/session.js +3 -1
- package/dist/node/session.js.map +1 -1
- package/dist/version.gen.js +1 -1
- package/docs/first-party.md +300 -0
- package/package.json +34 -5
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { stopListening } from '../../core/signal.js';
|
|
2
|
+
export function sharedSignal() {
|
|
3
|
+
const controller = new AbortController();
|
|
4
|
+
let open = 0;
|
|
5
|
+
let forever = false;
|
|
6
|
+
let out = false;
|
|
7
|
+
let done = false;
|
|
8
|
+
const listening = [];
|
|
9
|
+
const leave = () => {
|
|
10
|
+
open -= 1;
|
|
11
|
+
// React's StrictMode unmounts an effect with an abort and runs it again in the same turn:
|
|
12
|
+
// the check waits a microtask, so that second caller joins before the request is given up.
|
|
13
|
+
queueMicrotask(() => {
|
|
14
|
+
if (open === 0 && !forever)
|
|
15
|
+
controller.abort();
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const join = (signal) => {
|
|
19
|
+
if (signal === undefined) {
|
|
20
|
+
forever = true;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
open += 1;
|
|
24
|
+
if (signal.aborted) {
|
|
25
|
+
leave();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (done)
|
|
29
|
+
return;
|
|
30
|
+
// A listener of its own for each join: the same function added twice to one signal is
|
|
31
|
+
// added once, so two callers sharing a signal would leave once.
|
|
32
|
+
const listener = () => {
|
|
33
|
+
leave();
|
|
34
|
+
};
|
|
35
|
+
listening.push({ signal, listener });
|
|
36
|
+
signal.addEventListener('abort', listener, { once: true });
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
signal: controller.signal,
|
|
40
|
+
join,
|
|
41
|
+
sent: () => {
|
|
42
|
+
out = true;
|
|
43
|
+
},
|
|
44
|
+
wasSent: () => out,
|
|
45
|
+
givenUp: () => controller.signal.aborted && !out,
|
|
46
|
+
gone: () => open === 0 && !forever,
|
|
47
|
+
settled: () => {
|
|
48
|
+
done = true;
|
|
49
|
+
// A signal with no removeEventListener (a minimal polyfill's) keeps its listener: never a throw.
|
|
50
|
+
for (const { signal, listener } of listening.splice(0))
|
|
51
|
+
stopListening(signal, listener);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=sharedSignal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedSignal.js","sourceRoot":"","sources":["../../../src/first-party/session/sharedSignal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AA6BpD,MAAM,UAAU,YAAY;IAC1B,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IACxC,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,OAAO,GAAG,KAAK,CAAA;IACnB,IAAI,GAAG,GAAG,KAAK,CAAA;IACf,IAAI,IAAI,GAAG,KAAK,CAAA;IAChB,MAAM,SAAS,GAAsE,EAAE,CAAA;IACvF,MAAM,KAAK,GAAG,GAAS,EAAE;QACvB,IAAI,IAAI,CAAC,CAAA;QACT,0FAA0F;QAC1F,2FAA2F;QAC3F,cAAc,CAAC,GAAG,EAAE;YAClB,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO;gBAAE,UAAU,CAAC,KAAK,EAAE,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IACD,MAAM,IAAI,GAAG,CAAC,MAA+B,EAAQ,EAAE;QACrD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,GAAG,IAAI,CAAA;YACd,OAAM;QACR,CAAC;QACD,IAAI,IAAI,CAAC,CAAA;QACT,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,KAAK,EAAE,CAAA;YACP,OAAM;QACR,CAAC;QACD,IAAI,IAAI;YAAE,OAAM;QAChB,sFAAsF;QACtF,gEAAgE;QAChE,MAAM,QAAQ,GAAG,GAAS,EAAE;YAC1B,KAAK,EAAE,CAAA;QACT,CAAC,CAAA;QACD,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QACpC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5D,CAAC,CAAA;IACD,OAAO;QACL,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,IAAI;QACJ,IAAI,EAAE,GAAG,EAAE;YACT,GAAG,GAAG,IAAI,CAAA;QACZ,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG;QAClB,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,GAAG;QAChD,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO;QAClC,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,GAAG,IAAI,CAAA;YACX,iGAAiG;YACjG,KAAK,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;gBAAE,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QACzF,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { SignInHow, SignInThroughAnswer } from '../signInHooks.js';
|
|
2
|
+
import type { SignInAnswer } from '../http.js';
|
|
3
|
+
import { type PendingTwoStep, type SessionCell } from './cell.js';
|
|
4
|
+
import type { Logout } from './logout.js';
|
|
5
|
+
import type { Settled } from './results.js';
|
|
6
|
+
import type { SharedState } from './shared.js';
|
|
7
|
+
import type { SharedSignal } from './sharedSignal.js';
|
|
8
|
+
import type { Tokens } from './tokens.js';
|
|
9
|
+
import type { SessionDeps } from './types.js';
|
|
10
|
+
/** What a family's request is, for the session: its step and the address it signs in under. */
|
|
11
|
+
type How = Pick<SignInHow, 'step' | 'email'>;
|
|
12
|
+
type Origin = {
|
|
13
|
+
readonly attemptId: string | null;
|
|
14
|
+
readonly email: string | null;
|
|
15
|
+
readonly purpose?: PendingTwoStep['purpose'];
|
|
16
|
+
};
|
|
17
|
+
/** Redeeming a link and checking a two-step code, under the cookie lock. */
|
|
18
|
+
export interface SignIn {
|
|
19
|
+
/**
|
|
20
|
+
* What a redeem and a verify share: pinned to the generation they started in, inside the
|
|
21
|
+
* cookie lock, a pending logout sent first, the answer settled before anything is
|
|
22
|
+
* adopted. A generation that moved while this waited for the lock means a sign-out came
|
|
23
|
+
* after the click: nothing is sent.
|
|
24
|
+
*/
|
|
25
|
+
readonly signIn: (call: () => Promise<SignInAnswer>, origin: Origin, step: 'redeem' | 'two-step', pinnedAt?: number,
|
|
26
|
+
/** The caller's own: ends the wait for the cookie lock, so nothing is sent (#465). */
|
|
27
|
+
signal?: AbortSignal,
|
|
28
|
+
/**
|
|
29
|
+
* Called right before the request goes out, in the same turn as the last look at `signal`:
|
|
30
|
+
* from then on the caller's abort can't stop it (SDK-D1931).
|
|
31
|
+
*/
|
|
32
|
+
onSend?: () => void,
|
|
33
|
+
/** Own-tab sign-outs at the press, for challenge adoption during redeem. */
|
|
34
|
+
localSignOuts?: number) => Promise<Settled>;
|
|
35
|
+
/** A family's call (`signInThrough`), pinned to the generation and the sign-out count of its press. */
|
|
36
|
+
readonly through: <G>(how: How, body: Readonly<Record<string, unknown>>, pinned: number, localSignOuts: number, callers: Pick<SharedSignal, 'signal' | 'sent' | 'gone'>,
|
|
37
|
+
/** Called once pulse-auth answered a 2xx that is not an HTML page, before anything reads it. */
|
|
38
|
+
received: () => void,
|
|
39
|
+
/**
|
|
40
|
+
* An accept's last word on its request, asked in the cookie lock after the owed logout and
|
|
41
|
+
* before the last look (sdk#549): `null` goes on, a stop settles the request, nothing sent.
|
|
42
|
+
*/
|
|
43
|
+
ready: (() => Promise<G | null>) | undefined) => Promise<SignInThroughAnswer | G>;
|
|
44
|
+
/** The code screen's challenge belongs to a generation that has passed. */
|
|
45
|
+
readonly endTwoStep: () => void;
|
|
46
|
+
}
|
|
47
|
+
export declare function createSignIn(deps: SessionDeps, cell: SessionCell, { shared, canDeliverCodes, withState, withCookie }: SharedState, { hold }: Tokens, { sendLogout, recordSignOut, notConfirmed }: Logout): SignIn;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { spendAttempt } from '../attempts.js';
|
|
2
|
+
import { unhandled as unhandledError } from '../report.js';
|
|
3
|
+
import { readState } from '../state.js';
|
|
4
|
+
import { endTwoStep as endCodeScreen, isKeptFor, owedLogout } from './cell.js';
|
|
5
|
+
import { leaveOwed, owedNowFor, revokedOn } from './owed.js';
|
|
6
|
+
const routes = { 'log-in': '/login', accept: '/invitations/accept' };
|
|
7
|
+
/** SDK-D1907. The only extra fields that may leave a signed-in response, per caller. */
|
|
8
|
+
const signedInExtra = {
|
|
9
|
+
'log-in': () => ({}),
|
|
10
|
+
accept: (body) => typeof body === 'object' && body !== null && 'continue_link' in body
|
|
11
|
+
? { continue_link: body.continue_link } : {},
|
|
12
|
+
};
|
|
13
|
+
/** The server's own path of each sign-in step, for a report (SDK-D1903): never under authPath. */
|
|
14
|
+
const PATH = { ...routes, redeem: '/login-link', 'two-step': '/mfa/verify' };
|
|
15
|
+
export function createSignIn(deps, cell, { shared, canDeliverCodes, withState, withCookie }, { hold }, { sendLogout, recordSignOut, notConfirmed }) {
|
|
16
|
+
const { http, report } = deps;
|
|
17
|
+
const storage = deps.storage;
|
|
18
|
+
/**
|
|
19
|
+
* SDK-D1975: the one check before a challenge is kept, for a redeem and for a family's call. The
|
|
20
|
+
* press still speaks: no sign-in or sign-out moved the generation since (#481), and no sign-out
|
|
21
|
+
* was pressed in this tab since, even one whose write still waits for the state lock
|
|
22
|
+
* (SDK-D1970). And someone is left to answer it: a family's challenge that comes once every
|
|
23
|
+
* caller has left is dropped, for nobody is there to be asked, and a code screen up for another
|
|
24
|
+
* sign-in would silently change the challenge its code goes to. A redeem's callers are never
|
|
25
|
+
* gone this way: its record keeps the answer, and the next press of the link reads it.
|
|
26
|
+
*/
|
|
27
|
+
const adoption = (pinned, press) => {
|
|
28
|
+
if (shared().generation !== pinned || cell.localSignOuts !== press.localSignOuts)
|
|
29
|
+
return 'superseded';
|
|
30
|
+
return press.gone?.() === true ? 'nobody' : 'adopt';
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A sign-in in this tab took a challenge or signed in (`settled`): every kept redeem that is not
|
|
34
|
+
* its own answers `superseded` from now on, for every later press of its link, whatever was
|
|
35
|
+
* pending at this moment (SDK-D1976, SDK-D2007). A family's sign-in has no record, so it marks
|
|
36
|
+
* them all. Its own record is unmarked when it installs its own challenge, since that one is the
|
|
37
|
+
* code screen now: a link pressed while a log-in was out waits behind it in the cookie lock, and
|
|
38
|
+
* the log-in's challenge marked it. Its own code finishing it overtakes nothing.
|
|
39
|
+
*/
|
|
40
|
+
const overtake = (origin, settled) => {
|
|
41
|
+
for (const record of cell.redeems.values()) {
|
|
42
|
+
if (record.attemptId !== origin.attemptId)
|
|
43
|
+
record.overtaken = true;
|
|
44
|
+
else if (settled === 'challenge')
|
|
45
|
+
record.overtaken = false;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The cookie pulse-auth just set must be revoked before anyone refreshes with it, and the revoke
|
|
50
|
+
* didn't get through, or couldn't be recorded. A logout already pending at the current generation
|
|
51
|
+
* does it; otherwise it is recorded as a sign-out the shared record missed, so it outlives this
|
|
52
|
+
* object (sdk#483). Answers the generation whose pending logout revokes it, and the record's
|
|
53
|
+
* serial with it, read under the caller's cookie lock.
|
|
54
|
+
*/
|
|
55
|
+
const oweRevoke = async (person) => {
|
|
56
|
+
const state = shared();
|
|
57
|
+
if (state.logoutPending?.generation === state.generation) {
|
|
58
|
+
// Riding on a sign-out only memory holds: the cookie it is owed for is this sign-in's now, so
|
|
59
|
+
// it is owed for this person (`revokedOn` says when it is kept as it was). Every ride, open
|
|
60
|
+
// or closed, this tab's own or one it heard or the copy it took from the slot, reaches the
|
|
61
|
+
// page's slot at once: a held entry is renamed, and any other ride is left (sdk#568,
|
|
62
|
+
// SDK-D2045). A closing ride does not merge again when the slot already holds that rode
|
|
63
|
+
// entry (SDK-D2046). A recorded pending logout needs nothing.
|
|
64
|
+
const recorded = storage === null ? 0 : readState(storage).generation;
|
|
65
|
+
const slot = deps.owed;
|
|
66
|
+
const reach = (entry, renameWider) => {
|
|
67
|
+
if (slot === null)
|
|
68
|
+
return;
|
|
69
|
+
const rodeOn = { generation: state.generation, stored: entry.stored };
|
|
70
|
+
const held = slot.left !== null &&
|
|
71
|
+
slot.left.generation === rodeOn.generation &&
|
|
72
|
+
slot.left.stored === rodeOn.stored;
|
|
73
|
+
if (held)
|
|
74
|
+
owedNowFor(slot, rodeOn, person, recorded);
|
|
75
|
+
else if (renameWider && slot.left?.generation === state.generation)
|
|
76
|
+
owedNowFor(slot, slot.left, person, recorded);
|
|
77
|
+
else
|
|
78
|
+
leaveOwed(slot, { ...entry, generation: rodeOn.generation });
|
|
79
|
+
};
|
|
80
|
+
const open = owedLogout(cell);
|
|
81
|
+
if (open !== null) {
|
|
82
|
+
cell.owedFor = revokedOn(open, person, recorded);
|
|
83
|
+
reach(cell.owedFor, false);
|
|
84
|
+
}
|
|
85
|
+
else if (cell.slotFor !== null) {
|
|
86
|
+
cell.slotFor = revokedOn(cell.slotFor, person, recorded);
|
|
87
|
+
reach(cell.slotFor, true);
|
|
88
|
+
}
|
|
89
|
+
else if (slot !== null && slot.left?.generation === state.generation) {
|
|
90
|
+
owedNowFor(slot, slot.left, person, recorded);
|
|
91
|
+
}
|
|
92
|
+
return { generation: state.generation, serial: state.serial };
|
|
93
|
+
}
|
|
94
|
+
// The challenge is left to whoever answers: `unsettled` spends a code's, and a superseded code's
|
|
95
|
+
// screen is ended by verifyTwoStep through endTwoStep (SDK-D1978).
|
|
96
|
+
return recordSignOut({ kind: 'revoke', person });
|
|
97
|
+
};
|
|
98
|
+
/** Settles a redeem's, a verify's or a family's answer inside the cookie lock. */
|
|
99
|
+
const settleSignIn = async (answer, pinned, origin, step, press) => {
|
|
100
|
+
switch (answer.kind) {
|
|
101
|
+
case 'signed-in': {
|
|
102
|
+
const decided = await withState((state) => {
|
|
103
|
+
if (state.generation !== pinned) {
|
|
104
|
+
return { write: null, result: 'superseded' };
|
|
105
|
+
}
|
|
106
|
+
const next = {
|
|
107
|
+
generation: state.generation + 1,
|
|
108
|
+
signedIn: true,
|
|
109
|
+
serial: state.serial + 1,
|
|
110
|
+
// A new session cookie replaced whatever logout was pending.
|
|
111
|
+
logoutPending: null,
|
|
112
|
+
principal: answer.access.fingerprint,
|
|
113
|
+
person: answer.access.person,
|
|
114
|
+
madeBy: 'sign-in',
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
write: next,
|
|
118
|
+
result: 'signed-in',
|
|
119
|
+
then: () => {
|
|
120
|
+
if (storage !== null && origin.attemptId !== null)
|
|
121
|
+
spendAttempt(storage, origin.attemptId);
|
|
122
|
+
overtake(origin, 'signed-in');
|
|
123
|
+
cell.twoStep = null;
|
|
124
|
+
// The new session's cookie replaced any a closed session in this page owed (sdk#483).
|
|
125
|
+
if (deps.owed !== null)
|
|
126
|
+
deps.owed.left = null;
|
|
127
|
+
hold(answer.access, next.generation, next.serial, 'here');
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
if (decided.ran && decided.value === 'signed-in') {
|
|
132
|
+
return { kind: 'signed-in', backupCodes: answer.backupCodes };
|
|
133
|
+
}
|
|
134
|
+
// A sign-out moved the state while this was in flight (or the state couldn't be
|
|
135
|
+
// written): the sign-out wins. pulse-auth made the session anyway and set its
|
|
136
|
+
// cookie, so revoke it now, still inside the cookie lock; the pending logout stays. A
|
|
137
|
+
// revoke that doesn't get through is owed as a sign-out the shared record missed
|
|
138
|
+
// (oweRevoke): every tab publishes `signed_out`, since no session can be renewed over
|
|
139
|
+
// that cookie (SDK-D1968), and what it earns is `notConfirmed`'s (SDK-D1963).
|
|
140
|
+
const revoked = await http.logout();
|
|
141
|
+
// Confirmed under the cookie lock, as every logout: the slot's cookie went with it (S3),
|
|
142
|
+
// and so did the owed cookie a kept mark was for. A confirmation by any route is the
|
|
143
|
+
// newest answer about that cookie, so the mark ends (PR 547 round 2).
|
|
144
|
+
if (revoked.kind === 'confirmed') {
|
|
145
|
+
if (deps.owed !== null)
|
|
146
|
+
deps.owed.left = null;
|
|
147
|
+
if (isKeptFor(cell.logoutKept, shared()))
|
|
148
|
+
cell.logoutKept = null;
|
|
149
|
+
}
|
|
150
|
+
if (revoked.kind !== 'confirmed') {
|
|
151
|
+
// Only an answer outside the contract is reported.
|
|
152
|
+
if (revoked.kind === 'broken') {
|
|
153
|
+
report({ kind: 'answer', path: '/logout', status: revoked.httpStatus });
|
|
154
|
+
}
|
|
155
|
+
const owed = await oweRevoke(answer.access.person);
|
|
156
|
+
cell.logoutBackoffStep = 0;
|
|
157
|
+
notConfirmed(revoked, owed.generation, owed.serial);
|
|
158
|
+
}
|
|
159
|
+
if (step === 'two-step' && origin.purpose === 'setup' && answer.backupCodes !== null) {
|
|
160
|
+
const userId = answer.access.principal.userId;
|
|
161
|
+
const codes = answer.backupCodes;
|
|
162
|
+
// A refused write leaves the pinned record intact. A successful supersession
|
|
163
|
+
// observed a newer generation, so an older record cannot establish its recipient.
|
|
164
|
+
const minimumGeneration = decided.ran ? pinned + 1 : pinned;
|
|
165
|
+
return {
|
|
166
|
+
kind: 'superseded',
|
|
167
|
+
codesAtDelivery: () => canDeliverCodes(userId, minimumGeneration) ? codes : null,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return { kind: 'superseded' };
|
|
171
|
+
}
|
|
172
|
+
case 'two-step':
|
|
173
|
+
case 'two-step-setup': {
|
|
174
|
+
if (step === 'two-step') {
|
|
175
|
+
report({ kind: 'answer', path: PATH[step], status: 200 });
|
|
176
|
+
return { kind: 'unknown', status: 200 };
|
|
177
|
+
}
|
|
178
|
+
switch (adoption(pinned, press)) {
|
|
179
|
+
// A challenge overtaken by a sign-out or sign-in must not reopen the code screen (#481).
|
|
180
|
+
case 'superseded':
|
|
181
|
+
return { kind: 'superseded' };
|
|
182
|
+
// Every caller left: the challenge is dropped, what was pending stays (SDK-D1975).
|
|
183
|
+
case 'nobody':
|
|
184
|
+
return { kind: 'unavailable' };
|
|
185
|
+
case 'adopt':
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
overtake(origin, 'challenge');
|
|
189
|
+
// No cookie yet, so a pending logout stays through the code screen. A set-up challenge
|
|
190
|
+
// is kept as a code's is, for /mfa/enroll and then the code (#465).
|
|
191
|
+
const pending = { attemptId: origin.attemptId, email: origin.email, challenge: answer.challenge, generation: pinned };
|
|
192
|
+
cell.twoStepSuperseded = false;
|
|
193
|
+
cell.twoStepEndedByTab = false;
|
|
194
|
+
if (answer.kind === 'two-step-setup') {
|
|
195
|
+
const setup = Object.freeze({ kind: 'sign_in_setup', expires_at: answer.challenge.expiresAt });
|
|
196
|
+
cell.setupSteps.set(setup, 'issued');
|
|
197
|
+
cell.twoStep = { ...pending, purpose: 'setup', setup };
|
|
198
|
+
return { kind: 'two-step-setup', setup };
|
|
199
|
+
}
|
|
200
|
+
cell.twoStep = { ...pending, purpose: 'verify' };
|
|
201
|
+
return { kind: 'two-step' };
|
|
202
|
+
}
|
|
203
|
+
case 'unsettled': {
|
|
204
|
+
report({ kind: 'answer', path: PATH[step], status: answer.status });
|
|
205
|
+
// A code answered with a 2xx that can't be read spent its challenge, whatever happens to
|
|
206
|
+
// the logout below: the next code reads `expired` and is not sent (SDK-D1978).
|
|
207
|
+
if (step === 'two-step')
|
|
208
|
+
cell.twoStep = null;
|
|
209
|
+
// pulse-auth answered 2xx, so it may have set its cookie, but this tab can't use
|
|
210
|
+
// the answer. That session ends rather than live on behind a failure screen: it is
|
|
211
|
+
// recorded as the current generation's pending logout, so a reload or another tab
|
|
212
|
+
// sends the logout too and never restores it, and sent now, inside the cookie lock. The
|
|
213
|
+
// generation stays, so the serial moves: a flag a tab read as paid at this generation is
|
|
214
|
+
// another record, and this one is never read as paid (sdk#506).
|
|
215
|
+
const recorded = await withState((state) => {
|
|
216
|
+
const owed = state.generation === pinned && !state.signedIn;
|
|
217
|
+
return {
|
|
218
|
+
write: owed
|
|
219
|
+
? { ...state, serial: state.serial + 1, logoutPending: { generation: state.generation } }
|
|
220
|
+
: null,
|
|
221
|
+
result: owed ? state.serial + 1 : null,
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
cell.logoutBackoffStep = 0;
|
|
225
|
+
if (recorded.ran && recorded.value !== null) {
|
|
226
|
+
const answer = await sendLogout(pinned);
|
|
227
|
+
if (answer.kind !== 'confirmed')
|
|
228
|
+
notConfirmed(answer, pinned, recorded.value);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
// Storage refused, or a sign-out elsewhere moved the state: owed as a sign-out the
|
|
232
|
+
// shared record missed, and sent now. Its answer couldn't be read: whose cookie, unknown.
|
|
233
|
+
const owed = await oweRevoke(null);
|
|
234
|
+
const answer = await sendLogout(owed.generation);
|
|
235
|
+
if (answer.kind !== 'confirmed')
|
|
236
|
+
notConfirmed(answer, owed.generation, owed.serial);
|
|
237
|
+
}
|
|
238
|
+
return { kind: 'unknown', status: answer.status };
|
|
239
|
+
}
|
|
240
|
+
case 'unknown':
|
|
241
|
+
report({ kind: 'answer', path: PATH[step], status: answer.status });
|
|
242
|
+
return { kind: 'unknown', status: answer.status };
|
|
243
|
+
case 'proxy-refused':
|
|
244
|
+
report({ kind: 'answer', path: PATH[step], status: 403 });
|
|
245
|
+
return { kind: 'proxy-refused' };
|
|
246
|
+
case 'dead-link':
|
|
247
|
+
case 'wrong-code':
|
|
248
|
+
case 'locked':
|
|
249
|
+
case 'expired':
|
|
250
|
+
case 'no-account':
|
|
251
|
+
case 'inactive':
|
|
252
|
+
case 'unavailable':
|
|
253
|
+
return { kind: answer.kind };
|
|
254
|
+
default: {
|
|
255
|
+
const unhandled = answer;
|
|
256
|
+
throw unhandledError('sign-in answer', unhandled);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
// The press pins the generation. The cookie lock covers the send and all settlement, revoke
|
|
261
|
+
// included. The caller's signal cuts only a wait before the send.
|
|
262
|
+
async function underCookie(pinned, signal, onSend, send,
|
|
263
|
+
// A shared caller list's: every caller left in the turn of the press (SDK-D1932).
|
|
264
|
+
gone,
|
|
265
|
+
// A family's own word on whether its request may still go (sdk#549): a stop settles it.
|
|
266
|
+
ready) {
|
|
267
|
+
const locked = await withCookie(async () => {
|
|
268
|
+
// Closed while this waited for the lock: nothing is sent (SDK-D1930).
|
|
269
|
+
if (cell.closed)
|
|
270
|
+
return { kind: 'unavailable' };
|
|
271
|
+
const state = shared();
|
|
272
|
+
if (state.generation !== pinned)
|
|
273
|
+
return { kind: 'superseded' };
|
|
274
|
+
if (state.logoutPending?.generation === state.generation) {
|
|
275
|
+
// Not confirmed: a successful sign-in replaces the cookie (and clears the flag);
|
|
276
|
+
// any other answer leaves it owed (SDK-D1963).
|
|
277
|
+
const answer = await sendLogout(state.generation);
|
|
278
|
+
if (answer.kind !== 'confirmed')
|
|
279
|
+
notConfirmed(answer, state.generation, state.serial);
|
|
280
|
+
}
|
|
281
|
+
// Asked before the last look, so the look still comes right before the send. Nothing sent.
|
|
282
|
+
if (ready !== undefined) {
|
|
283
|
+
const stop = await ready();
|
|
284
|
+
if (stop !== null)
|
|
285
|
+
return stop;
|
|
286
|
+
}
|
|
287
|
+
// The caller may have left once the lock was had (its abort no longer ends the wait), or the
|
|
288
|
+
// session closed while the owed logout was out: look again right before the send
|
|
289
|
+
// (SDK-D1902, SDK-D1930). Nothing sent.
|
|
290
|
+
if (cell.closed || signal?.aborted === true || gone?.() === true)
|
|
291
|
+
return { kind: 'unavailable' };
|
|
292
|
+
// A sign-out elsewhere while the owed logout was out (SDK-D1925). A confirmed logout keeps
|
|
293
|
+
// the generation, so only a sign-out moves it here.
|
|
294
|
+
if (shared().generation !== pinned)
|
|
295
|
+
return { kind: 'superseded' };
|
|
296
|
+
// From here on the caller's abort can't stop the request (SDK-D1931).
|
|
297
|
+
onSend?.();
|
|
298
|
+
return send();
|
|
299
|
+
}, signal);
|
|
300
|
+
return locked.ran ? locked.value : { kind: 'unavailable' };
|
|
301
|
+
}
|
|
302
|
+
const signIn = (call, origin, step, pinnedAt, signal, onSend, localSignOuts) => {
|
|
303
|
+
// A redeem is pinned to the click; a code, to the redeem that asked for it.
|
|
304
|
+
const pinned = pinnedAt ?? shared().generation;
|
|
305
|
+
return underCookie(pinned, signal, onSend, async () => settleSignIn(await call(), pinned, origin, step, { localSignOuts }));
|
|
306
|
+
};
|
|
307
|
+
const through = (how, body, pinned, localSignOuts, callers, received, ready) => underCookie(pinned, callers.signal, callers.sent, async () => {
|
|
308
|
+
const exchange = await http.sendSignIn(routes[how.step], body);
|
|
309
|
+
if (exchange.kind === 'proxy-refused') {
|
|
310
|
+
report({ kind: 'answer', path: routes[how.step], status: exchange.status });
|
|
311
|
+
return { kind: 'proxy_refused' };
|
|
312
|
+
}
|
|
313
|
+
// Once sent, a refusal, no answer or a proxy's is answered as it is, whatever the generation:
|
|
314
|
+
// it sets no cookie, so a sign-out elsewhere changes nothing about it (SDK-D1946).
|
|
315
|
+
if (exchange.kind !== 'received')
|
|
316
|
+
return exchange;
|
|
317
|
+
// Every 2xx of pulse-auth's, the one the session can't use included, before it is settled
|
|
318
|
+
// (sdk#472). An HTML page is the app's own, never pulse-auth's: the accept didn't reach it.
|
|
319
|
+
if (!exchange.page)
|
|
320
|
+
received();
|
|
321
|
+
const token = exchange.token;
|
|
322
|
+
const settled = await settleSignIn(token, pinned, { attemptId: null, email: how.email }, how.step, { localSignOuts, gone: callers.gone });
|
|
323
|
+
// A dropped challenge answers nobody: every caller has its `aborted` already.
|
|
324
|
+
if (settled.kind === 'superseded' || settled.kind === 'unavailable')
|
|
325
|
+
return { kind: settled.kind };
|
|
326
|
+
if (settled.kind === 'signed-in') {
|
|
327
|
+
return { kind: 'step', step: { kind: 'signed_in' }, extra: signedInExtra[how.step](exchange.body) };
|
|
328
|
+
}
|
|
329
|
+
if (settled.kind === 'two-step-setup') {
|
|
330
|
+
return { kind: 'step', step: { kind: 'two_step_setup', expires_at: settled.setup.expires_at, setup: settled.setup }, extra: {} };
|
|
331
|
+
}
|
|
332
|
+
if (settled.kind === 'two-step' && token.kind === 'two-step') {
|
|
333
|
+
return { kind: 'step', step: { kind: 'two_step', expires_at: token.challenge.expiresAt }, extra: {} };
|
|
334
|
+
}
|
|
335
|
+
return { kind: 'invalid' };
|
|
336
|
+
}, callers.gone, ready);
|
|
337
|
+
const endTwoStep = () => endCodeScreen(cell);
|
|
338
|
+
return { signIn, through, endTwoStep };
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=signIn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signIn.js","sourceRoot":"","sources":["../../../src/first-party/session/signIn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,SAAS,EAAE,UAAU,EAAyC,MAAM,WAAW,CAAA;AAErH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAgB,MAAM,WAAW,CAAA;AAsB1E,MAAM,MAAM,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,qBAAqB,EAAW,CAAA;AAC7E,w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CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;IAElD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SignInHooks } from '../signInHooks.js';
|
|
2
|
+
import type { SessionCell } from './cell.js';
|
|
3
|
+
import type { SharedState } from './shared.js';
|
|
4
|
+
import type { SignIn } from './signIn.js';
|
|
5
|
+
/** A log-in's or an accept's request, as `SignInHooks.signInThrough` says. */
|
|
6
|
+
export declare function createSignInThrough(cell: Pick<SessionCell, 'supported' | 'localSignOuts'>, shared: SharedState['shared'], signIn: SignIn, stillOpen: (call: string) => void): SignInHooks['signInThrough'];
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { stopListening } from '../../core/signal.js';
|
|
2
|
+
import { sharedSignal } from './sharedSignal.js';
|
|
3
|
+
/**
|
|
4
|
+
* The same request: the same fields, each with the same value. Compared field by field, so a
|
|
5
|
+
* password is never part of a key or of any string built from the request (SDK-D1947).
|
|
6
|
+
*/
|
|
7
|
+
function sameRequest(a, b) {
|
|
8
|
+
const fields = Object.keys(a);
|
|
9
|
+
return fields.length === Object.keys(b).length &&
|
|
10
|
+
fields.every((field) => Object.hasOwn(b, field) && Object.is(a[field], b[field]));
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* One caller's answer, once it has joined the flight's callers. Its own abort answers it `aborted`
|
|
14
|
+
* at once, for it alone; the request is given up only once every caller has left before the send
|
|
15
|
+
* (SDK-D1932).
|
|
16
|
+
*/
|
|
17
|
+
function answerOf(flight, signal) {
|
|
18
|
+
if (signal === undefined)
|
|
19
|
+
return flight.result;
|
|
20
|
+
if (signal.aborted)
|
|
21
|
+
return Promise.resolve({ kind: 'aborted' });
|
|
22
|
+
let leave = () => undefined;
|
|
23
|
+
const left = new Promise((resolve) => {
|
|
24
|
+
leave = () => {
|
|
25
|
+
resolve({ kind: 'aborted' });
|
|
26
|
+
};
|
|
27
|
+
signal.addEventListener('abort', leave, { once: true });
|
|
28
|
+
});
|
|
29
|
+
return Promise.race([flight.result, left]).finally(() => {
|
|
30
|
+
stopListening(signal, leave);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The requests of one step, in flight, by generation, step and address (SDK-D1947). The same
|
|
35
|
+
* request joins the attempt in flight; a different one is an attempt of its own and joins nothing
|
|
36
|
+
* (SDK-D1908); an earlier attempt keeps running for the callers it has. So p1, p2, then p1 again
|
|
37
|
+
* while both are out: the third joins the first, and two requests are sent. An attempt every
|
|
38
|
+
* caller left before the send is given up (SDK-D1932): nobody joins it, and a new press starts its
|
|
39
|
+
* own. `G`: what the family's own `sendable` can stop a request with (never for a log-in).
|
|
40
|
+
*/
|
|
41
|
+
function flightsOf(cell, shared, signIn) {
|
|
42
|
+
const flights = new Map();
|
|
43
|
+
/** The flights whose hooks have yet to run, whatever their address (sdk#549). */
|
|
44
|
+
const hooking = new Set();
|
|
45
|
+
return (how, sendable, body, options) => {
|
|
46
|
+
if (options?.signal?.aborted)
|
|
47
|
+
return Promise.resolve({ kind: 'aborted' });
|
|
48
|
+
if (!cell.supported)
|
|
49
|
+
return Promise.resolve({ kind: 'unsupported' });
|
|
50
|
+
const pinned = shared().generation;
|
|
51
|
+
const key = JSON.stringify([pinned, how.step, how.email]);
|
|
52
|
+
const inFlight = flights.get(key) ?? [];
|
|
53
|
+
const earlier = inFlight.find((flight) => !flight.callers.givenUp() && sameRequest(flight.body, body));
|
|
54
|
+
if (earlier !== undefined) {
|
|
55
|
+
earlier.callers.join(options?.signal);
|
|
56
|
+
return answerOf(earlier, options?.signal);
|
|
57
|
+
}
|
|
58
|
+
// The first caller is counted before the flight starts: a lock granted in the same turn makes
|
|
59
|
+
// its last look inside `through`, and must find that caller there.
|
|
60
|
+
const callers = sharedSignal();
|
|
61
|
+
callers.join(options?.signal);
|
|
62
|
+
// Whether pulse-auth answered this request a 2xx, whatever the session then made of it.
|
|
63
|
+
let received = false;
|
|
64
|
+
// sdk#549: an accept asks its family, inside the cookie lock, whether it may still go, once
|
|
65
|
+
// every accept started before it on this page has run its hooks (and so forgotten a token it
|
|
66
|
+
// used, or found dead). The wait can't deadlock. Web Locks grant in order, and each earlier
|
|
67
|
+
// flight asked for the lock in its own press, before this one, so every one of them has had
|
|
68
|
+
// its turn by now (or gave it up, which answers `unavailable`). Nothing between that turn and
|
|
69
|
+
// its hooks takes the lock again: `underCookie` (signIn.ts) runs the whole send and settle as
|
|
70
|
+
// one `withCookie` turn, `settleSignIn`'s revoke (`http.logout()`) included; `oweRevoke` takes
|
|
71
|
+
// the state lock only; `notConfirmed` (logout.ts) sets a timer; `hold` (tokens.ts) sets a
|
|
72
|
+
// timer, publishes to the page's listeners and broadcasts, and takes no lock (a listener's own
|
|
73
|
+
// lock request queues behind the waiting accept). Then `flight.result` settles and the hooks
|
|
74
|
+
// run below.
|
|
75
|
+
const before = [...hooking];
|
|
76
|
+
const ready = sendable === null ? undefined : async () => {
|
|
77
|
+
await Promise.allSettled(before);
|
|
78
|
+
return sendable();
|
|
79
|
+
};
|
|
80
|
+
const flight = {
|
|
81
|
+
body,
|
|
82
|
+
callers,
|
|
83
|
+
result: signIn.through(how, body, pinned, cell.localSignOuts, callers, () => {
|
|
84
|
+
received = true;
|
|
85
|
+
}, ready),
|
|
86
|
+
};
|
|
87
|
+
flights.set(key, [...inFlight, flight]);
|
|
88
|
+
const forget = () => {
|
|
89
|
+
callers.settled();
|
|
90
|
+
const rest = (flights.get(key) ?? []).filter((other) => other !== flight);
|
|
91
|
+
if (rest.length === 0)
|
|
92
|
+
flights.delete(key);
|
|
93
|
+
else
|
|
94
|
+
flights.set(key, rest);
|
|
95
|
+
};
|
|
96
|
+
flight.result.then(forget, forget);
|
|
97
|
+
// One request, one report: read once, on the request's own result, whatever its callers did
|
|
98
|
+
// (SDK-D1976). A caller that left was answered `aborted` already and never reads it. Both
|
|
99
|
+
// hooks run before any caller is answered; a result that rejects calls neither. A hook that
|
|
100
|
+
// throws is not caught here: it surfaces as an unhandled rejection, a log-in's and an
|
|
101
|
+
// accept's alike.
|
|
102
|
+
const hooked = flight.result.then((answer) => {
|
|
103
|
+
if (answer.kind === 'refused')
|
|
104
|
+
how.onRefused(answer.answer);
|
|
105
|
+
how.onSettled(answer, { received });
|
|
106
|
+
}, () => undefined);
|
|
107
|
+
if (sendable !== null) {
|
|
108
|
+
hooking.add(hooked);
|
|
109
|
+
const done = () => {
|
|
110
|
+
hooking.delete(hooked);
|
|
111
|
+
};
|
|
112
|
+
// Its own chain: a hook's error still surfaces, from here, as it does from `hooked` alone.
|
|
113
|
+
hooked.then(done, (error) => {
|
|
114
|
+
done();
|
|
115
|
+
throw error;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return answerOf(flight, options?.signal);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** A log-in's or an accept's request, as `SignInHooks.signInThrough` says. */
|
|
122
|
+
export function createSignInThrough(cell, shared, signIn, stillOpen) {
|
|
123
|
+
const logIns = flightsOf(cell, shared, signIn);
|
|
124
|
+
const accepts = flightsOf(cell, shared, signIn);
|
|
125
|
+
async function signInThrough(request, how, options) {
|
|
126
|
+
// Closed first: a call after close() throws, as every call does.
|
|
127
|
+
stillOpen('signInThrough()');
|
|
128
|
+
// A family's programming error next, whatever the signal or the browser (SDK-D1929). A step
|
|
129
|
+
// other than these two has no route (PR #553 round 2, K4).
|
|
130
|
+
const route = how.step === 'accept' ? '/invitations/accept' : how.step === 'log-in' ? '/login' : null;
|
|
131
|
+
if (route === null || request.method !== 'POST' || request.query !== undefined || request.path !== route) {
|
|
132
|
+
throw new TypeError('a sign-in hook requires the POST route for its step');
|
|
133
|
+
}
|
|
134
|
+
const body = request.body ?? {};
|
|
135
|
+
if (how.step === 'log-in')
|
|
136
|
+
return logIns(how, null, body, options);
|
|
137
|
+
// A JavaScript family's accept without its hook (PR #553 round 1, K4).
|
|
138
|
+
if (typeof how.sendable !== 'function')
|
|
139
|
+
throw new TypeError('an accept requires its sendable hook');
|
|
140
|
+
return accepts(how, how.sendable, body, options);
|
|
141
|
+
}
|
|
142
|
+
return signInThrough;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=signInThrough.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signInThrough.js","sourceRoot":"","sources":["../../../src/first-party/session/signInThrough.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAQpD,OAAO,EAAE,YAAY,EAAqB,MAAM,mBAAmB,CAAA;AAYnE;;;GAGG;AACH,SAAS,WAAW,CAAC,CAAO,EAAE,CAAO;IACnC,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC7B,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;QAC5C,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrF,CAAC;AAED;;;;GAIG;AACH,SAAS,QAAQ,CAAI,MAAiB,EAAE,MAA+B;IACrE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,CAAA;IAC9C,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;IAC/D,IAAI,KAAK,GAAG,GAAS,EAAE,CAAC,SAAS,CAAA;IACjC,MAAM,IAAI,GAAG,IAAI,OAAO,CAA0B,CAAC,OAAO,EAAE,EAAE;QAC5D,KAAK,GAAG,GAAG,EAAE;YACX,OAAO,CAAC,EAAE,IAAI,E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