@molecule/app-http 1.1.1 → 1.1.2
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/README.md +40 -1
- package/dist/auth-gate.d.ts +56 -0
- package/dist/auth-gate.d.ts.map +1 -0
- package/dist/auth-gate.js +100 -0
- package/dist/auth-gate.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +5 -0
- package/dist/provider.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-16T22:03:15.467Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-http
|
|
@@ -339,6 +339,38 @@ class HttpError extends Error {
|
|
|
339
339
|
|
|
340
340
|
### Functions
|
|
341
341
|
|
|
342
|
+
#### `setAuthGate(next)`
|
|
343
|
+
|
|
344
|
+
Registers the gate every HTTP request awaits before it is sent, or clears it
|
|
345
|
+
with `null`.
|
|
346
|
+
|
|
347
|
+
Pass a function that resolves once the session restore has settled — with the
|
|
348
|
+
template auth that is `() => authClient.whenRestored()`, which resolves
|
|
349
|
+
immediately when no restore is in flight, so registering it never makes a
|
|
350
|
+
request wait longer than the restore it was about to race anyway.
|
|
351
|
+
|
|
352
|
+
```typescript
|
|
353
|
+
function setAuthGate(next: (() => Promise<void>) | null): void
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
- `next` — The gate, or `null` to clear a previously registered one.
|
|
357
|
+
|
|
358
|
+
#### `awaitAuthGate()`
|
|
359
|
+
|
|
360
|
+
Awaits the registered gate, if any. Every HTTP provider calls this before it
|
|
361
|
+
sends a request; callers never need to.
|
|
362
|
+
|
|
363
|
+
A gate that rejects (a restore that failed) is logged and cleared of consequence: the request
|
|
364
|
+
is sent rather than held forever, because a dead restore must not block every request for the
|
|
365
|
+
life of the page. The same holds for a gate that never settles — the wait is bounded by
|
|
366
|
+
{@link GATE_TIMEOUT_MS}.
|
|
367
|
+
|
|
368
|
+
```typescript
|
|
369
|
+
function awaitAuthGate(): Promise<void>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
**Returns:** A promise that settles when the gate has released the request.
|
|
373
|
+
|
|
342
374
|
#### `createFetchClient(config)`
|
|
343
375
|
|
|
344
376
|
Creates a fetch-based HTTP client using the native Fetch API.
|
|
@@ -557,6 +589,13 @@ resource).
|
|
|
557
589
|
An API that wants another scheme than `Bearer` (`Authorization: Token <jwt>`) sets
|
|
558
590
|
`authScheme: 'Token'` in the client config; do not hand-write a fetch wrapper for it.
|
|
559
591
|
|
|
592
|
+
A request made while the session is still being restored WAITS for that restore, so a page
|
|
593
|
+
that fetches viewer-dependent data on mount (a profile's `following` flag, a feed, a
|
|
594
|
+
`favorited` state) cannot go out unauthenticated and answer for an anonymous viewer. The auth
|
|
595
|
+
bond registers that wait with `setAuthGate`; apps that bond auth through
|
|
596
|
+
`@molecule/app-bonds-default-react` get it without doing anything. An app with its own session
|
|
597
|
+
module registers its own: `setAuthGate(() => session.whenRestored())`.
|
|
598
|
+
|
|
560
599
|
## Translations
|
|
561
600
|
|
|
562
601
|
Translation strings are provided by `@molecule/app-locales-http`.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one gate every HTTP request awaits before it is sent.
|
|
3
|
+
*
|
|
4
|
+
* A page that fetches viewer-dependent data on mount (`GET /profiles/:user`,
|
|
5
|
+
* a feed, a "favorited" flag) can fire BEFORE the stored session has been
|
|
6
|
+
* restored, so the request leaves with no `Authorization` header and the server
|
|
7
|
+
* answers for an anonymous viewer — `following: false` on a user you follow.
|
|
8
|
+
* It is invisible on localhost, where the restore wins the race against the
|
|
9
|
+
* first effect, and appears over the network as soon as the restore takes one
|
|
10
|
+
* round trip: X1 xr-molecule-flash-m95 spent ~25 min chasing this as "database
|
|
11
|
+
* leftovers" on the deployed URL.
|
|
12
|
+
*
|
|
13
|
+
* So the auth bond registers a gate here (`setAuthGate`) and every request
|
|
14
|
+
* waits for it (`awaitAuthGate`) — the race is impossible to write by hand.
|
|
15
|
+
* `@molecule/app-bonds-default-react`'s auth helpers register the gate for
|
|
16
|
+
* apps that bond auth, so an app does not have to get it right itself.
|
|
17
|
+
*
|
|
18
|
+
* The gate is module-level, not per client, on purpose: the client an app ends
|
|
19
|
+
* up using is often created AFTER the auth bond ran (`setupAuthDefault()` then
|
|
20
|
+
* `setupHttpDefault()`), and a gate installed on the throwaway client the auth
|
|
21
|
+
* bond saw would be silently lost.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Registers the gate every HTTP request awaits before it is sent, or clears it
|
|
27
|
+
* with `null`.
|
|
28
|
+
*
|
|
29
|
+
* Pass a function that resolves once the session restore has settled — with the
|
|
30
|
+
* template auth that is `() => authClient.whenRestored()`, which resolves
|
|
31
|
+
* immediately when no restore is in flight, so registering it never makes a
|
|
32
|
+
* request wait longer than the restore it was about to race anyway.
|
|
33
|
+
*
|
|
34
|
+
* @param next - The gate, or `null` to clear a previously registered one.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import { setAuthGate } from '@molecule/app-http'
|
|
39
|
+
*
|
|
40
|
+
* setAuthGate(() => authClient.whenRestored())
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const setAuthGate: (next: (() => Promise<void>) | null) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Awaits the registered gate, if any. Every HTTP provider calls this before it
|
|
46
|
+
* sends a request; callers never need to.
|
|
47
|
+
*
|
|
48
|
+
* A gate that rejects (a restore that failed) is logged and cleared of consequence: the request
|
|
49
|
+
* is sent rather than held forever, because a dead restore must not block every request for the
|
|
50
|
+
* life of the page. The same holds for a gate that never settles — the wait is bounded by
|
|
51
|
+
* {@link GATE_TIMEOUT_MS}.
|
|
52
|
+
*
|
|
53
|
+
* @returns A promise that settles when the gate has released the request.
|
|
54
|
+
*/
|
|
55
|
+
export declare const awaitAuthGate: () => Promise<void>;
|
|
56
|
+
//# sourceMappingURL=auth-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-gate.d.ts","sourceRoot":"","sources":["../src/auth-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAoBH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,KAAG,IAEhE,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,QAAa,OAAO,CAAC,IAAI,CA2BlD,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one gate every HTTP request awaits before it is sent.
|
|
3
|
+
*
|
|
4
|
+
* A page that fetches viewer-dependent data on mount (`GET /profiles/:user`,
|
|
5
|
+
* a feed, a "favorited" flag) can fire BEFORE the stored session has been
|
|
6
|
+
* restored, so the request leaves with no `Authorization` header and the server
|
|
7
|
+
* answers for an anonymous viewer — `following: false` on a user you follow.
|
|
8
|
+
* It is invisible on localhost, where the restore wins the race against the
|
|
9
|
+
* first effect, and appears over the network as soon as the restore takes one
|
|
10
|
+
* round trip: X1 xr-molecule-flash-m95 spent ~25 min chasing this as "database
|
|
11
|
+
* leftovers" on the deployed URL.
|
|
12
|
+
*
|
|
13
|
+
* So the auth bond registers a gate here (`setAuthGate`) and every request
|
|
14
|
+
* waits for it (`awaitAuthGate`) — the race is impossible to write by hand.
|
|
15
|
+
* `@molecule/app-bonds-default-react`'s auth helpers register the gate for
|
|
16
|
+
* apps that bond auth, so an app does not have to get it right itself.
|
|
17
|
+
*
|
|
18
|
+
* The gate is module-level, not per client, on purpose: the client an app ends
|
|
19
|
+
* up using is often created AFTER the auth bond ran (`setupAuthDefault()` then
|
|
20
|
+
* `setupHttpDefault()`), and a gate installed on the throwaway client the auth
|
|
21
|
+
* bond saw would be silently lost.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { getLogger } from '@molecule/app-logger';
|
|
26
|
+
const logger = getLogger('http');
|
|
27
|
+
/** The registered gate, or null when no auth bond wired one (anonymous apps). */
|
|
28
|
+
let gate = null;
|
|
29
|
+
/**
|
|
30
|
+
* How long a request may be held by the gate before it is sent anyway.
|
|
31
|
+
*
|
|
32
|
+
* The gate waits for the session restore, and a restore that never settles — a stalled
|
|
33
|
+
* connection, an endpoint that hangs without answering — must not hold back every request for
|
|
34
|
+
* the life of the page: an unauthenticated request that arrives is a better failure than an app
|
|
35
|
+
* that never loads. A settled restore is what the deployed race needs (one round trip, hundreds
|
|
36
|
+
* of milliseconds), so this bound is far above any wait it is meant to cause.
|
|
37
|
+
*/
|
|
38
|
+
const GATE_TIMEOUT_MS = 10_000;
|
|
39
|
+
/**
|
|
40
|
+
* Registers the gate every HTTP request awaits before it is sent, or clears it
|
|
41
|
+
* with `null`.
|
|
42
|
+
*
|
|
43
|
+
* Pass a function that resolves once the session restore has settled — with the
|
|
44
|
+
* template auth that is `() => authClient.whenRestored()`, which resolves
|
|
45
|
+
* immediately when no restore is in flight, so registering it never makes a
|
|
46
|
+
* request wait longer than the restore it was about to race anyway.
|
|
47
|
+
*
|
|
48
|
+
* @param next - The gate, or `null` to clear a previously registered one.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { setAuthGate } from '@molecule/app-http'
|
|
53
|
+
*
|
|
54
|
+
* setAuthGate(() => authClient.whenRestored())
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const setAuthGate = (next) => {
|
|
58
|
+
gate = next;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Awaits the registered gate, if any. Every HTTP provider calls this before it
|
|
62
|
+
* sends a request; callers never need to.
|
|
63
|
+
*
|
|
64
|
+
* A gate that rejects (a restore that failed) is logged and cleared of consequence: the request
|
|
65
|
+
* is sent rather than held forever, because a dead restore must not block every request for the
|
|
66
|
+
* life of the page. The same holds for a gate that never settles — the wait is bounded by
|
|
67
|
+
* {@link GATE_TIMEOUT_MS}.
|
|
68
|
+
*
|
|
69
|
+
* @returns A promise that settles when the gate has released the request.
|
|
70
|
+
*/
|
|
71
|
+
export const awaitAuthGate = async () => {
|
|
72
|
+
const current = gate;
|
|
73
|
+
if (!current)
|
|
74
|
+
return;
|
|
75
|
+
let timer;
|
|
76
|
+
let timedOut = false;
|
|
77
|
+
try {
|
|
78
|
+
await Promise.race([
|
|
79
|
+
Promise.resolve(current()).catch((error) => {
|
|
80
|
+
logger.warn('The auth gate rejected; sending the request without waiting for it', {
|
|
81
|
+
error,
|
|
82
|
+
});
|
|
83
|
+
}),
|
|
84
|
+
new Promise((resolve) => {
|
|
85
|
+
timer = setTimeout(() => {
|
|
86
|
+
timedOut = true;
|
|
87
|
+
resolve();
|
|
88
|
+
}, GATE_TIMEOUT_MS);
|
|
89
|
+
}),
|
|
90
|
+
]);
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
if (timer)
|
|
94
|
+
clearTimeout(timer);
|
|
95
|
+
}
|
|
96
|
+
if (timedOut) {
|
|
97
|
+
logger.warn(`The auth gate has not settled after ${GATE_TIMEOUT_MS}ms; sending the request unauthenticated`);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=auth-gate.js.map
|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AAC,CAAA;IAChC,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CACT,uCAAuC,eAAe,yCAAyC,CAChG,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -44,8 +44,16 @@
|
|
|
44
44
|
* An API that wants another scheme than `Bearer` (`Authorization: Token <jwt>`) sets
|
|
45
45
|
* `authScheme: 'Token'` in the client config; do not hand-write a fetch wrapper for it.
|
|
46
46
|
*
|
|
47
|
+
* A request made while the session is still being restored WAITS for that restore, so a page
|
|
48
|
+
* that fetches viewer-dependent data on mount (a profile's `following` flag, a feed, a
|
|
49
|
+
* `favorited` state) cannot go out unauthenticated and answer for an anonymous viewer. The auth
|
|
50
|
+
* bond registers that wait with `setAuthGate`; apps that bond auth through
|
|
51
|
+
* `@molecule/app-bonds-default-react` get it without doing anything. An app with its own session
|
|
52
|
+
* module registers its own: `setAuthGate(() => session.whenRestored())`.
|
|
53
|
+
*
|
|
47
54
|
* @module
|
|
48
55
|
*/
|
|
56
|
+
export * from './auth-gate.js';
|
|
49
57
|
export * from './client.js';
|
|
50
58
|
export * from './interceptors.js';
|
|
51
59
|
export * from './provider.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -44,8 +44,16 @@
|
|
|
44
44
|
* An API that wants another scheme than `Bearer` (`Authorization: Token <jwt>`) sets
|
|
45
45
|
* `authScheme: 'Token'` in the client config; do not hand-write a fetch wrapper for it.
|
|
46
46
|
*
|
|
47
|
+
* A request made while the session is still being restored WAITS for that restore, so a page
|
|
48
|
+
* that fetches viewer-dependent data on mount (a profile's `following` flag, a feed, a
|
|
49
|
+
* `favorited` state) cannot go out unauthenticated and answer for an anonymous viewer. The auth
|
|
50
|
+
* bond registers that wait with `setAuthGate`; apps that bond auth through
|
|
51
|
+
* `@molecule/app-bonds-default-react` get it without doing anything. An app with its own session
|
|
52
|
+
* module registers its own: `setAuthGate(() => session.whenRestored())`.
|
|
53
|
+
*
|
|
47
54
|
* @module
|
|
48
55
|
*/
|
|
56
|
+
export * from './auth-gate.js';
|
|
49
57
|
export * from './client.js';
|
|
50
58
|
export * from './interceptors.js';
|
|
51
59
|
export * from './provider.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA"}
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAK/D;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAQ,gBAAqB,KAAG,UA6VjE,CAAA"}
|
package/dist/provider.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { t } from '@molecule/app-i18n';
|
|
9
9
|
import { getLogger } from '@molecule/app-logger';
|
|
10
|
+
import { awaitAuthGate } from './auth-gate.js';
|
|
10
11
|
import { HttpError } from './types.js';
|
|
11
12
|
/**
|
|
12
13
|
* Creates a fetch-based HTTP client using the native Fetch API.
|
|
@@ -49,6 +50,10 @@ export const createFetchClient = (config = {}) => {
|
|
|
49
50
|
baseURL: config.baseURL || '',
|
|
50
51
|
defaultHeaders: config.defaultHeaders || {},
|
|
51
52
|
async request(requestConfig) {
|
|
53
|
+
// Wait for the session restore before anything else: the interceptors below
|
|
54
|
+
// read the auth token, and the request must not leave unauthenticated just
|
|
55
|
+
// because a page effect ran before the restore settled (see auth-gate.ts).
|
|
56
|
+
await awaitAuthGate();
|
|
52
57
|
// Apply request interceptors
|
|
53
58
|
let finalConfig = { ...requestConfig };
|
|
54
59
|
for (const interceptor of requestInterceptors) {
|
package/dist/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE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