@floegence/flowersec-core 5.2.2 → 5.3.1
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 +14 -0
- package/THIRD_PARTY_NOTICES.md +5 -5
- package/dist/node/proxyServer.d.ts +3 -0
- package/dist/node/proxyServer.js +67 -4
- package/dist/proxy/fetch.d.ts +6 -0
- package/dist/proxy/fetch.js +145 -0
- package/dist/proxy/runtime.js +195 -63
- package/dist/proxy/serviceWorkerRuntime.d.ts +1 -0
- package/dist/proxy/serviceWorkerRuntime.js +5 -1
- package/dist/proxy/types.d.ts +4 -0
- package/dist/proxy/windowBridge.js +19 -4
- package/dist/v3/connectionController.d.ts +4 -0
- package/dist/v3/connectionController.js +3 -0
- package/dist/v3/controller.d.ts +2 -0
- package/dist/v3/controller.js +7 -0
- package/package.json +3 -3
- package/sbom/cyclonedx.json +31 -31
- package/sbom/spdx.json +36 -36
package/README.md
CHANGED
|
@@ -93,3 +93,17 @@ See the [TypeScript cookbook](../examples/ts/README.md),
|
|
|
93
93
|
[Transport v3 architecture](../docs/TRANSPORT_V3_ARCHITECTURE.md),
|
|
94
94
|
[wire contract](../docs/TRANSPORT_V3_WIRE.md), and
|
|
95
95
|
[error model](../docs/ERROR_MODEL.md).
|
|
96
|
+
|
|
97
|
+
### Connection retry status
|
|
98
|
+
|
|
99
|
+
While a connection controller is `waiting`, its snapshot and diagnostic include
|
|
100
|
+
`nextRetryAtUnixMilliseconds`, the scheduler-owned wall-clock estimate of the next
|
|
101
|
+
attempt. It accounts for both exponential backoff and any server `retry_after`
|
|
102
|
+
minimum. Hosts may display a countdown without duplicating the retry policy. The
|
|
103
|
+
field is absent outside `waiting`. `retryNow()` can skip backoff but cannot bypass
|
|
104
|
+
a server minimum; `close()` cancels the wait. Wall-clock corrections can change
|
|
105
|
+
the displayed estimate; the scheduler still enforces its monotonic backoff.
|
|
106
|
+
|
|
107
|
+
## Session-bound HTTP events
|
|
108
|
+
|
|
109
|
+
Use `createProxyRuntime({ session, externalOrigin }).fetch("/api/events", { headers: { Accept: "text/event-stream" }, signal })` to read a standard streaming `Response` over the existing session. Consume or cancel the body and dispose the runtime when its session is replaced. The runtime never retries requests. It shares policy, framing, cancellation and admission with the browser bridges. The Go and Node proxy servers support negotiated SSE with bounded backpressure and activity deadlines; ordinary requests retain finite response limits. Default HTTP admission is 24 requests, including at most 16 event streams. Rejected event subscriptions report `resource_exhausted` immediately.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
This file is generated from the canonical Flowersec source dependency inventory for flowersec-ts.
|
|
4
4
|
Do not edit it manually. License decisions are reviewed by the repository source license policy.
|
|
5
5
|
|
|
6
|
-
- @floegence/flowersec-node-native 5.
|
|
7
|
-
- @floegence/flowersec-node-native-darwin-arm64 5.
|
|
8
|
-
- @floegence/flowersec-node-native-darwin-x64 5.
|
|
9
|
-
- @floegence/flowersec-node-native-linux-arm64-gnu 5.
|
|
10
|
-
- @floegence/flowersec-node-native-linux-x64-gnu 5.
|
|
6
|
+
- @floegence/flowersec-node-native 5.3.1 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
7
|
+
- @floegence/flowersec-node-native-darwin-arm64 5.3.1 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
8
|
+
- @floegence/flowersec-node-native-darwin-x64 5.3.1 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
9
|
+
- @floegence/flowersec-node-native-linux-arm64-gnu 5.3.1 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
10
|
+
- @floegence/flowersec-node-native-linux-x64-gnu 5.3.1 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
11
11
|
- @noble/ciphers 2.4.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.4.0.tgz)
|
|
12
12
|
- @noble/curves 2.4.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/@noble/curves/-/curves-2.4.0.tgz)
|
|
13
13
|
- @noble/hashes 2.4.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz)
|
|
@@ -7,6 +7,9 @@ export type ProxyServerOptions = Readonly<{
|
|
|
7
7
|
allowedUpstreamHosts?: readonly string[];
|
|
8
8
|
allowedOrigins?: readonly string[];
|
|
9
9
|
maxConcurrentStreams?: number;
|
|
10
|
+
maxConcurrentHTTPStreams?: number;
|
|
11
|
+
maxConcurrentEventStreams?: number;
|
|
12
|
+
eventStreamIdleTimeoutMs?: number;
|
|
10
13
|
maxJsonFrameBytes?: number;
|
|
11
14
|
maxChunkBytes?: number;
|
|
12
15
|
maxBodyBytes?: number;
|
package/dist/node/proxyServer.js
CHANGED
|
@@ -33,6 +33,8 @@ export class ProxyServer {
|
|
|
33
33
|
#completion;
|
|
34
34
|
#resolveCompletion;
|
|
35
35
|
#closed = false;
|
|
36
|
+
#httpCount = 0;
|
|
37
|
+
#eventCount = 0;
|
|
36
38
|
constructor(options) {
|
|
37
39
|
this.#config = compileConfig(options);
|
|
38
40
|
this.#completion = new Promise((resolve) => { this.#resolveCompletion = resolve; });
|
|
@@ -162,6 +164,14 @@ export class ProxyServer {
|
|
|
162
164
|
const linked = linkSignals(parentSignal, timeoutController.signal);
|
|
163
165
|
const signal = linked.signal;
|
|
164
166
|
let reset;
|
|
167
|
+
let peerWatch;
|
|
168
|
+
let responseReader;
|
|
169
|
+
let httpPermit = false;
|
|
170
|
+
let eventPermit = false;
|
|
171
|
+
const releaseEvent = () => { if (eventPermit) {
|
|
172
|
+
eventPermit = false;
|
|
173
|
+
this.#eventCount--;
|
|
174
|
+
} };
|
|
165
175
|
const abort = () => { reset ??= stream.reset().catch(() => undefined); };
|
|
166
176
|
signal.addEventListener("abort", abort, { once: true });
|
|
167
177
|
if (signal.aborted)
|
|
@@ -198,6 +208,27 @@ export class ProxyServer {
|
|
|
198
208
|
await writeHTTPError(stream, requestID, "request_body_invalid");
|
|
199
209
|
return;
|
|
200
210
|
}
|
|
211
|
+
// A peer reset cancels the upstream even when it has no next event to write.
|
|
212
|
+
// A FIN only closes request writes and is valid during response streaming.
|
|
213
|
+
peerWatch = stream.read({ signal }).then((chunk) => {
|
|
214
|
+
if (chunk !== null)
|
|
215
|
+
timeoutController.abort(new SessionError("canceled"));
|
|
216
|
+
}, () => { timeoutController.abort(new SessionError("canceled")); });
|
|
217
|
+
if (this.#httpCount >= this.#config.maxHTTP) {
|
|
218
|
+
await writeHTTPError(stream, requestID, "resource_exhausted");
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
httpPermit = true;
|
|
222
|
+
this.#httpCount++;
|
|
223
|
+
const eventRequested = meta.headers.some(({ name, value }) => name.toLowerCase() === "accept" && value.split(",").some(acceptsEventStream));
|
|
224
|
+
if (eventRequested) {
|
|
225
|
+
if (this.#eventCount >= this.#config.maxEvents) {
|
|
226
|
+
await writeHTTPError(stream, requestID, "resource_exhausted");
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
eventPermit = true;
|
|
230
|
+
this.#eventCount++;
|
|
231
|
+
}
|
|
201
232
|
const externalOrigin = validateOrigin(meta.external_origin, this.#config.allowedOrigins);
|
|
202
233
|
if (meta.external_origin !== undefined && externalOrigin === undefined) {
|
|
203
234
|
await writeHTTPError(stream, requestID, "invalid_request_meta");
|
|
@@ -221,8 +252,19 @@ export class ProxyServer {
|
|
|
221
252
|
};
|
|
222
253
|
try {
|
|
223
254
|
const response = await fetch(target, requestInit);
|
|
255
|
+
const persistent = eventRequested && isEventStream(response.headers.get("content-type") ?? "");
|
|
256
|
+
const activity = () => {
|
|
257
|
+
if (!persistent)
|
|
258
|
+
return;
|
|
259
|
+
clearTimeout(timer);
|
|
260
|
+
timer = setTimeout(() => timeoutController.abort(), this.#config.eventIdleTimeout);
|
|
261
|
+
};
|
|
262
|
+
if (persistent)
|
|
263
|
+
activity();
|
|
264
|
+
else
|
|
265
|
+
releaseEvent();
|
|
224
266
|
const contentLength = response.headers.get("content-length");
|
|
225
|
-
if (contentLength !== null && Number(contentLength) > this.#config.maxBody) {
|
|
267
|
+
if (!persistent && contentLength !== null && Number(contentLength) > this.#config.maxBody) {
|
|
226
268
|
await writeHTTPError(stream, requestID, "response_body_too_large");
|
|
227
269
|
return;
|
|
228
270
|
}
|
|
@@ -232,12 +274,15 @@ export class ProxyServer {
|
|
|
232
274
|
}, signal);
|
|
233
275
|
let total = 0;
|
|
234
276
|
const reader = response.body?.getReader();
|
|
277
|
+
responseReader = reader;
|
|
235
278
|
if (reader !== undefined) {
|
|
236
279
|
while (true) {
|
|
237
280
|
const result = await reader.read();
|
|
238
281
|
if (result.done)
|
|
239
282
|
break;
|
|
240
|
-
|
|
283
|
+
activity();
|
|
284
|
+
if (!persistent)
|
|
285
|
+
total += result.value.length;
|
|
241
286
|
if (total > this.#config.maxBody)
|
|
242
287
|
throw new Error("upstream response body exceeds limit");
|
|
243
288
|
for (let offset = 0; offset < result.value.length; offset += this.#config.maxChunk) {
|
|
@@ -257,8 +302,15 @@ export class ProxyServer {
|
|
|
257
302
|
}
|
|
258
303
|
finally {
|
|
259
304
|
clearTimeout(timer);
|
|
305
|
+
releaseEvent();
|
|
306
|
+
if (httpPermit)
|
|
307
|
+
this.#httpCount--;
|
|
260
308
|
linked.dispose();
|
|
261
309
|
signal.removeEventListener("abort", abort);
|
|
310
|
+
timeoutController.abort();
|
|
311
|
+
await responseReader?.cancel().catch(() => undefined);
|
|
312
|
+
responseReader?.releaseLock();
|
|
313
|
+
await peerWatch;
|
|
262
314
|
await reset;
|
|
263
315
|
}
|
|
264
316
|
}
|
|
@@ -343,13 +395,18 @@ function compileConfig(options) {
|
|
|
343
395
|
}
|
|
344
396
|
const positive = (value, fallback) => value === undefined ? fallback : value;
|
|
345
397
|
const maxConcurrent = positive(options.maxConcurrentStreams, 64);
|
|
398
|
+
const maxHTTP = positive(options.maxConcurrentHTTPStreams, Math.min(24, maxConcurrent));
|
|
399
|
+
const maxEvents = positive(options.maxConcurrentEventStreams, Math.max(1, Math.min(16, Math.floor(maxHTTP * 2 / 3))));
|
|
400
|
+
const eventIdleTimeout = positive(options.eventStreamIdleTimeoutMs, 45_000);
|
|
401
|
+
if (maxHTTP > maxConcurrent || maxEvents > maxHTTP)
|
|
402
|
+
throw new ProxyServerError("invalid_options");
|
|
346
403
|
const maxJSON = positive(options.maxJsonFrameBytes, DEFAULT_MAX_JSON);
|
|
347
404
|
const maxChunk = positive(options.maxChunkBytes, DEFAULT_MAX_CHUNK);
|
|
348
405
|
const maxBody = positive(options.maxBodyBytes, DEFAULT_MAX_BODY);
|
|
349
406
|
const maxWS = positive(options.maxWebSocketFrameBytes, DEFAULT_MAX_WS);
|
|
350
407
|
const defaultTimeout = positive(options.defaultHTTPRequestTimeoutMs, DEFAULT_TIMEOUT);
|
|
351
408
|
const maxTimeout = positive(options.maxHTTPRequestTimeoutMs, MAX_TIMEOUT);
|
|
352
|
-
if ([maxConcurrent, maxJSON, maxChunk, maxBody, maxWS, defaultTimeout, maxTimeout].some((value) => !Number.isSafeInteger(value) || value < 1) || defaultTimeout > maxTimeout)
|
|
409
|
+
if ([maxConcurrent, maxHTTP, maxEvents, eventIdleTimeout, maxJSON, maxChunk, maxBody, maxWS, defaultTimeout, maxTimeout].some((value) => !Number.isSafeInteger(value) || value < 1) || defaultTimeout > maxTimeout)
|
|
353
410
|
throw new ProxyServerError("invalid_options");
|
|
354
411
|
const normalizeHeaders = (values) => new Set((values ?? []).map((name) => {
|
|
355
412
|
const lower = name.trim().toLowerCase();
|
|
@@ -373,7 +430,7 @@ function compileConfig(options) {
|
|
|
373
430
|
websocketHeaders: normalizeHeaders(options.extraWebSocketHeaders),
|
|
374
431
|
forbiddenCookies: new Set(normalizeCookieValues(options.forbiddenCookieNames)),
|
|
375
432
|
forbiddenCookiePrefixes: normalizeCookieValues(options.forbiddenCookieNamePrefixes),
|
|
376
|
-
maxConcurrent, maxJSON, maxChunk, maxBody, maxWS, defaultTimeout, maxTimeout,
|
|
433
|
+
maxConcurrent, maxHTTP, maxEvents, eventIdleTimeout, maxJSON, maxChunk, maxBody, maxWS, defaultTimeout, maxTimeout,
|
|
377
434
|
...(options.onError === undefined ? {} : { report: options.onError }),
|
|
378
435
|
};
|
|
379
436
|
}
|
|
@@ -605,3 +662,9 @@ function decodeWebSocketClose(payload) {
|
|
|
605
662
|
const reason = new TextDecoder("utf-8", { fatal: true }).decode(payload.subarray(2));
|
|
606
663
|
return { code, reason };
|
|
607
664
|
}
|
|
665
|
+
function isEventStream(value) {
|
|
666
|
+
return value.split(";", 1)[0]?.trim().toLowerCase() === "text/event-stream";
|
|
667
|
+
}
|
|
668
|
+
function acceptsEventStream(value) {
|
|
669
|
+
return isEventStream(value) && !/;\s*q=0(?:\.0*)?\s*(?:;|$)/iu.test(value);
|
|
670
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ProxyFetchRequest, ProxyRuntime } from "./types.js";
|
|
2
|
+
export declare function prepareProxyFetch(input: RequestInfo | URL, init?: RequestInit, externalOrigin?: string, maxBodyBytes?: number): Promise<{
|
|
3
|
+
request: ProxyFetchRequest;
|
|
4
|
+
signal: AbortSignal;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function fetchProxyPort(dispatch: ProxyRuntime["dispatchFetch"], request: ProxyFetchRequest, signal: AbortSignal, maxChunkBytes?: number): Promise<Response>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { enableResponseFlowControl } from "./serviceWorkerRuntime.js";
|
|
2
|
+
import { SessionError } from "../public/contract.js";
|
|
3
|
+
import { InvalidProxyPathError, normalizePath } from "./policy.js";
|
|
4
|
+
export async function prepareProxyFetch(input, init, externalOrigin, maxBodyBytes = 64 * 1024 * 1024) {
|
|
5
|
+
const raw = input instanceof Request ? input.url : String(input);
|
|
6
|
+
let path = raw;
|
|
7
|
+
if (!raw.startsWith("/")) {
|
|
8
|
+
const url = new URL(raw);
|
|
9
|
+
if (externalOrigin === undefined || url.origin !== externalOrigin || url.username || url.password || url.hash) {
|
|
10
|
+
throw new InvalidProxyPathError("proxy fetch requires a path or the configured external origin");
|
|
11
|
+
}
|
|
12
|
+
path = url.pathname + url.search;
|
|
13
|
+
}
|
|
14
|
+
path = normalizePath(path);
|
|
15
|
+
const request = new Request(input instanceof Request ? input : `https://flowersec.invalid${path}`, init);
|
|
16
|
+
request.signal.throwIfAborted();
|
|
17
|
+
let body;
|
|
18
|
+
if (request.body !== null) {
|
|
19
|
+
const reader = request.body.getReader();
|
|
20
|
+
const abort = () => { void reader.cancel().catch(() => undefined); };
|
|
21
|
+
request.signal.addEventListener("abort", abort, { once: true });
|
|
22
|
+
const chunks = [];
|
|
23
|
+
let total = 0;
|
|
24
|
+
try {
|
|
25
|
+
for (;;) {
|
|
26
|
+
request.signal.throwIfAborted();
|
|
27
|
+
const next = await reader.read();
|
|
28
|
+
request.signal.throwIfAborted();
|
|
29
|
+
if (next.done)
|
|
30
|
+
break;
|
|
31
|
+
total += next.value.byteLength;
|
|
32
|
+
if (total > maxBodyBytes)
|
|
33
|
+
throw new SessionError("resource_exhausted");
|
|
34
|
+
chunks.push(next.value);
|
|
35
|
+
}
|
|
36
|
+
const bytes = new Uint8Array(total);
|
|
37
|
+
let offset = 0;
|
|
38
|
+
for (const chunk of chunks) {
|
|
39
|
+
bytes.set(chunk, offset);
|
|
40
|
+
offset += chunk.length;
|
|
41
|
+
}
|
|
42
|
+
body = bytes.buffer;
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
request.signal.removeEventListener("abort", abort);
|
|
46
|
+
await reader.cancel().catch(() => undefined);
|
|
47
|
+
reader.releaseLock();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { request: enableResponseFlowControl({ id: "", method: request.method, path,
|
|
51
|
+
headers: Array.from(request.headers, ([name, value]) => ({ name, value })),
|
|
52
|
+
...(body === undefined ? {} : { body }),
|
|
53
|
+
}), signal: request.signal };
|
|
54
|
+
}
|
|
55
|
+
// Window applications use the same controller-owned transaction through a
|
|
56
|
+
// credited port. At most one body chunk may be in flight across the bridge.
|
|
57
|
+
export function fetchProxyPort(dispatch, request, signal, maxChunkBytes = 256 * 1024) {
|
|
58
|
+
return new Promise((resolve, reject) => {
|
|
59
|
+
const channel = new MessageChannel();
|
|
60
|
+
const port = channel.port1;
|
|
61
|
+
let output;
|
|
62
|
+
let finished = false;
|
|
63
|
+
let receivedMetadata = false;
|
|
64
|
+
let pending;
|
|
65
|
+
const finish = (error) => {
|
|
66
|
+
if (finished)
|
|
67
|
+
return;
|
|
68
|
+
finished = true;
|
|
69
|
+
signal.removeEventListener("abort", abort);
|
|
70
|
+
port.close();
|
|
71
|
+
pending?.();
|
|
72
|
+
if (error) {
|
|
73
|
+
output?.error(error);
|
|
74
|
+
reject(error);
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
output?.close();
|
|
78
|
+
};
|
|
79
|
+
const abort = () => {
|
|
80
|
+
port.postMessage({ type: "flowersec-proxy:abort" });
|
|
81
|
+
finish(new SessionError("canceled"));
|
|
82
|
+
};
|
|
83
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
84
|
+
port.onmessage = (event) => {
|
|
85
|
+
if (finished)
|
|
86
|
+
return;
|
|
87
|
+
const message = event.data;
|
|
88
|
+
switch (message?.type) {
|
|
89
|
+
case "flowersec-proxy:response_meta": {
|
|
90
|
+
if (receivedMetadata || !Number.isInteger(message.status) || message.status < 200 || message.status > 599 || !Array.isArray(message.headers)) {
|
|
91
|
+
abort();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
receivedMetadata = true;
|
|
95
|
+
const noBody = request.method === "HEAD" || [204, 205, 304].includes(message.status);
|
|
96
|
+
const body = noBody ? null : new ReadableStream({
|
|
97
|
+
start(controller) { output = controller; },
|
|
98
|
+
pull() {
|
|
99
|
+
return new Promise((done) => {
|
|
100
|
+
pending = done;
|
|
101
|
+
port.postMessage({ type: "flowersec-proxy:response_credit" });
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
cancel() { abort(); },
|
|
105
|
+
}, { highWaterMark: 0 });
|
|
106
|
+
try {
|
|
107
|
+
resolve(new Response(body, { status: message.status,
|
|
108
|
+
headers: message.headers.map(({ name, value }) => [name, value]),
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
abort();
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "flowersec-proxy:response_chunk":
|
|
117
|
+
if (!output || !pending || !(message.data instanceof ArrayBuffer) || message.data.byteLength > maxChunkBytes) {
|
|
118
|
+
abort();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
output.enqueue(new Uint8Array(message.data));
|
|
122
|
+
pending?.();
|
|
123
|
+
pending = undefined;
|
|
124
|
+
break;
|
|
125
|
+
case "flowersec-proxy:response_end":
|
|
126
|
+
if (!receivedMetadata)
|
|
127
|
+
abort();
|
|
128
|
+
else
|
|
129
|
+
finish();
|
|
130
|
+
break;
|
|
131
|
+
case "flowersec-proxy:response_error":
|
|
132
|
+
finish(new SessionError(message.code === "resource_exhausted" ? "resource_exhausted" : "operation_failed"));
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
try {
|
|
137
|
+
dispatch(request, channel.port2);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
abort();
|
|
141
|
+
}
|
|
142
|
+
if (signal.aborted)
|
|
143
|
+
abort();
|
|
144
|
+
});
|
|
145
|
+
}
|
package/dist/proxy/runtime.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { prepareProxyFetch } from "./fetch.js";
|
|
1
2
|
import { SDK_DEFAULTS } from "../defaults.js";
|
|
2
3
|
import { readJsonFrame, writeJsonFrame } from "../framing/jsonframe.js";
|
|
3
4
|
import { base64urlEncode } from "../utils/base64url.js";
|
|
@@ -16,6 +17,12 @@ const DEFAULT_MAX_QUEUED_HTTP_REQUESTS = 128;
|
|
|
16
17
|
const DEFAULT_MAX_QUEUED_HTTP_BODY_BYTES = 64 * 1024 * 1024;
|
|
17
18
|
class ProxyPolicyError extends Error {
|
|
18
19
|
}
|
|
20
|
+
function isEventStream(value) {
|
|
21
|
+
return value.split(";", 1)[0]?.trim().toLowerCase() === "text/event-stream";
|
|
22
|
+
}
|
|
23
|
+
function acceptsEventStream(value) {
|
|
24
|
+
return value.split(",").some((part) => isEventStream(part) && !/;\s*q=0(?:\.0*)?\s*(?:;|$)/iu.test(part));
|
|
25
|
+
}
|
|
19
26
|
function randomID() {
|
|
20
27
|
const bytes = new Uint8Array(18);
|
|
21
28
|
if (globalThis.crypto?.getRandomValues !== undefined)
|
|
@@ -123,7 +130,7 @@ class StreamAdmission {
|
|
|
123
130
|
this.queued = queued;
|
|
124
131
|
this.queuedBodyBytes = queuedBodyBytes;
|
|
125
132
|
}
|
|
126
|
-
acquire(bytes, signal) {
|
|
133
|
+
acquire(bytes, signal, noQueue = false) {
|
|
127
134
|
if (this.closed)
|
|
128
135
|
return Promise.reject(new SessionError("closed"));
|
|
129
136
|
if (signal?.aborted === true)
|
|
@@ -132,7 +139,7 @@ class StreamAdmission {
|
|
|
132
139
|
this.active++;
|
|
133
140
|
return Promise.resolve(this.releaseFunction());
|
|
134
141
|
}
|
|
135
|
-
if (this.queue.length >= this.queued || this.queuedBytes + bytes > this.queuedBodyBytes) {
|
|
142
|
+
if (noQueue || this.queue.length >= this.queued || this.queuedBytes + bytes > this.queuedBodyBytes) {
|
|
136
143
|
return Promise.reject(new SessionError("resource_exhausted"));
|
|
137
144
|
}
|
|
138
145
|
return new Promise((resolve, reject) => {
|
|
@@ -212,7 +219,8 @@ async function* readChunks(reader, maxChunkBytes, maxBodyBytes) {
|
|
|
212
219
|
return;
|
|
213
220
|
if (length > maxChunkBytes || total + length > maxBodyBytes)
|
|
214
221
|
throw new SessionError("resource_exhausted");
|
|
215
|
-
|
|
222
|
+
if (Number.isFinite(maxBodyBytes))
|
|
223
|
+
total += length;
|
|
216
224
|
yield await reader.readExactly(length);
|
|
217
225
|
}
|
|
218
226
|
}
|
|
@@ -240,6 +248,10 @@ export function createProxyRuntime(options) {
|
|
|
240
248
|
const maxConcurrentHttpStreams = strictlyPositiveLimit("maxConcurrentHttpStreams", options.maxConcurrentHttpStreams, DEFAULT_MAX_CONCURRENT_HTTP_STREAMS);
|
|
241
249
|
const maxQueuedHttpRequests = positiveLimit("maxQueuedHttpRequests", options.maxQueuedHttpRequests, DEFAULT_MAX_QUEUED_HTTP_REQUESTS);
|
|
242
250
|
const maxQueuedHttpBodyBytes = positiveLimit("maxQueuedHttpBodyBytes", options.maxQueuedHttpBodyBytes, DEFAULT_MAX_QUEUED_HTTP_BODY_BYTES);
|
|
251
|
+
const maxConcurrentEventStreams = strictlyPositiveLimit("maxConcurrentEventStreams", options.maxConcurrentEventStreams, Math.max(1, Math.min(16, Math.floor(maxConcurrentHttpStreams * 2 / 3))));
|
|
252
|
+
if (maxConcurrentEventStreams > maxConcurrentHttpStreams)
|
|
253
|
+
throw new TypeError("event streams exceed HTTP concurrency");
|
|
254
|
+
const eventStreamIdleTimeoutMs = strictlyPositiveLimit("eventStreamIdleTimeoutMs", options.eventStreamIdleTimeoutMs, 45_000);
|
|
243
255
|
const timeoutMs = normalizeTimeout(options.timeoutMs);
|
|
244
256
|
const pathPolicy = normalizePathPolicy(options.pathPolicy);
|
|
245
257
|
const externalOrigin = normalizeOrigin(options.externalOrigin);
|
|
@@ -249,6 +261,9 @@ export function createProxyRuntime(options) {
|
|
|
249
261
|
const webSocketExtra = normalizeHeaderNames(options.extraWebSocketHeaders);
|
|
250
262
|
const admission = new StreamAdmission(maxConcurrentHttpStreams, maxQueuedHttpRequests, maxQueuedHttpBodyBytes);
|
|
251
263
|
let disposed = false;
|
|
264
|
+
let activeEvents = 0;
|
|
265
|
+
const active = new Set();
|
|
266
|
+
const lifetime = new AbortController();
|
|
252
267
|
const register = () => void ensureServiceWorkerRuntimeRegistered({
|
|
253
268
|
timeoutMs: 2_000,
|
|
254
269
|
...(runtimeRegistrationToken === undefined ? {} : { runtimeRegistrationToken }),
|
|
@@ -257,85 +272,197 @@ export function createProxyRuntime(options) {
|
|
|
257
272
|
serviceWorker?.addEventListener("controllerchange", register);
|
|
258
273
|
register();
|
|
259
274
|
let serviceWorkerBridge;
|
|
260
|
-
|
|
275
|
+
// One transaction owns admission, framing, cancellation and response backpressure
|
|
276
|
+
// for direct fetch and both browser bridges. It never reconnects a request.
|
|
277
|
+
async function execute(request, signal) {
|
|
278
|
+
if (disposed)
|
|
279
|
+
throw new SessionError("closed");
|
|
280
|
+
const path = normalizePath(request.path);
|
|
281
|
+
enforcePathPolicy("http", path, pathPolicy);
|
|
282
|
+
const headers = filterHeaders(request.headers, BASE_REQUEST_HEADERS, requestExtra);
|
|
283
|
+
const eventRequested = headers.some(({ name, value }) => name === "accept" && acceptsEventStream(value));
|
|
284
|
+
if (eventRequested && activeEvents >= maxConcurrentEventStreams)
|
|
285
|
+
throw new SessionError("resource_exhausted");
|
|
286
|
+
let eventPermit = eventRequested;
|
|
287
|
+
if (eventPermit)
|
|
288
|
+
activeEvents++;
|
|
261
289
|
const controller = new AbortController();
|
|
290
|
+
active.add(controller);
|
|
262
291
|
let stream;
|
|
263
292
|
let release;
|
|
264
|
-
|
|
265
|
-
let
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
293
|
+
let output;
|
|
294
|
+
let finished = false;
|
|
295
|
+
let timer;
|
|
296
|
+
const releaseEvent = () => { if (eventPermit) {
|
|
297
|
+
eventPermit = false;
|
|
298
|
+
activeEvents--;
|
|
299
|
+
} };
|
|
300
|
+
const finish = (error) => {
|
|
301
|
+
if (finished)
|
|
302
|
+
return;
|
|
303
|
+
finished = true;
|
|
304
|
+
clearTimeout(timer);
|
|
305
|
+
signal?.removeEventListener("abort", cancel);
|
|
306
|
+
controller.signal.removeEventListener("abort", onAbort);
|
|
307
|
+
active.delete(controller);
|
|
308
|
+
releaseEvent();
|
|
309
|
+
release?.();
|
|
310
|
+
if (error !== undefined) {
|
|
311
|
+
output?.error(error);
|
|
312
|
+
void stream?.reset().catch(() => undefined);
|
|
271
313
|
}
|
|
272
|
-
else
|
|
273
|
-
|
|
274
|
-
|
|
314
|
+
else {
|
|
315
|
+
output?.close();
|
|
316
|
+
void stream?.close().catch(() => undefined);
|
|
275
317
|
}
|
|
276
318
|
};
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
319
|
+
const cancel = () => controller.abort(new SessionError("canceled"));
|
|
320
|
+
const onAbort = () => finish(controller.signal.reason ?? new SessionError("canceled"));
|
|
321
|
+
const arm = (duration) => {
|
|
322
|
+
clearTimeout(timer);
|
|
323
|
+
timer = setTimeout(() => controller.abort(new SessionError("timeout")), duration);
|
|
324
|
+
};
|
|
325
|
+
controller.signal.addEventListener("abort", onAbort, { once: true });
|
|
326
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
327
|
+
try {
|
|
328
|
+
if (signal?.aborted)
|
|
329
|
+
cancel();
|
|
330
|
+
controller.signal.throwIfAborted();
|
|
331
|
+
const body = request.body === undefined ? new Uint8Array() : new Uint8Array(request.body);
|
|
332
|
+
if (body.length > maxBodyBytes)
|
|
333
|
+
throw new SessionError("resource_exhausted");
|
|
334
|
+
// Persistent requests never queue behind an occupied finite-request slot.
|
|
335
|
+
release = await admission.acquire(body.length, controller.signal, eventRequested);
|
|
336
|
+
controller.signal.throwIfAborted();
|
|
337
|
+
arm(timeoutMs || SDK_DEFAULTS.proxy.defaultTimeoutMs);
|
|
338
|
+
stream = await options.session.openStream(PROXY_HTTP_STREAM_KIND, {
|
|
339
|
+
signal: controller.signal,
|
|
340
|
+
metadata: createStreamMetadata({ protocol: "flowersec.proxy.http", version: 2 }),
|
|
341
|
+
});
|
|
342
|
+
controller.signal.throwIfAborted();
|
|
343
|
+
const reader = new ProxyByteReader(stream, { signal: controller.signal });
|
|
344
|
+
const requestID = request.id.trim() === "" ? randomID() : request.id;
|
|
345
|
+
const requestOrigin = externalOrigin ?? normalizeOrigin(request.externalOrigin);
|
|
346
|
+
await writeJsonFrame({ write: async (data) => await writeAll(stream, data, { signal: controller.signal }) }, {
|
|
347
|
+
v: PROXY_WIRE_VERSION, request_id: requestID, method: request.method.toUpperCase(), path, headers,
|
|
348
|
+
...(requestOrigin === undefined ? {} : { external_origin: requestOrigin }),
|
|
349
|
+
...(timeoutMs === 0 ? {} : { timeout_ms: timeoutMs }),
|
|
350
|
+
});
|
|
351
|
+
await writeChunks(stream, body, maxChunkBytes, maxBodyBytes, controller.signal);
|
|
352
|
+
const response = await readJsonFrame(reader, maxJsonFrameBytes);
|
|
353
|
+
if (response.v !== PROXY_WIRE_VERSION || response.request_id !== requestID)
|
|
354
|
+
throw new Error("invalid proxy response");
|
|
355
|
+
if (response.ok !== true) {
|
|
356
|
+
throw new SessionError(response.error?.code === "resource_exhausted" ? "resource_exhausted" : "operation_failed");
|
|
283
357
|
}
|
|
284
|
-
|
|
358
|
+
if (!Number.isInteger(response.status))
|
|
359
|
+
throw new Error("invalid proxy response");
|
|
360
|
+
const headersOut = filterHeaders(response.headers ?? [], BASE_RESPONSE_HEADERS, responseExtra);
|
|
361
|
+
const persistent = eventRequested && headersOut.some(({ name, value }) => name === "content-type" && isEventStream(value));
|
|
362
|
+
if (persistent)
|
|
363
|
+
arm(eventStreamIdleTimeoutMs);
|
|
364
|
+
else
|
|
365
|
+
releaseEvent();
|
|
366
|
+
const chunks = readChunks(reader, maxChunkBytes, persistent ? Infinity : maxBodyBytes)[Symbol.asyncIterator]();
|
|
367
|
+
controller.signal.throwIfAborted();
|
|
368
|
+
const bodyStream = new ReadableStream({
|
|
369
|
+
start(value) { output = value; },
|
|
370
|
+
async pull(value) {
|
|
371
|
+
try {
|
|
372
|
+
controller.signal.throwIfAborted();
|
|
373
|
+
const next = await chunks.next();
|
|
374
|
+
if (finished)
|
|
375
|
+
return;
|
|
376
|
+
if (next.done)
|
|
377
|
+
finish();
|
|
378
|
+
else {
|
|
379
|
+
if (persistent)
|
|
380
|
+
arm(eventStreamIdleTimeoutMs);
|
|
381
|
+
value.enqueue(next.value);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
catch (error) {
|
|
385
|
+
finish(error instanceof SessionError ? error : new SessionError("operation_failed"));
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
cancel() { cancel(); },
|
|
389
|
+
}, { highWaterMark: 0 });
|
|
390
|
+
const noBody = request.method.toUpperCase() === "HEAD" || [204, 205, 304].includes(response.status);
|
|
391
|
+
if (noBody) {
|
|
392
|
+
const next = await chunks.next();
|
|
393
|
+
if (!next.done)
|
|
394
|
+
throw new Error("unexpected proxy response body");
|
|
395
|
+
finish();
|
|
396
|
+
}
|
|
397
|
+
return new Response(noBody ? null : bodyStream, {
|
|
398
|
+
status: response.status, headers: headersOut.map(({ name, value }) => [name, value]),
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
finish(error);
|
|
403
|
+
// An abort may complete admission or openStream in the same microtask.
|
|
404
|
+
release?.();
|
|
405
|
+
if (controller.signal.aborted)
|
|
406
|
+
await stream?.reset().catch(() => undefined);
|
|
407
|
+
throw error instanceof SessionError ? error : new SessionError("operation_failed");
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
async function fetchSession(input, init) {
|
|
411
|
+
if (disposed)
|
|
412
|
+
throw new SessionError("closed");
|
|
413
|
+
const signal = init?.signal ?? (input instanceof Request ? input.signal : undefined);
|
|
414
|
+
const prepared = await prepareProxyFetch(input, { ...init,
|
|
415
|
+
signal: AbortSignal.any([lifetime.signal, ...(signal ? [signal] : [])]),
|
|
416
|
+
}, externalOrigin, maxBodyBytes);
|
|
417
|
+
return execute(prepared.request, prepared.signal);
|
|
418
|
+
}
|
|
419
|
+
function dispatchFetch(request, port) {
|
|
420
|
+
const controller = new AbortController();
|
|
421
|
+
const flowControlled = usesServiceWorkerResponseFlowControl(request) || request.headers.some(({ name, value }) => name.toLowerCase() === "accept" && acceptsEventStream(value));
|
|
422
|
+
let credit = !flowControlled;
|
|
423
|
+
let creditWake;
|
|
424
|
+
port.onmessage = (event) => {
|
|
425
|
+
if (event.data?.type === "flowersec-proxy:abort")
|
|
426
|
+
controller.abort(new SessionError("canceled"));
|
|
427
|
+
else if (event.data?.type === "flowersec-proxy:response_credit")
|
|
428
|
+
credit = true;
|
|
429
|
+
creditWake?.();
|
|
285
430
|
};
|
|
286
431
|
void (async () => {
|
|
432
|
+
let reader;
|
|
287
433
|
try {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
path,
|
|
307
|
-
headers,
|
|
308
|
-
...(requestOrigin === undefined ? {} : { external_origin: requestOrigin }),
|
|
309
|
-
...(timeoutMs === 0 ? {} : { timeout_ms: timeoutMs }),
|
|
310
|
-
});
|
|
311
|
-
await writeChunks(stream, body, maxChunkBytes, maxBodyBytes, controller.signal);
|
|
312
|
-
const response = await readJsonFrame(reader, maxJsonFrameBytes);
|
|
313
|
-
if (response.v !== PROXY_WIRE_VERSION || response.request_id !== requestID || response.ok !== true || !Number.isInteger(response.status)) {
|
|
314
|
-
throw new Error("invalid proxy response");
|
|
315
|
-
}
|
|
316
|
-
const headersOut = filterHeaders(response.headers ?? [], BASE_RESPONSE_HEADERS, responseExtra);
|
|
317
|
-
port.postMessage({ type: "flowersec-proxy:response_meta", status: response.status, headers: headersOut });
|
|
318
|
-
const chunks = readChunks(reader, maxChunkBytes, maxBodyBytes)[Symbol.asyncIterator]();
|
|
319
|
-
for (;;) {
|
|
320
|
-
await waitForCredit();
|
|
321
|
-
const next = await chunks.next();
|
|
434
|
+
const response = await execute(request, controller.signal);
|
|
435
|
+
port.postMessage({ type: "flowersec-proxy:response_meta", status: response.status,
|
|
436
|
+
headers: Array.from(response.headers, ([name, value]) => ({ name, value })) });
|
|
437
|
+
reader = response.body?.getReader();
|
|
438
|
+
// Runtime disposal also releases a bridge waiting for consumer credit.
|
|
439
|
+
const wake = () => { controller.abort(new SessionError("canceled")); creditWake?.(); };
|
|
440
|
+
const read = async () => {
|
|
441
|
+
while (!credit) {
|
|
442
|
+
controller.signal.throwIfAborted();
|
|
443
|
+
await new Promise((resolve) => { creditWake = resolve; });
|
|
444
|
+
}
|
|
445
|
+
controller.signal.throwIfAborted();
|
|
446
|
+
credit = !flowControlled;
|
|
447
|
+
return reader.read();
|
|
448
|
+
};
|
|
449
|
+
const closed = reader?.closed.catch(wake);
|
|
450
|
+
while (reader !== undefined) {
|
|
451
|
+
const next = await read();
|
|
322
452
|
if (next.done)
|
|
323
453
|
break;
|
|
324
|
-
const
|
|
325
|
-
const data = chunk.slice().buffer;
|
|
454
|
+
const data = next.value.slice().buffer;
|
|
326
455
|
port.postMessage({ type: "flowersec-proxy:response_chunk", data }, [data]);
|
|
327
456
|
}
|
|
457
|
+
await closed;
|
|
328
458
|
port.postMessage({ type: "flowersec-proxy:response_end" });
|
|
329
|
-
await stream.close();
|
|
330
|
-
stream = undefined;
|
|
331
459
|
}
|
|
332
460
|
catch (error) {
|
|
333
|
-
|
|
334
|
-
port.postMessage({ type: "flowersec-proxy:response_error", ...failure });
|
|
335
|
-
await stream?.reset().catch(() => undefined);
|
|
461
|
+
port.postMessage({ type: "flowersec-proxy:response_error", ...publicFailure(error) });
|
|
336
462
|
}
|
|
337
463
|
finally {
|
|
338
|
-
|
|
464
|
+
await reader?.cancel().catch(() => undefined);
|
|
465
|
+
reader?.releaseLock();
|
|
339
466
|
port.close();
|
|
340
467
|
}
|
|
341
468
|
})();
|
|
@@ -377,16 +504,21 @@ export function createProxyRuntime(options) {
|
|
|
377
504
|
maxWsFrameBytes,
|
|
378
505
|
maxWsBufferedAmountBytes,
|
|
379
506
|
maxConcurrentHttpStreams,
|
|
507
|
+
maxConcurrentEventStreams,
|
|
380
508
|
maxQueuedHttpRequests,
|
|
381
509
|
maxQueuedHttpBodyBytes,
|
|
382
510
|
}),
|
|
511
|
+
fetch: fetchSession,
|
|
383
512
|
dispatchFetch,
|
|
384
513
|
openWebSocketStream,
|
|
385
514
|
dispose: () => {
|
|
386
515
|
if (disposed)
|
|
387
516
|
return;
|
|
388
517
|
disposed = true;
|
|
518
|
+
lifetime.abort(new SessionError("closed"));
|
|
389
519
|
admission.close();
|
|
520
|
+
for (const controller of active)
|
|
521
|
+
controller.abort(new SessionError("closed"));
|
|
390
522
|
serviceWorker?.removeEventListener("controllerchange", register);
|
|
391
523
|
serviceWorkerBridge?.dispose();
|
|
392
524
|
},
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
const responseFlowControl = new WeakSet();
|
|
2
|
+
export function enableResponseFlowControl(request) {
|
|
3
|
+
responseFlowControl.add(request);
|
|
4
|
+
return request;
|
|
5
|
+
}
|
|
2
6
|
function record(value) {
|
|
3
7
|
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
4
8
|
? value
|
|
@@ -35,7 +39,7 @@ function parseRuntimeRequest(value) {
|
|
|
35
39
|
...(raw.body instanceof ArrayBuffer ? { body: raw.body } : {}),
|
|
36
40
|
});
|
|
37
41
|
if (raw.response_flow_control === "chunk_credit_v2")
|
|
38
|
-
|
|
42
|
+
enableResponseFlowControl(request);
|
|
39
43
|
return request;
|
|
40
44
|
}
|
|
41
45
|
export function usesServiceWorkerResponseFlowControl(request) {
|
package/dist/proxy/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export type ProxyRuntimeLimits = Readonly<{
|
|
|
10
10
|
maxWsFrameBytes: number;
|
|
11
11
|
maxWsBufferedAmountBytes: number;
|
|
12
12
|
maxConcurrentHttpStreams: number;
|
|
13
|
+
maxConcurrentEventStreams: number;
|
|
13
14
|
maxQueuedHttpRequests: number;
|
|
14
15
|
maxQueuedHttpBodyBytes: number;
|
|
15
16
|
}>;
|
|
@@ -27,6 +28,8 @@ export type ProxyRuntimeOptions = Readonly<{
|
|
|
27
28
|
maxWsFrameBytes?: number;
|
|
28
29
|
maxWsBufferedAmountBytes?: number;
|
|
29
30
|
maxConcurrentHttpStreams?: number;
|
|
31
|
+
maxConcurrentEventStreams?: number;
|
|
32
|
+
eventStreamIdleTimeoutMs?: number;
|
|
30
33
|
maxQueuedHttpRequests?: number;
|
|
31
34
|
maxQueuedHttpBodyBytes?: number;
|
|
32
35
|
timeoutMs?: number;
|
|
@@ -47,6 +50,7 @@ export type ProxyFetchRequest = Readonly<{
|
|
|
47
50
|
}>;
|
|
48
51
|
export type ProxyRuntime = Readonly<{
|
|
49
52
|
limits: ProxyRuntimeLimits;
|
|
53
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
50
54
|
dispatchFetch(request: ProxyFetchRequest, port: MessagePort): void;
|
|
51
55
|
openWebSocketStream(path: string, options?: Readonly<{
|
|
52
56
|
protocols?: readonly string[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { enableResponseFlowControl, usesServiceWorkerResponseFlowControl } from "./serviceWorkerRuntime.js";
|
|
2
|
+
import { fetchProxyPort, prepareProxyFetch } from "./fetch.js";
|
|
1
3
|
import { SDK_DEFAULTS } from "../defaults.js";
|
|
2
4
|
import { SessionError } from "../public/contract.js";
|
|
3
5
|
import { createServiceWorkerControllerGuard, } from "./controllerGuard.js";
|
|
@@ -207,6 +209,7 @@ function bridgeLimits(maxWsFrameBytes, maxWsBufferedAmountBytes) {
|
|
|
207
209
|
maxWsFrameBytes: wsFrame,
|
|
208
210
|
maxWsBufferedAmountBytes: buffered,
|
|
209
211
|
maxConcurrentHttpStreams: 24,
|
|
212
|
+
maxConcurrentEventStreams: 16,
|
|
210
213
|
maxQueuedHttpRequests: 128,
|
|
211
214
|
maxQueuedHttpBodyBytes: 64 * 1024 * 1024,
|
|
212
215
|
});
|
|
@@ -236,10 +239,19 @@ export function registerProxyAppWindow(options) {
|
|
|
236
239
|
port.close();
|
|
237
240
|
return;
|
|
238
241
|
}
|
|
239
|
-
controller.postMessage({ type: FETCH_MESSAGE, version: 2, request, ...(nonce === undefined ? {} : { capabilityNonce: nonce }) }, origin, [port]);
|
|
242
|
+
controller.postMessage({ type: FETCH_MESSAGE, version: 2, request, responseFlowControl: usesServiceWorkerResponseFlowControl(request) ? "chunk_credit_v2" : undefined, ...(nonce === undefined ? {} : { capabilityNonce: nonce }) }, origin, [port]);
|
|
240
243
|
};
|
|
244
|
+
const lifetime = new AbortController();
|
|
245
|
+
const dispose = () => { disposed = true; lifetime.abort(); };
|
|
241
246
|
const runtime = Object.freeze({
|
|
242
247
|
limits,
|
|
248
|
+
fetch: async (input, init) => {
|
|
249
|
+
if (disposed)
|
|
250
|
+
throw new SessionError("closed");
|
|
251
|
+
const signal = init?.signal ?? (input instanceof Request ? input.signal : undefined);
|
|
252
|
+
const prepared = await prepareProxyFetch(input, { ...init, signal: AbortSignal.any([lifetime.signal, ...(signal ? [signal] : [])]) }, target.location?.origin, limits.maxBodyBytes);
|
|
253
|
+
return fetchProxyPort(dispatchFetch, prepared.request, AbortSignal.any([prepared.signal, lifetime.signal]), limits.maxChunkBytes);
|
|
254
|
+
},
|
|
243
255
|
dispatchFetch,
|
|
244
256
|
openWebSocketStream: async (path, openOptions = {}) => {
|
|
245
257
|
if (disposed)
|
|
@@ -287,11 +299,11 @@ export function registerProxyAppWindow(options) {
|
|
|
287
299
|
}, origin, [channel.port2]);
|
|
288
300
|
return await response;
|
|
289
301
|
},
|
|
290
|
-
dispose
|
|
302
|
+
dispose,
|
|
291
303
|
});
|
|
292
304
|
return Object.freeze({
|
|
293
305
|
runtime,
|
|
294
|
-
dispose
|
|
306
|
+
dispose,
|
|
295
307
|
});
|
|
296
308
|
}
|
|
297
309
|
export function registerProxyAppWindowWithServiceWorkerRuntime(options) {
|
|
@@ -397,7 +409,10 @@ export function registerProxyControllerWindow(options) {
|
|
|
397
409
|
if (port === undefined)
|
|
398
410
|
return;
|
|
399
411
|
if (event.data?.type === FETCH_MESSAGE && event.data.version === 2) {
|
|
400
|
-
|
|
412
|
+
const request = event.data.request;
|
|
413
|
+
if (event.data.responseFlowControl === "chunk_credit_v2")
|
|
414
|
+
enableResponseFlowControl(request);
|
|
415
|
+
options.runtime.dispatchFetch(request, port);
|
|
401
416
|
return;
|
|
402
417
|
}
|
|
403
418
|
if (event.data?.type === WEBSOCKET_OPEN_MESSAGE && event.data.version === 2) {
|
|
@@ -56,12 +56,16 @@ export type ConnectionControllerSnapshotV3<Session extends ManagedSessionV3 = Ma
|
|
|
56
56
|
currentSession?: Session;
|
|
57
57
|
failure?: ConnectionControllerFailureV3;
|
|
58
58
|
retryDisposition?: RetryDispositionV3;
|
|
59
|
+
/** Effective retry deadline, present only while waiting; a wall-clock estimate of the owned wait. */
|
|
60
|
+
nextRetryAtUnixMilliseconds?: number;
|
|
59
61
|
}>;
|
|
60
62
|
export type ConnectionDiagnosticV3 = Readonly<{
|
|
61
63
|
state: ConnectionControllerStateV3;
|
|
62
64
|
attempt: number;
|
|
63
65
|
failure?: ConnectionControllerFailureV3;
|
|
64
66
|
retryDisposition?: RetryDispositionV3;
|
|
67
|
+
/** Effective retry deadline, present only while waiting; a wall-clock estimate of the owned wait. */
|
|
68
|
+
nextRetryAtUnixMilliseconds?: number;
|
|
65
69
|
}>;
|
|
66
70
|
/** Produces a stable diagnostic value without retaining a Session or transport detail. */
|
|
67
71
|
export declare function connectionDiagnosticV3(snapshot: ConnectionControllerSnapshotV3): ConnectionDiagnosticV3;
|
|
@@ -21,6 +21,7 @@ export function connectionDiagnosticV3(snapshot) {
|
|
|
21
21
|
attempt: snapshot.attempt,
|
|
22
22
|
...(failure === undefined ? {} : { failure }),
|
|
23
23
|
...(retryDisposition === undefined ? {} : { retryDisposition }),
|
|
24
|
+
...(snapshot.nextRetryAtUnixMilliseconds === undefined ? {} : { nextRetryAtUnixMilliseconds: snapshot.nextRetryAtUnixMilliseconds }),
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
export class ConnectionControllerV3Error extends Error {
|
|
@@ -562,6 +563,8 @@ export class ConnectionControllerV3 {
|
|
|
562
563
|
return Object.freeze({
|
|
563
564
|
state: this.#state,
|
|
564
565
|
attempt: this.#state === "connected" ? this.#connectedAttempt : this.#cycle.snapshot().attempts,
|
|
566
|
+
...(this.#state === "waiting" && this.#retry.nextRetryAtUnixMilliseconds !== undefined
|
|
567
|
+
? { nextRetryAtUnixMilliseconds: this.#retry.nextRetryAtUnixMilliseconds } : {}),
|
|
565
568
|
...(this.currentSession === undefined ? {} : { currentSession: this.currentSession }),
|
|
566
569
|
...(this.#failure === undefined ? {} : { failure: this.#failure }),
|
|
567
570
|
...(this.#disposition === undefined ? {} : { retryDisposition: this.#disposition }),
|
package/dist/v3/controller.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export type ControllerClockV3 = Readonly<{
|
|
|
38
38
|
export declare class ControllerRetryWaitV3 {
|
|
39
39
|
#private;
|
|
40
40
|
constructor(clock?: ControllerClockV3);
|
|
41
|
+
/** Wall-clock estimate of this wait's effective backoff and server deadline. */
|
|
42
|
+
get nextRetryAtUnixMilliseconds(): number | undefined;
|
|
41
43
|
retryNow(): boolean;
|
|
42
44
|
wait(disposition: RetryDispositionV3, consecutiveFailure: number, signal: AbortSignal): Promise<boolean>;
|
|
43
45
|
}
|
package/dist/v3/controller.js
CHANGED
|
@@ -182,10 +182,15 @@ export class ControllerRetryWaitV3 {
|
|
|
182
182
|
#waiting = false;
|
|
183
183
|
#manual = false;
|
|
184
184
|
#absoluteDeadline;
|
|
185
|
+
#nextRetryAtUnixMilliseconds;
|
|
185
186
|
#wake;
|
|
186
187
|
constructor(clock = defaultControllerClockV3()) {
|
|
187
188
|
this.#clock = clock;
|
|
188
189
|
}
|
|
190
|
+
/** Wall-clock estimate of this wait's effective backoff and server deadline. */
|
|
191
|
+
get nextRetryAtUnixMilliseconds() {
|
|
192
|
+
return this.#nextRetryAtUnixMilliseconds;
|
|
193
|
+
}
|
|
189
194
|
retryNow() {
|
|
190
195
|
if (!this.#waiting)
|
|
191
196
|
return false;
|
|
@@ -203,6 +208,7 @@ export class ControllerRetryWaitV3 {
|
|
|
203
208
|
if (this.#waiting)
|
|
204
209
|
throw new Error("Flowersec v3 retry wait is already active");
|
|
205
210
|
const backoffDeadline = saturatingAddMilliseconds(this.#clock.monotonicNowMilliseconds(), controllerBackoffForWait(consecutiveFailure));
|
|
211
|
+
this.#nextRetryAtUnixMilliseconds = Math.max(saturatingAddMilliseconds(this.#clock.wallNowMilliseconds(), controllerBackoffForWait(consecutiveFailure)), validated.kind === "retry_after" ? validated.notBeforeUnixMilliseconds : 0);
|
|
206
212
|
this.#waiting = true;
|
|
207
213
|
this.#manual = false;
|
|
208
214
|
this.#absoluteDeadline = validated.kind === "retry_after"
|
|
@@ -232,6 +238,7 @@ export class ControllerRetryWaitV3 {
|
|
|
232
238
|
this.#waiting = false;
|
|
233
239
|
this.#manual = false;
|
|
234
240
|
this.#absoluteDeadline = undefined;
|
|
241
|
+
this.#nextRetryAtUnixMilliseconds = undefined;
|
|
235
242
|
this.#wake = undefined;
|
|
236
243
|
}
|
|
237
244
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floegence/flowersec-core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"description": "Flowersec core TypeScript library for carrier-neutral encrypted sessions and multiplexed streams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"vitest": "4.1.11"
|
|
96
96
|
},
|
|
97
97
|
"optionalDependencies": {
|
|
98
|
-
"@floegence/flowersec-node-native": "5.
|
|
98
|
+
"@floegence/flowersec-node-native": "5.3.1"
|
|
99
99
|
},
|
|
100
|
-
"flowersecSourceCommit": "
|
|
100
|
+
"flowersecSourceCommit": "40c691abba72f4e02c9f28ed83ceea71e9143995"
|
|
101
101
|
}
|
package/sbom/cyclonedx.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bomFormat": "CycloneDX",
|
|
3
3
|
"specVersion": "1.5",
|
|
4
|
-
"serialNumber": "urn:uuid:
|
|
4
|
+
"serialNumber": "urn:uuid:51bd92d6-8181-5ebc-85a5-654cc506890f",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
7
|
"component": {
|
|
8
8
|
"type": "library",
|
|
9
9
|
"name": "@floegence/flowersec-core",
|
|
10
|
-
"version": "5.
|
|
11
|
-
"purl": "pkg:npm/%40floegence/flowersec-core@5.
|
|
12
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-core@5.
|
|
10
|
+
"version": "5.3.1",
|
|
11
|
+
"purl": "pkg:npm/%40floegence/flowersec-core@5.3.1",
|
|
12
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-core@5.3.1"
|
|
13
13
|
},
|
|
14
14
|
"properties": [
|
|
15
15
|
{
|
|
16
16
|
"name": "flowersec:source-inventory-sha256",
|
|
17
|
-
"value": "
|
|
17
|
+
"value": "b58b9c4c9f92012e52fcfb1dcefe6969a3ff1993aa5df1a49f15b97c78e86086"
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
},
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
{
|
|
23
23
|
"type": "library",
|
|
24
24
|
"name": "@floegence/flowersec-node-native",
|
|
25
|
-
"version": "5.
|
|
26
|
-
"purl": "pkg:npm/%40floegence/flowersec-node-native@5.
|
|
27
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native@5.
|
|
25
|
+
"version": "5.3.1",
|
|
26
|
+
"purl": "pkg:npm/%40floegence/flowersec-node-native@5.3.1",
|
|
27
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native@5.3.1",
|
|
28
28
|
"licenses": [
|
|
29
29
|
{
|
|
30
30
|
"expression": "MIT"
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
{
|
|
51
51
|
"type": "library",
|
|
52
52
|
"name": "@floegence/flowersec-node-native-darwin-arm64",
|
|
53
|
-
"version": "5.
|
|
54
|
-
"purl": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.
|
|
55
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.
|
|
53
|
+
"version": "5.3.1",
|
|
54
|
+
"purl": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.3.1",
|
|
55
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.3.1",
|
|
56
56
|
"licenses": [
|
|
57
57
|
{
|
|
58
58
|
"expression": "MIT"
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
{
|
|
79
79
|
"type": "library",
|
|
80
80
|
"name": "@floegence/flowersec-node-native-darwin-x64",
|
|
81
|
-
"version": "5.
|
|
82
|
-
"purl": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.
|
|
83
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.
|
|
81
|
+
"version": "5.3.1",
|
|
82
|
+
"purl": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.3.1",
|
|
83
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.3.1",
|
|
84
84
|
"licenses": [
|
|
85
85
|
{
|
|
86
86
|
"expression": "MIT"
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
{
|
|
107
107
|
"type": "library",
|
|
108
108
|
"name": "@floegence/flowersec-node-native-linux-arm64-gnu",
|
|
109
|
-
"version": "5.
|
|
110
|
-
"purl": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.
|
|
111
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.
|
|
109
|
+
"version": "5.3.1",
|
|
110
|
+
"purl": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.3.1",
|
|
111
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.3.1",
|
|
112
112
|
"licenses": [
|
|
113
113
|
{
|
|
114
114
|
"expression": "MIT"
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
{
|
|
135
135
|
"type": "library",
|
|
136
136
|
"name": "@floegence/flowersec-node-native-linux-x64-gnu",
|
|
137
|
-
"version": "5.
|
|
138
|
-
"purl": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.
|
|
139
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.
|
|
137
|
+
"version": "5.3.1",
|
|
138
|
+
"purl": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.3.1",
|
|
139
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.3.1",
|
|
140
140
|
"licenses": [
|
|
141
141
|
{
|
|
142
142
|
"expression": "MIT"
|
|
@@ -330,9 +330,9 @@
|
|
|
330
330
|
],
|
|
331
331
|
"dependencies": [
|
|
332
332
|
{
|
|
333
|
-
"ref": "pkg:npm/%40floegence/flowersec-core@5.
|
|
333
|
+
"ref": "pkg:npm/%40floegence/flowersec-core@5.3.1",
|
|
334
334
|
"dependsOn": [
|
|
335
|
-
"pkg:npm/%40floegence/flowersec-node-native@5.
|
|
335
|
+
"pkg:npm/%40floegence/flowersec-node-native@5.3.1",
|
|
336
336
|
"pkg:npm/%40noble/ciphers@2.4.0",
|
|
337
337
|
"pkg:npm/%40noble/curves@2.4.0",
|
|
338
338
|
"pkg:npm/%40noble/hashes@2.4.0",
|
|
@@ -341,28 +341,28 @@
|
|
|
341
341
|
]
|
|
342
342
|
},
|
|
343
343
|
{
|
|
344
|
-
"ref": "pkg:npm/%40floegence/flowersec-node-native@5.
|
|
344
|
+
"ref": "pkg:npm/%40floegence/flowersec-node-native@5.3.1",
|
|
345
345
|
"dependsOn": [
|
|
346
|
-
"pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.
|
|
347
|
-
"pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.
|
|
348
|
-
"pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.
|
|
349
|
-
"pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.
|
|
346
|
+
"pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.3.1",
|
|
347
|
+
"pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.3.1",
|
|
348
|
+
"pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.3.1",
|
|
349
|
+
"pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.3.1"
|
|
350
350
|
]
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
|
-
"ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.
|
|
353
|
+
"ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.3.1",
|
|
354
354
|
"dependsOn": []
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
|
-
"ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.
|
|
357
|
+
"ref": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.3.1",
|
|
358
358
|
"dependsOn": []
|
|
359
359
|
},
|
|
360
360
|
{
|
|
361
|
-
"ref": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.
|
|
361
|
+
"ref": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.3.1",
|
|
362
362
|
"dependsOn": []
|
|
363
363
|
},
|
|
364
364
|
{
|
|
365
|
-
"ref": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.
|
|
365
|
+
"ref": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.3.1",
|
|
366
366
|
"dependsOn": []
|
|
367
367
|
},
|
|
368
368
|
{
|
package/sbom/spdx.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
5
|
"name": "flowersec-ts",
|
|
6
|
-
"documentNamespace": "https://github.com/floegence/flowersec/sbom/flowersec-ts/
|
|
6
|
+
"documentNamespace": "https://github.com/floegence/flowersec/sbom/flowersec-ts/b58b9c4c9f92012e52fcfb1dcefe6969a3ff1993aa5df1a49f15b97c78e86086",
|
|
7
7
|
"creationInfo": {
|
|
8
8
|
"created": "2026-09-17T15:04:20Z",
|
|
9
9
|
"creators": [
|
|
@@ -13,26 +13,26 @@
|
|
|
13
13
|
"packages": [
|
|
14
14
|
{
|
|
15
15
|
"name": "@floegence/flowersec-core",
|
|
16
|
-
"SPDXID": "SPDXRef-Package-
|
|
17
|
-
"versionInfo": "5.
|
|
16
|
+
"SPDXID": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
17
|
+
"versionInfo": "5.3.1",
|
|
18
18
|
"downloadLocation": "NOASSERTION",
|
|
19
19
|
"filesAnalyzed": false,
|
|
20
20
|
"licenseConcluded": "NOASSERTION",
|
|
21
21
|
"licenseDeclared": "NOASSERTION",
|
|
22
22
|
"copyrightText": "NOASSERTION",
|
|
23
|
-
"comment": "Flowersec source inventory SHA-256:
|
|
23
|
+
"comment": "Flowersec source inventory SHA-256: b58b9c4c9f92012e52fcfb1dcefe6969a3ff1993aa5df1a49f15b97c78e86086",
|
|
24
24
|
"externalRefs": [
|
|
25
25
|
{
|
|
26
26
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
27
27
|
"referenceType": "purl",
|
|
28
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-core@5.
|
|
28
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-core@5.3.1"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"name": "@floegence/flowersec-node-native",
|
|
34
|
-
"SPDXID": "SPDXRef-Package-
|
|
35
|
-
"versionInfo": "5.
|
|
34
|
+
"SPDXID": "SPDXRef-Package-eef7c72d28d42593cb9c",
|
|
35
|
+
"versionInfo": "5.3.1",
|
|
36
36
|
"downloadLocation": "https://github.com/floegence/flowersec.git",
|
|
37
37
|
"filesAnalyzed": false,
|
|
38
38
|
"licenseConcluded": "MIT",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
{
|
|
43
43
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
44
44
|
"referenceType": "purl",
|
|
45
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native@5.
|
|
45
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native@5.3.1"
|
|
46
46
|
}
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"name": "@floegence/flowersec-node-native-darwin-arm64",
|
|
51
|
-
"SPDXID": "SPDXRef-Package-
|
|
52
|
-
"versionInfo": "5.
|
|
51
|
+
"SPDXID": "SPDXRef-Package-205740c5670abfefb9bd",
|
|
52
|
+
"versionInfo": "5.3.1",
|
|
53
53
|
"downloadLocation": "https://github.com/floegence/flowersec.git",
|
|
54
54
|
"filesAnalyzed": false,
|
|
55
55
|
"licenseConcluded": "MIT",
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
{
|
|
60
60
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
61
61
|
"referenceType": "purl",
|
|
62
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.
|
|
62
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-darwin-arm64@5.3.1"
|
|
63
63
|
}
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"name": "@floegence/flowersec-node-native-darwin-x64",
|
|
68
|
-
"SPDXID": "SPDXRef-Package-
|
|
69
|
-
"versionInfo": "5.
|
|
68
|
+
"SPDXID": "SPDXRef-Package-6b356cf61b9e8b8b5be3",
|
|
69
|
+
"versionInfo": "5.3.1",
|
|
70
70
|
"downloadLocation": "https://github.com/floegence/flowersec.git",
|
|
71
71
|
"filesAnalyzed": false,
|
|
72
72
|
"licenseConcluded": "MIT",
|
|
@@ -76,14 +76,14 @@
|
|
|
76
76
|
{
|
|
77
77
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
78
78
|
"referenceType": "purl",
|
|
79
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.
|
|
79
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-darwin-x64@5.3.1"
|
|
80
80
|
}
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"name": "@floegence/flowersec-node-native-linux-arm64-gnu",
|
|
85
|
-
"SPDXID": "SPDXRef-Package-
|
|
86
|
-
"versionInfo": "5.
|
|
85
|
+
"SPDXID": "SPDXRef-Package-46d85b76a7c178758095",
|
|
86
|
+
"versionInfo": "5.3.1",
|
|
87
87
|
"downloadLocation": "https://github.com/floegence/flowersec.git",
|
|
88
88
|
"filesAnalyzed": false,
|
|
89
89
|
"licenseConcluded": "MIT",
|
|
@@ -93,14 +93,14 @@
|
|
|
93
93
|
{
|
|
94
94
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
95
95
|
"referenceType": "purl",
|
|
96
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.
|
|
96
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-linux-arm64-gnu@5.3.1"
|
|
97
97
|
}
|
|
98
98
|
]
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"name": "@floegence/flowersec-node-native-linux-x64-gnu",
|
|
102
|
-
"SPDXID": "SPDXRef-Package-
|
|
103
|
-
"versionInfo": "5.
|
|
102
|
+
"SPDXID": "SPDXRef-Package-ec0641914e5ef7e40af9",
|
|
103
|
+
"versionInfo": "5.3.1",
|
|
104
104
|
"downloadLocation": "https://github.com/floegence/flowersec.git",
|
|
105
105
|
"filesAnalyzed": false,
|
|
106
106
|
"licenseConcluded": "MIT",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
{
|
|
111
111
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
112
112
|
"referenceType": "purl",
|
|
113
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.
|
|
113
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-node-native-linux-x64-gnu@5.3.1"
|
|
114
114
|
}
|
|
115
115
|
]
|
|
116
116
|
},
|
|
@@ -221,57 +221,57 @@
|
|
|
221
221
|
{
|
|
222
222
|
"spdxElementId": "SPDXRef-DOCUMENT",
|
|
223
223
|
"relationshipType": "DESCRIBES",
|
|
224
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
224
|
+
"relatedSpdxElement": "SPDXRef-Package-a068ff55d53c94911fe0"
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
|
-
"spdxElementId": "SPDXRef-Package-
|
|
227
|
+
"spdxElementId": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
228
228
|
"relationshipType": "DEPENDS_ON",
|
|
229
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
229
|
+
"relatedSpdxElement": "SPDXRef-Package-eef7c72d28d42593cb9c"
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
|
-
"spdxElementId": "SPDXRef-Package-
|
|
232
|
+
"spdxElementId": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
233
233
|
"relationshipType": "DEPENDS_ON",
|
|
234
234
|
"relatedSpdxElement": "SPDXRef-Package-6cdb8b3664bfb0d67b6a"
|
|
235
235
|
},
|
|
236
236
|
{
|
|
237
|
-
"spdxElementId": "SPDXRef-Package-
|
|
237
|
+
"spdxElementId": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
238
238
|
"relationshipType": "DEPENDS_ON",
|
|
239
239
|
"relatedSpdxElement": "SPDXRef-Package-e0e2cb449dffb239a794"
|
|
240
240
|
},
|
|
241
241
|
{
|
|
242
|
-
"spdxElementId": "SPDXRef-Package-
|
|
242
|
+
"spdxElementId": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
243
243
|
"relationshipType": "DEPENDS_ON",
|
|
244
244
|
"relatedSpdxElement": "SPDXRef-Package-2e6e3840217975457b7a"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
"spdxElementId": "SPDXRef-Package-
|
|
247
|
+
"spdxElementId": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
248
248
|
"relationshipType": "DEPENDS_ON",
|
|
249
249
|
"relatedSpdxElement": "SPDXRef-Package-5b9d78698ec0a5c8f86f"
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
|
-
"spdxElementId": "SPDXRef-Package-
|
|
252
|
+
"spdxElementId": "SPDXRef-Package-a068ff55d53c94911fe0",
|
|
253
253
|
"relationshipType": "DEPENDS_ON",
|
|
254
254
|
"relatedSpdxElement": "SPDXRef-Package-b779412f685822663496"
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
|
-
"spdxElementId": "SPDXRef-Package-
|
|
257
|
+
"spdxElementId": "SPDXRef-Package-eef7c72d28d42593cb9c",
|
|
258
258
|
"relationshipType": "DEPENDS_ON",
|
|
259
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
259
|
+
"relatedSpdxElement": "SPDXRef-Package-205740c5670abfefb9bd"
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
|
-
"spdxElementId": "SPDXRef-Package-
|
|
262
|
+
"spdxElementId": "SPDXRef-Package-eef7c72d28d42593cb9c",
|
|
263
263
|
"relationshipType": "DEPENDS_ON",
|
|
264
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
264
|
+
"relatedSpdxElement": "SPDXRef-Package-6b356cf61b9e8b8b5be3"
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
|
-
"spdxElementId": "SPDXRef-Package-
|
|
267
|
+
"spdxElementId": "SPDXRef-Package-eef7c72d28d42593cb9c",
|
|
268
268
|
"relationshipType": "DEPENDS_ON",
|
|
269
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
269
|
+
"relatedSpdxElement": "SPDXRef-Package-46d85b76a7c178758095"
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
|
-
"spdxElementId": "SPDXRef-Package-
|
|
272
|
+
"spdxElementId": "SPDXRef-Package-eef7c72d28d42593cb9c",
|
|
273
273
|
"relationshipType": "DEPENDS_ON",
|
|
274
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
274
|
+
"relatedSpdxElement": "SPDXRef-Package-ec0641914e5ef7e40af9"
|
|
275
275
|
},
|
|
276
276
|
{
|
|
277
277
|
"spdxElementId": "SPDXRef-Package-e0e2cb449dffb239a794",
|