@floegence/flowersec-core 3.2.1 → 5.0.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 +57 -200
- package/THIRD_PARTY_NOTICES.md +11 -11
- package/dist/browser/index.d.ts +0 -5
- package/dist/browser/index.js +0 -3
- package/dist/cli.js +93 -64
- package/dist/facade.d.ts +0 -17
- package/dist/facade.js +0 -11
- package/dist/generated/unicode151.d.ts +2 -0
- package/dist/generated/unicode151.js +83 -0
- package/dist/interop/proxyServerPeer.js +34 -20
- package/dist/interop/serverParityPeer.js +11 -252
- package/dist/node/acceptor.d.ts +1 -57
- package/dist/node/acceptor.js +3 -420
- package/dist/node/acceptorV3.js +2 -2
- package/dist/node/connectSessionV3.js +2 -2
- package/dist/node/index.d.ts +2 -17
- package/dist/node/index.js +1 -9
- package/dist/node/nativeTransportAddon.d.ts +7 -36
- package/dist/node/nativeTransportAddon.js +7 -27
- package/dist/node/proxyServer.d.ts +2 -2
- package/dist/node/proxyServer.js +2 -2
- package/dist/node/rawQuicAdapterV3.d.ts +2 -2
- package/dist/node/rawQuicAdapterV3.js +1 -1
- package/dist/node/rawQuicServerV3.d.ts +2 -2
- package/dist/node/rawQuicServerV3.js +1 -1
- package/dist/node/rawQuicTls.d.ts +2 -0
- package/dist/node/{rawQuicAdapter.js → rawQuicTls.js} +30 -45
- package/dist/node/tunnelRuntimeV3.js +2 -2
- package/dist/proxy/index.d.ts +1 -1
- package/dist/proxy/index.js +1 -1
- package/dist/proxy/integration.d.ts +5 -5
- package/dist/proxy/integration.js +2 -2
- package/dist/proxy/runtime.js +11 -26
- package/dist/proxy/serviceWorkerRuntime.d.ts +7 -0
- package/dist/proxy/serviceWorkerRuntime.js +75 -0
- package/dist/proxy/types.d.ts +0 -1
- package/dist/proxy/windowBridge.d.ts +2 -0
- package/dist/proxy/windowBridge.js +53 -6
- package/dist/public/contract.d.ts +1 -3
- package/dist/public/streamHandlers.d.ts +0 -3
- package/dist/public/streamHandlers.js +2 -4
- package/dist/public/streamMetadata.js +2 -2
- package/dist/runtime/errors.d.ts +2 -2
- package/dist/testSupport/tlsFixture.d.ts +2 -0
- package/dist/testSupport/tlsFixture.js +8 -0
- package/dist/utils/errors.d.ts +0 -2
- package/dist/utils/errors.js +0 -80
- package/dist/v3/artifact.js +17 -3
- package/dist/v3/carrier.d.ts +2 -2
- package/dist/v3/controller.js +2 -6
- package/dist/v3/protocol.js +2 -103
- package/dist/v3/retryDisposition.d.ts +2 -2
- package/dist/v3/retryDisposition.js +0 -7
- package/dist/v3/security.d.ts +1 -10
- package/dist/v3/security.js +2 -9
- package/dist/vendor/tr46.d.ts +4 -0
- package/dist/vendor/tr46.js +37 -32
- package/package.json +19 -17
- package/sbom/cyclonedx.json +62 -62
- package/sbom/spdx.json +65 -65
- package/dist/browser/connectSession.d.ts +0 -13
- package/dist/browser/connectSession.js +0 -40
- package/dist/browser/runtimeCapability.d.ts +0 -13
- package/dist/browser/runtimeCapability.js +0 -27
- package/dist/browser/sessionRuntime.d.ts +0 -2
- package/dist/browser/sessionRuntime.js +0 -21
- package/dist/browser/v2.d.ts +0 -3
- package/dist/browser/v2.js +0 -2
- package/dist/browser/webTransportClient.d.ts +0 -8
- package/dist/browser/webTransportClient.js +0 -55
- package/dist/connectionController.d.ts +0 -55
- package/dist/connectionController.js +0 -441
- package/dist/connector/adapters/rawQuicCandidate.d.ts +0 -5
- package/dist/connector/adapters/rawQuicCandidate.js +0 -71
- package/dist/connector/adapters/webSocketCandidate.d.ts +0 -7
- package/dist/connector/adapters/webSocketCandidate.js +0 -116
- package/dist/connector/adapters/webTransportCandidate.d.ts +0 -5
- package/dist/connector/adapters/webTransportCandidate.js +0 -73
- package/dist/connector/admissionCommit.d.ts +0 -31
- package/dist/connector/admissionCommit.js +0 -239
- package/dist/connector/sessionAcceptor.d.ts +0 -38
- package/dist/connector/sessionAcceptor.js +0 -158
- package/dist/connector/sessionConfig.d.ts +0 -3
- package/dist/connector/sessionConfig.js +0 -30
- package/dist/connector/sessionConnector.d.ts +0 -47
- package/dist/connector/sessionConnector.js +0 -606
- package/dist/node/connectSession.d.ts +0 -23
- package/dist/node/connectSession.js +0 -93
- package/dist/node/controlplane.d.ts +0 -137
- package/dist/node/controlplane.js +0 -443
- package/dist/node/rawQuicAdapter.d.ts +0 -9
- package/dist/node/rawQuicServer.d.ts +0 -24
- package/dist/node/rawQuicServer.js +0 -37
- package/dist/node/runtimeCapability.d.ts +0 -14
- package/dist/node/runtimeCapability.js +0 -24
- package/dist/node/sessionRuntime.d.ts +0 -2
- package/dist/node/sessionRuntime.js +0 -13
- package/dist/node/tunnelRuntime.d.ts +0 -42
- package/dist/node/tunnelRuntime.js +0 -559
- package/dist/node/v2.d.ts +0 -11
- package/dist/node/v2.js +0 -6
- package/dist/node/webSocketServer.d.ts +0 -24
- package/dist/node/webSocketServer.js +0 -135
- package/dist/public/artifact.d.ts +0 -11
- package/dist/public/artifact.js +0 -44
- package/dist/public/artifactLease.d.ts +0 -10
- package/dist/public/artifactLease.js +0 -41
- package/dist/public/connectError.d.ts +0 -6
- package/dist/public/connectError.js +0 -9
- package/dist/transport/webSocketAdapter.d.ts +0 -31
- package/dist/transport/webSocketAdapter.js +0 -370
- package/dist/transport/webTransportAdapter.d.ts +0 -27
- package/dist/transport/webTransportAdapter.js +0 -534
- package/dist/v2/admissionError.d.ts +0 -4
- package/dist/v2/admissionError.js +0 -8
- package/dist/v2/artifact.d.ts +0 -128
- package/dist/v2/artifact.js +0 -1131
- package/dist/v2/artifactLease.d.ts +0 -1
- package/dist/v2/artifactLease.js +0 -7
- package/dist/v2/capability.d.ts +0 -29
- package/dist/v2/capability.js +0 -190
- package/dist/v2/carrier.d.ts +0 -84
- package/dist/v2/carrier.js +0 -411
- package/dist/v2/contract.d.ts +0 -46
- package/dist/v2/contract.js +0 -1
- package/dist/v2/handshake.d.ts +0 -80
- package/dist/v2/handshake.js +0 -470
- package/dist/v2/index.d.ts +0 -14
- package/dist/v2/index.js +0 -7
- package/dist/v2/opaqueArtifact.d.ts +0 -1
- package/dist/v2/opaqueArtifact.js +0 -2
- package/dist/v2/protocol.d.ts +0 -99
- package/dist/v2/protocol.js +0 -737
- package/dist/v2/publicSession.d.ts +0 -1
- package/dist/v2/publicSession.js +0 -281
- package/dist/v2/retryDisposition.d.ts +0 -16
- package/dist/v2/retryDisposition.js +0 -30
- package/dist/v2/session.d.ts +0 -310
- package/dist/v2/session.js +0 -2127
- package/dist/v2/streamLifetimeLedger.d.ts +0 -31
- package/dist/v2/streamLifetimeLedger.js +0 -131
- package/dist/v2/streamMetadata.d.ts +0 -1
- package/dist/v2/streamMetadata.js +0 -7
- package/dist/v2/unreliableMessage.d.ts +0 -43
- package/dist/v2/unreliableMessage.js +0 -254
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { CarrierSessionV2 } from "../v2/carrier.js";
|
|
2
|
-
import type { PathKind } from "../v2/contract.js";
|
|
3
|
-
import type { NativeRawQuicDriver } from "./nativeTransportAddon.js";
|
|
4
|
-
export type NodeRawQuicServerOptions = Readonly<{
|
|
5
|
-
host: string;
|
|
6
|
-
port: number;
|
|
7
|
-
path: PathKind;
|
|
8
|
-
tls: Readonly<{
|
|
9
|
-
certificate: string | Uint8Array;
|
|
10
|
-
privateKey: string | Uint8Array;
|
|
11
|
-
}>;
|
|
12
|
-
inboundBidirectionalStreamCapacity: number;
|
|
13
|
-
}>;
|
|
14
|
-
export type NodeRawQuicServer = Readonly<{
|
|
15
|
-
address(): Readonly<{
|
|
16
|
-
host: string;
|
|
17
|
-
port: number;
|
|
18
|
-
}>;
|
|
19
|
-
accept(options?: Readonly<{
|
|
20
|
-
signal?: AbortSignal;
|
|
21
|
-
}>): Promise<CarrierSessionV2>;
|
|
22
|
-
close(): Promise<void>;
|
|
23
|
-
}>;
|
|
24
|
-
export declare function startNodeRawQuicServer(driver: NativeRawQuicDriver, options: NodeRawQuicServerOptions): Promise<NodeRawQuicServer>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { adaptNativeCarrierSessionV2 } from "../v2/carrier.js";
|
|
2
|
-
import { normalizeCertificateChain, normalizePrivateKey } from "./rawQuicAdapter.js";
|
|
3
|
-
export async function startNodeRawQuicServer(driver, options) {
|
|
4
|
-
validateOptions(options);
|
|
5
|
-
let listener;
|
|
6
|
-
try {
|
|
7
|
-
listener = await driver.bindRawQuic({
|
|
8
|
-
host: options.host,
|
|
9
|
-
port: options.port,
|
|
10
|
-
path: options.path,
|
|
11
|
-
certificateChainDer: normalizeCertificateChain(options.tls.certificate),
|
|
12
|
-
privateKeyDer: normalizePrivateKey(options.tls.privateKey),
|
|
13
|
-
inboundBidirectionalStreamCapacity: options.inboundBidirectionalStreamCapacity,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
if (error instanceof TypeError)
|
|
18
|
-
throw error;
|
|
19
|
-
throw new Error("Flowersec raw QUIC listener failed to bind");
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
address: () => listener.address(),
|
|
23
|
-
accept: async (operation = {}) => adaptNativeCarrierSessionV2(await listener.accept(operation)),
|
|
24
|
-
close: async () => await listener.close(),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function validateOptions(options) {
|
|
28
|
-
if (!Number.isInteger(options.port) || options.port < 0 || options.port > 65_535 ||
|
|
29
|
-
!Number.isInteger(options.inboundBidirectionalStreamCapacity) ||
|
|
30
|
-
options.inboundBidirectionalStreamCapacity < 3 ||
|
|
31
|
-
options.inboundBidirectionalStreamCapacity > 130) {
|
|
32
|
-
throw new TypeError("invalid Node raw QUIC listener options");
|
|
33
|
-
}
|
|
34
|
-
if (options.tls.certificate.length === 0 || options.tls.privateKey.length === 0) {
|
|
35
|
-
throw new TypeError("raw QUIC listener requires explicit TLS material");
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const NODE_RUNTIME_PROFILE_V2: Readonly<{
|
|
2
|
-
language: string;
|
|
3
|
-
runtime: string;
|
|
4
|
-
schemaVersion: 2;
|
|
5
|
-
tuples: readonly import("../v2/capability.js").RuntimeCapabilityTupleV2[];
|
|
6
|
-
unsupported: readonly import("../v2/capability.js").UnsupportedRuntimeCarrierV2[];
|
|
7
|
-
}>;
|
|
8
|
-
export declare function detectNodeRuntimeCapabilityV2(rawQuicAvailable: boolean): Readonly<{
|
|
9
|
-
language: string;
|
|
10
|
-
runtime: string;
|
|
11
|
-
schemaVersion: 2;
|
|
12
|
-
tuples: readonly import("../v2/capability.js").RuntimeCapabilityTupleV2[];
|
|
13
|
-
unsupported: readonly import("../v2/capability.js").UnsupportedRuntimeCarrierV2[];
|
|
14
|
-
}>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { defineRuntimeCapabilityDescriptorV2 } from "../v2/capability.js";
|
|
2
|
-
const nodeWebSocketTuples = [
|
|
3
|
-
{ carrier: "websocket", datagrams: false, migration: false, networkMode: "dial", path: "direct", reliableStreams: true, sessionRole: "client" },
|
|
4
|
-
{ carrier: "websocket", datagrams: false, migration: false, networkMode: "dial", path: "tunnel", reliableStreams: true, sessionRole: "client" },
|
|
5
|
-
{ carrier: "websocket", datagrams: false, migration: false, networkMode: "dial", path: "tunnel", reliableStreams: true, sessionRole: "server" },
|
|
6
|
-
{ carrier: "websocket", datagrams: false, migration: false, networkMode: "listen", path: "direct", reliableStreams: true, sessionRole: "server" },
|
|
7
|
-
];
|
|
8
|
-
export const NODE_RUNTIME_PROFILE_V2 = defineRuntimeCapabilityDescriptorV2("node", [
|
|
9
|
-
{ carrier: "raw_quic", datagrams: true, migration: false, networkMode: "dial", path: "direct", reliableStreams: true, sessionRole: "client" },
|
|
10
|
-
{ carrier: "raw_quic", datagrams: true, migration: false, networkMode: "dial", path: "tunnel", reliableStreams: true, sessionRole: "client" },
|
|
11
|
-
{ carrier: "raw_quic", datagrams: true, migration: false, networkMode: "dial", path: "tunnel", reliableStreams: true, sessionRole: "server" },
|
|
12
|
-
{ carrier: "raw_quic", datagrams: true, migration: false, networkMode: "listen", path: "direct", reliableStreams: true, sessionRole: "server" },
|
|
13
|
-
...nodeWebSocketTuples,
|
|
14
|
-
], [
|
|
15
|
-
{ carrier: "webtransport", reason: "node_webtransport_driver_unavailable" },
|
|
16
|
-
]);
|
|
17
|
-
export function detectNodeRuntimeCapabilityV2(rawQuicAvailable) {
|
|
18
|
-
if (rawQuicAvailable)
|
|
19
|
-
return NODE_RUNTIME_PROFILE_V2;
|
|
20
|
-
return defineRuntimeCapabilityDescriptorV2("node", nodeWebSocketTuples, [
|
|
21
|
-
{ carrier: "raw_quic", reason: "node_native_transport_unavailable" },
|
|
22
|
-
{ carrier: "webtransport", reason: "node_webtransport_driver_unavailable" },
|
|
23
|
-
]);
|
|
24
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { randomBytes } from "node:crypto";
|
|
2
|
-
import { performance } from "node:perf_hooks";
|
|
3
|
-
export const nodeSessionRuntimeV2 = Object.freeze({
|
|
4
|
-
entropy(length) {
|
|
5
|
-
if (!Number.isSafeInteger(length) || length < 1 || length > 65_536) {
|
|
6
|
-
throw new RangeError("entropy length must be an integer from 1 to 65536");
|
|
7
|
-
}
|
|
8
|
-
return Uint8Array.from(randomBytes(length));
|
|
9
|
-
},
|
|
10
|
-
monotonicMilliseconds() {
|
|
11
|
-
return performance.now();
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { OperationOptions } from "../public/contract.js";
|
|
2
|
-
import { TunnelAuthorizationResponse, type TunnelAuthorizationDecision as ControlPlaneTunnelAuthorizationDecision, type RuntimeAuthorizationRequest } from "./controlplane.js";
|
|
3
|
-
export type TunnelAuthorizationDecision = ControlPlaneTunnelAuthorizationDecision;
|
|
4
|
-
export type TunnelRuntimeListener = Readonly<{
|
|
5
|
-
carrier: "websocket";
|
|
6
|
-
host: string;
|
|
7
|
-
port: number;
|
|
8
|
-
tls: Readonly<{
|
|
9
|
-
certificate: string;
|
|
10
|
-
privateKey: string;
|
|
11
|
-
}>;
|
|
12
|
-
allowedOrigins: readonly string[];
|
|
13
|
-
}> | Readonly<{
|
|
14
|
-
carrier: "raw_quic";
|
|
15
|
-
host: string;
|
|
16
|
-
port: number;
|
|
17
|
-
tls: Readonly<{
|
|
18
|
-
certificate: string;
|
|
19
|
-
privateKey: string;
|
|
20
|
-
}>;
|
|
21
|
-
}>;
|
|
22
|
-
export type TunnelRuntimeOptions = Readonly<{
|
|
23
|
-
listeners: readonly TunnelRuntimeListener[];
|
|
24
|
-
maxInboundStreams: number;
|
|
25
|
-
maxPendingLegs?: number;
|
|
26
|
-
maxActivePairs?: number;
|
|
27
|
-
maxConcurrentStreams?: number;
|
|
28
|
-
pairTimeoutMs?: number;
|
|
29
|
-
cleanupTimeoutMs?: number;
|
|
30
|
-
authorize(request: RuntimeAuthorizationRequest, options: OperationOptions): Promise<TunnelAuthorizationDecision | TunnelAuthorizationResponse>;
|
|
31
|
-
release?(leaseId: string): Promise<void> | void;
|
|
32
|
-
}>;
|
|
33
|
-
export declare class TunnelRuntime {
|
|
34
|
-
private constructor();
|
|
35
|
-
start(): Promise<void>;
|
|
36
|
-
addresses(): readonly Readonly<{
|
|
37
|
-
host: string;
|
|
38
|
-
port: number;
|
|
39
|
-
}>[];
|
|
40
|
-
close(): Promise<void>;
|
|
41
|
-
}
|
|
42
|
-
export declare function createTunnelRuntime(options: TunnelRuntimeOptions): TunnelRuntime;
|