@floegence/flowersec-core 7.0.0 → 7.1.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/README.md +4 -4
- package/THIRD_PARTY_NOTICES.md +8 -8
- package/dist/node/acceptorV3.js +2 -1
- package/dist/node/connectSessionV3.d.ts +2 -2
- package/dist/node/connectSessionV3.js +9 -3
- package/dist/node/nativeTransportAddon.d.ts +1 -5
- package/dist/node/nativeTransportAddon.js +3 -5
- package/dist/node/rawQuicServerV3.d.ts +3 -1
- package/dist/node/rawQuicServerV3.js +6 -2
- package/dist/node/tunnelRuntimeV3.js +2 -1
- package/dist/node/webSocketServerV3.js +3 -0
- package/dist/vendor/tr46.js +17 -23
- package/package.json +12 -12
- package/sbom/cyclonedx.json +43 -43
- package/sbom/spdx.json +49 -49
package/README.md
CHANGED
|
@@ -92,14 +92,14 @@ WSS, raw QUIC, and WebTransport for clients, direct listeners, and
|
|
|
92
92
|
opaque tunnel listeners. Raw QUIC and WebTransport require the Flowersec native
|
|
93
93
|
package for macOS or glibc Linux on arm64/x64. Node does not issue artifacts.
|
|
94
94
|
|
|
95
|
-
For WebTransport, pass `
|
|
95
|
+
For WebTransport, pass `webTransport: true`
|
|
96
96
|
and a canonical HTTP(S) `origin` to `connect` or `createConnectionController`.
|
|
97
|
-
Use `carrier: "webtransport"
|
|
97
|
+
Use `carrier: "webtransport"` and a nonempty
|
|
98
98
|
`allowedOrigins` list on the corresponding listener. An absent Origin is
|
|
99
99
|
rejected. With a wildcard bind address, supply the public HTTPS URL with the
|
|
100
100
|
same port and the exact `/flowersec/webtransport/v5/direct` or
|
|
101
|
-
`/flowersec/webtransport/v5/tunnel` path.
|
|
102
|
-
|
|
101
|
+
`/flowersec/webtransport/v5/tunnel` path. Node speaks draft02. Configure an
|
|
102
|
+
explicit raw QUIC route for a Go client dialing a Node listener.
|
|
103
103
|
|
|
104
104
|
CA candidates use platform or configured private roots. Pin candidates verify
|
|
105
105
|
only the complete artifact-bound active pin set and never fall back to CA.
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
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 7.
|
|
7
|
-
- @floegence/flowersec-node-native-darwin-arm64 7.
|
|
8
|
-
- @floegence/flowersec-node-native-darwin-x64 7.
|
|
9
|
-
- @floegence/flowersec-node-native-linux-arm64-gnu 7.
|
|
10
|
-
- @floegence/flowersec-node-native-linux-x64-gnu 7.
|
|
6
|
+
- @floegence/flowersec-node-native 7.1.0 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
7
|
+
- @floegence/flowersec-node-native-darwin-arm64 7.1.0 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
8
|
+
- @floegence/flowersec-node-native-darwin-x64 7.1.0 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
9
|
+
- @floegence/flowersec-node-native-linux-arm64-gnu 7.1.0 (Declared: MIT; selected: MIT; source: https://github.com/floegence/flowersec.git)
|
|
10
|
+
- @floegence/flowersec-node-native-linux-x64-gnu 7.1.0 (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)
|
|
14
14
|
- @types/node 26.4.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/@types/node/-/node-26.4.0.tgz)
|
|
15
15
|
- punycode 2.3.1 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz)
|
|
16
|
-
- tr46
|
|
16
|
+
- tr46 7.0.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/tr46/-/tr46-7.0.0.tgz)
|
|
17
17
|
- undici-types 8.3.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz)
|
|
18
|
-
- ws 8.
|
|
18
|
+
- ws 8.22.0 (Declared: MIT; selected: MIT; source: https://registry.npmjs.org/ws/-/ws-8.22.0.tgz)
|
|
19
19
|
## Distributed Dependency License Materials
|
|
20
20
|
|
|
21
21
|
The following dependencies are incorporated into distributed Flowersec files or binaries.
|
|
@@ -46,7 +46,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
46
46
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
47
47
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
48
48
|
|
|
49
|
-
### tr46
|
|
49
|
+
### tr46 7.0.0
|
|
50
50
|
|
|
51
51
|
#### Reviewed bundled license text
|
|
52
52
|
|
package/dist/node/acceptorV3.js
CHANGED
|
@@ -9,7 +9,7 @@ import { unwrapArtifactHandleV3, } from "../v3/publicApi.js";
|
|
|
9
9
|
import { SessionHandlersV3, createRPCRouter, freezeSessionHandlersV3, } from "./acceptor.js";
|
|
10
10
|
import { serveFrozenStreamHandlers } from "../public/streamHandlers.js";
|
|
11
11
|
import { createNativeRawQuicDriver, loadNativeTransportAddon, } from "./nativeTransportAddon.js";
|
|
12
|
-
import { startNodeRawQuicListenerV3, startNodeWebTransportListener, } from "./rawQuicServerV3.js";
|
|
12
|
+
import { startNodeRawQuicListenerV3, startNodeWebTransportListener, validateWebTransportListeners, } from "./rawQuicServerV3.js";
|
|
13
13
|
import { startNodeWebSocketListenerV3, } from "./webSocketServerV3.js";
|
|
14
14
|
import { runtimeAuthorizationRequestV3FromDecoded, } from "./runtimeAuthorizationV3.js";
|
|
15
15
|
const DEFAULT_ADMISSION_TIMEOUT_MS = 10_000;
|
|
@@ -272,6 +272,7 @@ async function listen(state, listener, ingress) {
|
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
function validateOptions(options) {
|
|
275
|
+
validateWebTransportListeners(options.listeners);
|
|
275
276
|
if (options.listeners.length === 0 ||
|
|
276
277
|
(options.maxPendingSessions !== undefined && (!Number.isSafeInteger(options.maxPendingSessions) || options.maxPendingSessions < 1 || options.maxPendingSessions > 65536)) ||
|
|
277
278
|
!Number.isSafeInteger(options.maxInboundStreams) || options.maxInboundStreams < 1 ||
|
|
@@ -5,7 +5,7 @@ import { type ArtifactSourceV3, type ConnectionControllerV3 } from "../v3/connec
|
|
|
5
5
|
import { RPCHandlers, type SessionHandlerBinding } from "./acceptor.js";
|
|
6
6
|
export type NodeTLSRootsV3 = string | Uint8Array | readonly (string | Uint8Array)[];
|
|
7
7
|
export type SessionOptionsV3 = Readonly<{
|
|
8
|
-
|
|
8
|
+
webTransport?: boolean;
|
|
9
9
|
origin?: string;
|
|
10
10
|
roots?: NodeTLSRootsV3;
|
|
11
11
|
connectionPath?: NodeConnectionPath;
|
|
@@ -18,7 +18,7 @@ export type SessionOptionsV3 = Readonly<{
|
|
|
18
18
|
tunnelIngressURL?: string;
|
|
19
19
|
}>;
|
|
20
20
|
export type ConnectionControllerOptionsV3 = Readonly<{
|
|
21
|
-
|
|
21
|
+
webTransport?: boolean;
|
|
22
22
|
origin?: string;
|
|
23
23
|
roots?: NodeTLSRootsV3;
|
|
24
24
|
connectionPath?: NodeConnectionPath;
|
|
@@ -11,9 +11,11 @@ import { createNativeRawQuicDriver, createNativeWebTransportDriver, tryLoadNativ
|
|
|
11
11
|
import { createNodeRawQuicClientV3 } from "./rawQuicAdapterV3.js";
|
|
12
12
|
import { createRPCRouter, freezeRPCHandlers, RPCHandlers, } from "./acceptor.js";
|
|
13
13
|
export async function connectV3(lease, options) {
|
|
14
|
+
validateWebTransportOptIn(options);
|
|
14
15
|
return await connectArtifactLeaseWithRuntimeV3(lease, options, () => nodeRuntime(options));
|
|
15
16
|
}
|
|
16
17
|
export function createConnectionControllerV3(source, options) {
|
|
18
|
+
validateWebTransportOptIn(options);
|
|
17
19
|
if (options.rpcHandlers !== undefined && !(options.rpcHandlers instanceof RPCHandlers)) {
|
|
18
20
|
throw new ConnectErrorV3("artifact_invalid", { kind: "terminal" });
|
|
19
21
|
}
|
|
@@ -26,6 +28,12 @@ export function createConnectionControllerV3(source, options) {
|
|
|
26
28
|
};
|
|
27
29
|
return createCoreControllerV3(source, async (context) => await attemptClaimedArtifactLeaseV3(context, runtime), coreOptions);
|
|
28
30
|
}
|
|
31
|
+
function validateWebTransportOptIn(options) {
|
|
32
|
+
if ("webTransportProfile" in options)
|
|
33
|
+
throw new TypeError("webTransportProfile was removed; use webTransport: true for draft02, or use a raw_quic candidate for Go-initiated connections");
|
|
34
|
+
if (options.webTransport !== undefined && typeof options.webTransport !== "boolean")
|
|
35
|
+
throw new TypeError("webTransport must be a boolean");
|
|
36
|
+
}
|
|
29
37
|
function nodeRuntime(options) {
|
|
30
38
|
const connectTimeoutMilliseconds = options.connectTimeoutMs ?? SDK_DEFAULTS.transport.connectTimeoutMs;
|
|
31
39
|
if (!Number.isSafeInteger(connectTimeoutMilliseconds) || connectTimeoutMilliseconds < 1) {
|
|
@@ -36,9 +44,7 @@ function nodeRuntime(options) {
|
|
|
36
44
|
}
|
|
37
45
|
const addon = options.connectionPath === undefined ? tryLoadNativeTransportAddon() : undefined;
|
|
38
46
|
const rawQuic = addon === undefined ? undefined : createNativeRawQuicDriver(addon);
|
|
39
|
-
|
|
40
|
-
throw new ConnectErrorV3("artifact_invalid", { kind: "terminal" });
|
|
41
|
-
const webTransport = addon !== undefined && options.webTransportProfile !== undefined ? createNativeWebTransportDriver(addon, options.webTransportProfile) : undefined;
|
|
47
|
+
const webTransport = addon !== undefined && options.webTransport === true ? createNativeWebTransportDriver(addon) : undefined;
|
|
42
48
|
const capability = detectNodeRuntimeCapabilityV3(rawQuic !== undefined, options.origin !== undefined, webTransport !== undefined);
|
|
43
49
|
let rpcSnapshot;
|
|
44
50
|
try {
|
|
@@ -43,16 +43,13 @@ export type NativeRawQuicDriver = Readonly<{
|
|
|
43
43
|
}>): Promise<NativeCarrierSessionV3>;
|
|
44
44
|
bindRawQuic(options: NativeRawQuicBindOptions): Promise<NativeRawQuicListener>;
|
|
45
45
|
}>;
|
|
46
|
-
type WebTransportProfile = "draft02" | "native_h3";
|
|
47
46
|
export type NativeWebTransportConnectOptions = NativeRawQuicConnectOptions & Readonly<{
|
|
48
47
|
url: string;
|
|
49
48
|
origin: string;
|
|
50
|
-
profile?: WebTransportProfile;
|
|
51
49
|
}>;
|
|
52
50
|
export type NativeWebTransportBindOptions = NativeRawQuicBindOptions & Readonly<{
|
|
53
51
|
authorityHost: string;
|
|
54
52
|
allowedOrigins: readonly string[];
|
|
55
|
-
profile?: WebTransportProfile;
|
|
56
53
|
}>;
|
|
57
54
|
type NativeOperation<T> = Readonly<{
|
|
58
55
|
result(): Promise<T>;
|
|
@@ -102,7 +99,6 @@ type NativeRawQuicListenerBinding = Readonly<{
|
|
|
102
99
|
}>;
|
|
103
100
|
export type NativeTransportAddonBinding = Readonly<{
|
|
104
101
|
contractVersion(): number;
|
|
105
|
-
supportsNativeH3?(): boolean;
|
|
106
102
|
connectRawQuic(options: NativeRawQuicConnectOptions): NativeOperation<NativeRawQuicSessionBinding>;
|
|
107
103
|
bindRawQuic(options: NativeRawQuicBindOptions): Promise<NativeRawQuicListenerBinding>;
|
|
108
104
|
connectWebTransport?(options: NativeWebTransportConnectOptions): NativeOperation<NativeRawQuicSessionBinding>;
|
|
@@ -117,7 +113,7 @@ type RequireFunction = (specifier: string) => unknown;
|
|
|
117
113
|
export declare function loadNativeTransportAddon(requireFunction?: RequireFunction): NativeTransportAddonBinding;
|
|
118
114
|
export declare function tryLoadNativeTransportAddon(requireFunction?: RequireFunction): NativeTransportAddonBinding | undefined;
|
|
119
115
|
export declare function createNativeRawQuicDriver(addon?: NativeTransportAddonBinding): NativeRawQuicDriver;
|
|
120
|
-
export declare function createNativeWebTransportDriver(addon: NativeTransportAddonBinding
|
|
116
|
+
export declare function createNativeWebTransportDriver(addon: NativeTransportAddonBinding): Readonly<{
|
|
121
117
|
connect(options: NativeWebTransportConnectOptions, signal?: AbortSignal): Promise<Readonly<{
|
|
122
118
|
kind: "webtransport" | "raw_quic";
|
|
123
119
|
path: PathKind;
|
|
@@ -76,18 +76,16 @@ function isNativeTransportAddon(value) {
|
|
|
76
76
|
typeof candidate.connectRawQuic === "function" &&
|
|
77
77
|
typeof candidate.bindRawQuic === "function";
|
|
78
78
|
}
|
|
79
|
-
export function createNativeWebTransportDriver(addon
|
|
79
|
+
export function createNativeWebTransportDriver(addon) {
|
|
80
80
|
const { connectWebTransport, bindWebTransport } = addon;
|
|
81
81
|
if (typeof connectWebTransport !== "function" || typeof bindWebTransport !== "function")
|
|
82
82
|
return undefined;
|
|
83
|
-
if (profile === "native_h3" && addon.supportsNativeH3?.() !== true)
|
|
84
|
-
return undefined;
|
|
85
83
|
return Object.freeze({
|
|
86
84
|
async connect(options, signal) {
|
|
87
|
-
return wrapSession(await settle(connectWebTransport(
|
|
85
|
+
return wrapSession(await settle(connectWebTransport(options), signal, value => value.abort()), "webtransport", options.path);
|
|
88
86
|
},
|
|
89
87
|
async bind(options) {
|
|
90
|
-
const native = await bindWebTransport(
|
|
88
|
+
const native = await bindWebTransport(options);
|
|
91
89
|
return Object.freeze({ address: () => native.address(), close: () => native.close(),
|
|
92
90
|
accept: async (operation = {}) => wrapSession(await settle(native.accept(), operation.signal, value => value.abort()), "webtransport", options.path) });
|
|
93
91
|
},
|
|
@@ -24,11 +24,13 @@ export type NodeRawQuicListenerV3 = Readonly<{
|
|
|
24
24
|
export declare function startNodeRawQuicListenerV3(driver: NativeRawQuicDriver, options: NodeRawQuicListenerOptionsV3): Promise<NodeRawQuicListenerV3>;
|
|
25
25
|
export type NodeWebTransportListenerConfig = Readonly<{
|
|
26
26
|
carrier: "webtransport";
|
|
27
|
-
profile: "draft02" | "native_h3";
|
|
28
27
|
host: string;
|
|
29
28
|
port: number;
|
|
30
29
|
publicURL?: string;
|
|
31
30
|
tls: NodeRawQuicListenerOptionsV3["tls"];
|
|
32
31
|
allowedOrigins: readonly string[];
|
|
33
32
|
}>;
|
|
33
|
+
export declare function validateWebTransportListeners(listeners: readonly {
|
|
34
|
+
carrier: string;
|
|
35
|
+
}[]): void;
|
|
34
36
|
export declare function startNodeWebTransportListener(options: NodeWebTransportListenerConfig & NodeRawQuicListenerOptionsV3): Promise<NodeRawQuicListenerV3>;
|
|
@@ -27,13 +27,17 @@ export async function startNodeRawQuicListenerV3(driver, options) {
|
|
|
27
27
|
close: async () => await listener.close(),
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
export function validateWebTransportListeners(listeners) {
|
|
31
|
+
if (listeners.some(listener => listener.carrier === "webtransport" && "profile" in listener))
|
|
32
|
+
throw new TypeError("WebTransport listener profile was removed; omit profile for draft02 or configure a raw_quic listener for Go clients");
|
|
33
|
+
}
|
|
30
34
|
export async function startNodeWebTransportListener(options) {
|
|
31
35
|
validateOptions(options);
|
|
32
|
-
if (
|
|
36
|
+
if (!Array.isArray(options.allowedOrigins) || options.allowedOrigins.length < 1 || options.allowedOrigins.length > 64 ||
|
|
33
37
|
new Set(options.allowedOrigins).size !== options.allowedOrigins.length || !options.allowedOrigins.every(validOrigin))
|
|
34
38
|
throw new TypeError("invalid WebTransport Origin policy");
|
|
35
39
|
const url = new URL(boundIngressURL(options.path, "webtransport", { host: options.host, port: options.port || 443 }, options.publicURL));
|
|
36
|
-
const driver = createNativeWebTransportDriver(loadNativeTransportAddon()
|
|
40
|
+
const driver = createNativeWebTransportDriver(loadNativeTransportAddon());
|
|
37
41
|
if (driver === undefined)
|
|
38
42
|
throw new NativeTransportUnavailableError();
|
|
39
43
|
const listener = await driver.bind({ host: options.host, port: options.port, path: options.path, authorityHost: url.hostname,
|
|
@@ -5,7 +5,7 @@ import { CarrierError, } from "../v3/carrier.js";
|
|
|
5
5
|
import { boundIngressURL } from "./listenerIngress.js";
|
|
6
6
|
import { startNodeWebSocketListenerV3 } from "./webSocketServerV3.js";
|
|
7
7
|
import { createNativeRawQuicDriver } from "./nativeTransportAddon.js";
|
|
8
|
-
import { startNodeRawQuicListenerV3, startNodeWebTransportListener } from "./rawQuicServerV3.js";
|
|
8
|
+
import { startNodeRawQuicListenerV3, startNodeWebTransportListener, validateWebTransportListeners } from "./rawQuicServerV3.js";
|
|
9
9
|
import { consumeTunnelAuthorizationGrantV3, inspectTunnelAuthorizationGrantV3, retireTunnelAuthorizationGrantV3, runtimeAuthorizationRequestV3FromDecoded, validateTunnelAuthorizationGrantV3, } from "./runtimeAuthorizationV3.js";
|
|
10
10
|
const DEFAULT_PAIR_TIMEOUT_MS = 10_000;
|
|
11
11
|
const DEFAULT_ADMISSION_TIMEOUT_MS = 10_000;
|
|
@@ -636,6 +636,7 @@ async function reject(received, reason, retryable, admissionReasons, signal) {
|
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
function validateOptions(options) {
|
|
639
|
+
validateWebTransportListeners(options.listeners);
|
|
639
640
|
const limits = {
|
|
640
641
|
maxPendingLegs: options.maxPendingLegs ?? DEFAULT_MAX_PENDING_LEGS,
|
|
641
642
|
maxActivePairs: options.maxActivePairs ?? DEFAULT_MAX_ACTIVE_PAIRS,
|
|
@@ -21,6 +21,9 @@ export async function startNodeWebSocketListenerV3(options) {
|
|
|
21
21
|
minVersion: "TLSv1.3",
|
|
22
22
|
maxVersion: "TLSv1.3",
|
|
23
23
|
secureOptions: constants.SSL_OP_NO_TICKET,
|
|
24
|
+
}, (_request, response) => {
|
|
25
|
+
response.writeHead(404, { Connection: "close", "Content-Length": "0" });
|
|
26
|
+
response.end();
|
|
24
27
|
});
|
|
25
28
|
const sessions = new SessionQueueV3(maxPendingSessions, pendingSessionTimeoutMs);
|
|
26
29
|
const sockets = new Set();
|