@floegence/flowersec-core 2.3.5 → 2.3.6
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 +5 -3
- package/dist/connectionController.d.ts +1 -0
- package/dist/connectionController.js +3 -0
- package/dist/node/acceptor.js +11 -2
- package/dist/v2/retryDisposition.js +4 -4
- package/package.json +1 -1
- package/sbom/cyclonedx.json +6 -6
- package/sbom/spdx.json +13 -13
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
`@floegence/flowersec-core` is the ESM-only Flowersec v2 SDK for browsers and Node.js. Its public package surface is limited to the root, `/browser`, `/node`, and `/proxy` entrypoints.
|
|
4
4
|
|
|
5
|
-
Flowersec 2.3.
|
|
5
|
+
Flowersec 2.3.6 is the published TypeScript SDK release.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @floegence/flowersec-core@2.3.
|
|
10
|
+
npm install @floegence/flowersec-core@2.3.6
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Public API
|
|
@@ -36,7 +36,9 @@ When connector options omit a connection timeout, browser and Node.js connectors
|
|
|
36
36
|
|
|
37
37
|
The Browser and Node `connect(...)` operations are one-shot and never reconnect. Long-lived applications can create the runtime-specific `ConnectionController` with a refreshable `ArtifactSource`. Every attempt must return a fresh `ArtifactLease`; a one-time artifact or lease is not a controller source.
|
|
38
38
|
|
|
39
|
-
The controller has one scheduler and one in-flight attempt. Its states are `idle`, `connecting`, `connected`, `waiting`, `failed`, and `closed`; snapshots expose
|
|
39
|
+
The controller has one scheduler and one in-flight attempt. Its states are `idle`, `connecting`, `connected`, `waiting`, `failed`, and `closed`; immutable snapshots expose `ConnectionSnapshot.retryDisposition` while the corresponding retry decision applies and clear it before a new attempt, after connection, and on close. Call `start()` once, observe snapshots with `subscribe(...)`, await an established session with `waitForSession(...)`, and use `retryNow()` only to wake a `waiting` controller. `close()` cancels acquisition, connection, and waiting before closing the current session.
|
|
40
|
+
|
|
41
|
+
Node `SessionHandlers` accept application stream kinds whose UTF-8 encoding is 1 through 255 bytes and reserve `flowersec.rpc.v2` for Flowersec RPC. `AcceptedSession.serve(...)` closes successfully handled streams. A rejected handler Promise resets then closes only that stream; the accept loop and unrelated streams continue.
|
|
40
42
|
|
|
41
43
|
Source failures return a structured `terminal`, `retryable`, or `retry_after` disposition. Thrown or malformed source failures are terminal. Retry delay is deterministic exponential backoff from 250 ms, doubling to a 30-second maximum with no jitter; `retry_after` is never attempted before its specified Unix-millisecond boundary. Attempts are unlimited unless `maximumAttempts` is explicitly set.
|
|
42
44
|
|
|
@@ -31,6 +31,7 @@ export type ConnectionSnapshot = Readonly<{
|
|
|
31
31
|
attempt: number;
|
|
32
32
|
currentSession?: Session;
|
|
33
33
|
failure?: ConnectionControllerFailure;
|
|
34
|
+
retryDisposition?: RetryDisposition;
|
|
34
35
|
}>;
|
|
35
36
|
export type ConnectionControllerOptions = Readonly<{
|
|
36
37
|
maximumAttempts?: number;
|
|
@@ -125,6 +125,7 @@ class ConnectionControllerV2Impl {
|
|
|
125
125
|
const active = this.session;
|
|
126
126
|
// A closed controller must never advertise a session that it has just retired.
|
|
127
127
|
this.session = undefined;
|
|
128
|
+
this.currentRetryDisposition = undefined;
|
|
128
129
|
this.lifetime.abort(new ConnectionControllerError("closed", this.lastFailure));
|
|
129
130
|
this.transition("closed");
|
|
130
131
|
void this.finishClose(active).then(resolveClose);
|
|
@@ -156,6 +157,7 @@ class ConnectionControllerV2Impl {
|
|
|
156
157
|
this.transition("failed");
|
|
157
158
|
return;
|
|
158
159
|
}
|
|
160
|
+
this.currentRetryDisposition = undefined;
|
|
159
161
|
this.attempt += 1;
|
|
160
162
|
this.transition("connecting");
|
|
161
163
|
const acquisition = await this.acquireLease();
|
|
@@ -361,6 +363,7 @@ class ConnectionControllerV2Impl {
|
|
|
361
363
|
attempt: this.attempt,
|
|
362
364
|
...(currentSession === undefined ? {} : { currentSession }),
|
|
363
365
|
...(this.lastFailure === undefined ? {} : { failure: this.lastFailure }),
|
|
366
|
+
...(this.currentRetryDisposition === undefined ? {} : { retryDisposition: this.currentRetryDisposition }),
|
|
364
367
|
});
|
|
365
368
|
}
|
|
366
369
|
}
|
package/dist/node/acceptor.js
CHANGED
|
@@ -99,8 +99,17 @@ export class AcceptedSession {
|
|
|
99
99
|
await incoming.stream.reset();
|
|
100
100
|
continue;
|
|
101
101
|
}
|
|
102
|
-
const task =
|
|
103
|
-
|
|
102
|
+
const task = (async () => {
|
|
103
|
+
try {
|
|
104
|
+
await handler(incoming, options);
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
await incoming.stream.reset().catch(() => undefined);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
await incoming.stream.close().catch(() => undefined);
|
|
111
|
+
}
|
|
112
|
+
})()
|
|
104
113
|
.finally(() => active.delete(task));
|
|
105
114
|
active.add(task);
|
|
106
115
|
}
|
|
@@ -9,9 +9,9 @@ export function retryDispositionForConnectError(error) {
|
|
|
9
9
|
case "rpc_failed":
|
|
10
10
|
case "resource_exhausted":
|
|
11
11
|
case "not_connected":
|
|
12
|
-
return { kind: "retryable" };
|
|
12
|
+
return Object.freeze({ kind: "retryable" });
|
|
13
13
|
default:
|
|
14
|
-
return { kind: "terminal" };
|
|
14
|
+
return Object.freeze({ kind: "terminal" });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
export function retryDispositionForSessionError(error) {
|
|
@@ -23,8 +23,8 @@ export function retryDispositionForSessionError(error) {
|
|
|
23
23
|
case "stream_reset":
|
|
24
24
|
case "rekey_failed":
|
|
25
25
|
case "liveness_failed":
|
|
26
|
-
return { kind: "retryable" };
|
|
26
|
+
return Object.freeze({ kind: "retryable" });
|
|
27
27
|
default:
|
|
28
|
-
return { kind: "terminal" };
|
|
28
|
+
return Object.freeze({ kind: "terminal" });
|
|
29
29
|
}
|
|
30
30
|
}
|
package/package.json
CHANGED
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:026dc73d-e708-55ea-8dd3-f116a0087846",
|
|
5
5
|
"version": 1,
|
|
6
6
|
"metadata": {
|
|
7
7
|
"component": {
|
|
8
8
|
"type": "library",
|
|
9
9
|
"name": "@floegence/flowersec-core",
|
|
10
|
-
"version": "2.3.
|
|
11
|
-
"purl": "pkg:npm/%40floegence/flowersec-core@2.3.
|
|
12
|
-
"bom-ref": "pkg:npm/%40floegence/flowersec-core@2.3.
|
|
10
|
+
"version": "2.3.6",
|
|
11
|
+
"purl": "pkg:npm/%40floegence/flowersec-core@2.3.6",
|
|
12
|
+
"bom-ref": "pkg:npm/%40floegence/flowersec-core@2.3.6"
|
|
13
13
|
},
|
|
14
14
|
"properties": [
|
|
15
15
|
{
|
|
16
16
|
"name": "flowersec:source-inventory-sha256",
|
|
17
|
-
"value": "
|
|
17
|
+
"value": "ed04be96860a13b4c2a53cd400072b7658237118c281fd955adf5f8e39f7678d"
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
},
|
|
@@ -2290,7 +2290,7 @@
|
|
|
2290
2290
|
],
|
|
2291
2291
|
"dependencies": [
|
|
2292
2292
|
{
|
|
2293
|
-
"ref": "pkg:npm/%40floegence/flowersec-core@2.3.
|
|
2293
|
+
"ref": "pkg:npm/%40floegence/flowersec-core@2.3.6",
|
|
2294
2294
|
"dependsOn": [
|
|
2295
2295
|
"pkg:npm/%40fails-components/webtransport-transport-http3-quiche@1.6.7",
|
|
2296
2296
|
"pkg:npm/%40fails-components/webtransport@1.6.7",
|
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/ed04be96860a13b4c2a53cd400072b7658237118c281fd955adf5f8e39f7678d",
|
|
7
7
|
"creationInfo": {
|
|
8
8
|
"created": "1970-01-01T00:00:00Z",
|
|
9
9
|
"creators": [
|
|
@@ -13,19 +13,19 @@
|
|
|
13
13
|
"packages": [
|
|
14
14
|
{
|
|
15
15
|
"name": "@floegence/flowersec-core",
|
|
16
|
-
"SPDXID": "SPDXRef-Package-
|
|
17
|
-
"versionInfo": "2.3.
|
|
16
|
+
"SPDXID": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
17
|
+
"versionInfo": "2.3.6",
|
|
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: ed04be96860a13b4c2a53cd400072b7658237118c281fd955adf5f8e39f7678d",
|
|
24
24
|
"externalRefs": [
|
|
25
25
|
{
|
|
26
26
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
27
27
|
"referenceType": "purl",
|
|
28
|
-
"referenceLocator": "pkg:npm/%40floegence/flowersec-core@2.3.
|
|
28
|
+
"referenceLocator": "pkg:npm/%40floegence/flowersec-core@2.3.6"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
},
|
|
@@ -1411,7 +1411,7 @@
|
|
|
1411
1411
|
{
|
|
1412
1412
|
"spdxElementId": "SPDXRef-DOCUMENT",
|
|
1413
1413
|
"relationshipType": "DESCRIBES",
|
|
1414
|
-
"relatedSpdxElement": "SPDXRef-Package-
|
|
1414
|
+
"relatedSpdxElement": "SPDXRef-Package-4be78b4f0b851da93d5b"
|
|
1415
1415
|
},
|
|
1416
1416
|
{
|
|
1417
1417
|
"spdxElementId": "SPDXRef-Package-789c0f508771e385c5e8",
|
|
@@ -1459,37 +1459,37 @@
|
|
|
1459
1459
|
"relatedSpdxElement": "SPDXRef-Package-1a7f123f21a1eaf4fd69"
|
|
1460
1460
|
},
|
|
1461
1461
|
{
|
|
1462
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1462
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1463
1463
|
"relationshipType": "DEPENDS_ON",
|
|
1464
1464
|
"relatedSpdxElement": "SPDXRef-Package-789c0f508771e385c5e8"
|
|
1465
1465
|
},
|
|
1466
1466
|
{
|
|
1467
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1467
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1468
1468
|
"relationshipType": "DEPENDS_ON",
|
|
1469
1469
|
"relatedSpdxElement": "SPDXRef-Package-4b35e4821b43dc47a168"
|
|
1470
1470
|
},
|
|
1471
1471
|
{
|
|
1472
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1472
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1473
1473
|
"relationshipType": "DEPENDS_ON",
|
|
1474
1474
|
"relatedSpdxElement": "SPDXRef-Package-24f128c8779cacb70e46"
|
|
1475
1475
|
},
|
|
1476
1476
|
{
|
|
1477
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1477
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1478
1478
|
"relationshipType": "DEPENDS_ON",
|
|
1479
1479
|
"relatedSpdxElement": "SPDXRef-Package-6a42d288421aaee354ff"
|
|
1480
1480
|
},
|
|
1481
1481
|
{
|
|
1482
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1482
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1483
1483
|
"relationshipType": "DEPENDS_ON",
|
|
1484
1484
|
"relatedSpdxElement": "SPDXRef-Package-d976986d5d79eddc7789"
|
|
1485
1485
|
},
|
|
1486
1486
|
{
|
|
1487
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1487
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1488
1488
|
"relationshipType": "DEPENDS_ON",
|
|
1489
1489
|
"relatedSpdxElement": "SPDXRef-Package-f8b45a289df643042b94"
|
|
1490
1490
|
},
|
|
1491
1491
|
{
|
|
1492
|
-
"spdxElementId": "SPDXRef-Package-
|
|
1492
|
+
"spdxElementId": "SPDXRef-Package-4be78b4f0b851da93d5b",
|
|
1493
1493
|
"relationshipType": "DEPENDS_ON",
|
|
1494
1494
|
"relatedSpdxElement": "SPDXRef-Package-38fe7b92bdac2a86fb61"
|
|
1495
1495
|
},
|