@floegence/flowersec-core 2.5.4 → 3.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 +46 -18
- package/dist/browser/connectSessionV3.d.ts +13 -0
- package/dist/browser/connectSessionV3.js +75 -0
- package/dist/browser/index.d.ts +3 -2
- package/dist/browser/index.js +2 -1
- package/dist/browser/v2.d.ts +3 -0
- package/dist/browser/v2.js +2 -0
- package/dist/facade.d.ts +15 -8
- package/dist/facade.js +5 -4
- package/dist/interop/proxyServerPeer.js +1 -1
- package/dist/interop/serverParityPeer.js +8 -1
- package/dist/node/acceptor.d.ts +10 -0
- package/dist/node/acceptor.js +45 -2
- package/dist/node/acceptorV3.d.ts +57 -0
- package/dist/node/acceptorV3.js +227 -0
- package/dist/node/connectSessionV3.d.ts +21 -0
- package/dist/node/connectSessionV3.js +73 -0
- package/dist/node/index.d.ts +15 -10
- package/dist/node/index.js +6 -5
- package/dist/node/nativeTransportAddon.d.ts +39 -1
- package/dist/node/nativeTransportAddon.js +29 -5
- package/dist/node/rawQuicAdapterV3.d.ts +10 -0
- package/dist/node/rawQuicAdapterV3.js +76 -0
- package/dist/node/rawQuicServerV3.d.ts +24 -0
- package/dist/node/rawQuicServerV3.js +34 -0
- package/dist/node/runtimeAuthorizationV3.d.ts +29 -0
- package/dist/node/runtimeAuthorizationV3.js +126 -0
- package/dist/node/tunnelRuntimeV3.d.ts +57 -0
- package/dist/node/tunnelRuntimeV3.js +857 -0
- package/dist/node/v2.d.ts +11 -0
- package/dist/node/v2.js +6 -0
- package/dist/node/webSocketServerV3.d.ts +27 -0
- package/dist/node/webSocketServerV3.js +219 -0
- package/dist/public/streamHandlers.d.ts +3 -0
- package/dist/public/streamHandlers.js +6 -1
- package/dist/v2/index.d.ts +14 -0
- package/dist/v2/index.js +7 -0
- package/dist/v2/protocol.js +23 -32
- package/dist/v2/session.d.ts +5 -0
- package/dist/v2/session.js +90 -35
- package/dist/v3/admissionError.d.ts +4 -0
- package/dist/v3/admissionError.js +8 -0
- package/dist/v3/artifact.d.ts +145 -0
- package/dist/v3/artifact.js +1162 -0
- package/dist/v3/artifactLease.d.ts +17 -0
- package/dist/v3/artifactLease.js +109 -0
- package/dist/v3/browserRuntime.d.ts +37 -0
- package/dist/v3/browserRuntime.js +197 -0
- package/dist/v3/browserSessionRuntime.d.ts +2 -0
- package/dist/v3/browserSessionRuntime.js +21 -0
- package/dist/v3/capability.d.ts +32 -0
- package/dist/v3/capability.js +345 -0
- package/dist/v3/carrier.d.ts +84 -0
- package/dist/v3/carrier.js +411 -0
- package/dist/v3/connectionController.d.ts +87 -0
- package/dist/v3/connectionController.js +805 -0
- package/dist/v3/contract.d.ts +65 -0
- package/dist/v3/contract.js +3 -0
- package/dist/v3/controller.d.ts +43 -0
- package/dist/v3/controller.js +303 -0
- package/dist/v3/handshake.d.ts +81 -0
- package/dist/v3/handshake.js +471 -0
- package/dist/v3/jcs.d.ts +6 -0
- package/dist/v3/jcs.js +69 -0
- package/dist/v3/jsonPreflight.d.ts +1 -0
- package/dist/v3/jsonPreflight.js +251 -0
- package/dist/v3/nodeRuntime.d.ts +40 -0
- package/dist/v3/nodeRuntime.js +315 -0
- package/dist/v3/nodeSessionRuntime.d.ts +2 -0
- package/dist/v3/nodeSessionRuntime.js +13 -0
- package/dist/v3/protocol.d.ts +99 -0
- package/dist/v3/protocol.js +773 -0
- package/dist/v3/publicApi.d.ts +12 -0
- package/dist/v3/publicApi.js +46 -0
- package/dist/v3/publicSession.d.ts +1 -0
- package/dist/v3/publicSession.js +281 -0
- package/dist/v3/retryDisposition.d.ts +16 -0
- package/dist/v3/retryDisposition.js +30 -0
- package/dist/v3/runtimeAdapters.d.ts +9 -0
- package/dist/v3/runtimeAdapters.js +109 -0
- package/dist/v3/security.d.ts +34 -0
- package/dist/v3/security.js +100 -0
- package/dist/v3/serverAdmission.d.ts +38 -0
- package/dist/v3/serverAdmission.js +223 -0
- package/dist/v3/session.d.ts +318 -0
- package/dist/v3/session.js +2289 -0
- package/dist/v3/sessionConnector.d.ts +37 -0
- package/dist/v3/sessionConnector.js +440 -0
- package/dist/v3/streamLifetimeLedger.d.ts +31 -0
- package/dist/v3/streamLifetimeLedger.js +131 -0
- package/dist/v3/streamMetadata.d.ts +1 -0
- package/dist/v3/streamMetadata.js +7 -0
- package/dist/v3/transportConstants.d.ts +56 -0
- package/dist/v3/transportConstants.js +59 -0
- package/dist/v3/unreliableMessage.d.ts +44 -0
- package/dist/v3/unreliableMessage.js +284 -0
- package/dist/v3/webSocketCarrier.d.ts +31 -0
- package/dist/v3/webSocketCarrier.js +370 -0
- package/dist/v3/webTransportCarrier.d.ts +27 -0
- package/dist/v3/webTransportCarrier.js +534 -0
- package/package.json +4 -4
- package/sbom/cyclonedx.json +6 -6
- package/sbom/spdx.json +11 -11
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { FLOWERSEC_V3_PROFILE } from "./transportConstants.js";
|
|
2
|
+
export type ArtifactCarrierV3 = "websocket" | "raw_quic" | "webtransport";
|
|
3
|
+
export type ArtifactPathKindV3 = "direct" | "tunnel";
|
|
4
|
+
export type CertificatePinV3 = Readonly<{
|
|
5
|
+
algorithm: "sha-256";
|
|
6
|
+
not_after_unix_s: number;
|
|
7
|
+
value_b64u: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type TransportSecurityPolicyV3 = Readonly<{
|
|
10
|
+
mode: "ca";
|
|
11
|
+
}> | Readonly<{
|
|
12
|
+
mode: "pin";
|
|
13
|
+
pins: readonly CertificatePinV3[];
|
|
14
|
+
}>;
|
|
15
|
+
export type ArtifactCandidateV3 = Readonly<{
|
|
16
|
+
id: string;
|
|
17
|
+
carrier: ArtifactCarrierV3;
|
|
18
|
+
url: string;
|
|
19
|
+
wire_profile: string;
|
|
20
|
+
tls: TransportSecurityPolicyV3;
|
|
21
|
+
normalized_url?: string;
|
|
22
|
+
}>;
|
|
23
|
+
export type CanonicalArtifactCandidateV3 = Readonly<{
|
|
24
|
+
carrier: ArtifactCarrierV3;
|
|
25
|
+
id: string;
|
|
26
|
+
normalized_url: string;
|
|
27
|
+
tls: TransportSecurityPolicyV3;
|
|
28
|
+
wire_profile: string;
|
|
29
|
+
}>;
|
|
30
|
+
export type SessionContractV3 = Readonly<{
|
|
31
|
+
channel_id: string;
|
|
32
|
+
init_expire_at_unix_s: number;
|
|
33
|
+
idle_timeout_seconds: number;
|
|
34
|
+
establish_timeout_seconds: number;
|
|
35
|
+
rekey_prepare_timeout_seconds: number;
|
|
36
|
+
rekey_completion_timeout_seconds: number;
|
|
37
|
+
max_inbound_streams: number;
|
|
38
|
+
e2ee_psk_b64u: string;
|
|
39
|
+
allowed_suites: readonly number[];
|
|
40
|
+
default_suite: number;
|
|
41
|
+
selected_features: number;
|
|
42
|
+
contract_hash_b64u: string;
|
|
43
|
+
}>;
|
|
44
|
+
export type DirectArtifactPathV3 = Readonly<{
|
|
45
|
+
kind: "direct";
|
|
46
|
+
rendezvous_group_id: string;
|
|
47
|
+
listener_audience: string;
|
|
48
|
+
routing_token: string;
|
|
49
|
+
candidates: readonly ArtifactCandidateV3[];
|
|
50
|
+
}>;
|
|
51
|
+
export type TunnelArtifactPathV3 = Readonly<{
|
|
52
|
+
kind: "tunnel";
|
|
53
|
+
rendezvous_group_id: string;
|
|
54
|
+
listener_audience: string;
|
|
55
|
+
role: 1 | 2;
|
|
56
|
+
local_endpoint_instance_id: string;
|
|
57
|
+
expected_peer_endpoint_instance_id: string;
|
|
58
|
+
token: string;
|
|
59
|
+
candidates: readonly ArtifactCandidateV3[];
|
|
60
|
+
}>;
|
|
61
|
+
export type ScopeMetadataV3 = Readonly<{
|
|
62
|
+
scope: string;
|
|
63
|
+
scope_version: number;
|
|
64
|
+
critical: boolean;
|
|
65
|
+
payload: Readonly<Record<string, unknown>>;
|
|
66
|
+
}>;
|
|
67
|
+
export type CorrelationTagV3 = Readonly<{
|
|
68
|
+
key: string;
|
|
69
|
+
value: string;
|
|
70
|
+
}>;
|
|
71
|
+
export type CorrelationContextV3 = Readonly<{
|
|
72
|
+
v: 3;
|
|
73
|
+
tags: readonly CorrelationTagV3[];
|
|
74
|
+
}>;
|
|
75
|
+
export type ArtifactV3 = Readonly<{
|
|
76
|
+
v: 3;
|
|
77
|
+
profile: typeof FLOWERSEC_V3_PROFILE;
|
|
78
|
+
session: SessionContractV3;
|
|
79
|
+
path: DirectArtifactPathV3 | TunnelArtifactPathV3;
|
|
80
|
+
scoped: readonly ScopeMetadataV3[];
|
|
81
|
+
correlation: CorrelationContextV3;
|
|
82
|
+
}>;
|
|
83
|
+
type CommonFSB3RequestV3 = Readonly<{
|
|
84
|
+
profile: typeof FLOWERSEC_V3_PROFILE;
|
|
85
|
+
channel_id: string;
|
|
86
|
+
session_contract_hash_b64u: string;
|
|
87
|
+
rendezvous_group_id: string;
|
|
88
|
+
candidates: readonly CanonicalArtifactCandidateV3[];
|
|
89
|
+
candidate_set_hash_b64u: string;
|
|
90
|
+
chosen_candidate_id: string;
|
|
91
|
+
listener_audience: string;
|
|
92
|
+
}>;
|
|
93
|
+
export type DirectFSB3RequestV3 = CommonFSB3RequestV3 & Readonly<{
|
|
94
|
+
pathKind: "direct";
|
|
95
|
+
routing_token: string;
|
|
96
|
+
}>;
|
|
97
|
+
export type TunnelFSB3RequestV3 = CommonFSB3RequestV3 & Readonly<{
|
|
98
|
+
pathKind: "tunnel";
|
|
99
|
+
role: 1 | 2;
|
|
100
|
+
endpoint_instance_id: string;
|
|
101
|
+
attach_token: string;
|
|
102
|
+
}>;
|
|
103
|
+
export type FSB3RequestV3 = DirectFSB3RequestV3 | TunnelFSB3RequestV3;
|
|
104
|
+
export type DecodedFSB3RequestV3 = Readonly<{
|
|
105
|
+
request: FSB3RequestV3;
|
|
106
|
+
raw: Uint8Array;
|
|
107
|
+
localAdmissionBinding: Uint8Array;
|
|
108
|
+
}>;
|
|
109
|
+
export declare enum AdmissionStatusV3 {
|
|
110
|
+
Success = 0,
|
|
111
|
+
Reject = 1,
|
|
112
|
+
Retryable = 2
|
|
113
|
+
}
|
|
114
|
+
export type AdmissionResponseV3 = Readonly<{
|
|
115
|
+
status: AdmissionStatusV3;
|
|
116
|
+
reason: string;
|
|
117
|
+
}>;
|
|
118
|
+
export type ArtifactV3ErrorCode = "artifact_too_large" | "fsb3_payload_too_large" | "invalid_artifact" | "invalid_candidate" | "invalid_fsa3" | "invalid_fsb3" | "noncanonical_fsb3";
|
|
119
|
+
export declare class ArtifactV3Error extends Error {
|
|
120
|
+
readonly code: ArtifactV3ErrorCode;
|
|
121
|
+
constructor(code: ArtifactV3ErrorCode, message: string);
|
|
122
|
+
}
|
|
123
|
+
export type LabeledHashV3 = Readonly<{
|
|
124
|
+
canonicalJSON: string;
|
|
125
|
+
hash: Uint8Array;
|
|
126
|
+
hashBase64URL: string;
|
|
127
|
+
}>;
|
|
128
|
+
export type CanonicalCandidateSetV3 = LabeledHashV3 & Readonly<{
|
|
129
|
+
candidates: readonly CanonicalArtifactCandidateV3[];
|
|
130
|
+
}>;
|
|
131
|
+
export declare function computeSessionContractHashV3(session: SessionContractV3): LabeledHashV3;
|
|
132
|
+
export declare function canonicalizeCandidatesV3(kind: ArtifactPathKindV3, candidates: readonly ArtifactCandidateV3[]): CanonicalCandidateSetV3;
|
|
133
|
+
export declare function decodeArtifactV3JSON(raw: string | Uint8Array): ArtifactV3;
|
|
134
|
+
export declare function encodeArtifactV3JSON(artifact: ArtifactV3): Uint8Array;
|
|
135
|
+
export declare function validateArtifactV3(artifact: ArtifactV3): CanonicalCandidateSetV3;
|
|
136
|
+
export declare function buildFSB3RequestV3(artifact: ArtifactV3, chosenCandidateID: string): FSB3RequestV3;
|
|
137
|
+
export declare function encodeFSB3RequestV3(request: FSB3RequestV3): Uint8Array;
|
|
138
|
+
export declare function decodeFSB3RequestV3(raw: Uint8Array): DecodedFSB3RequestV3;
|
|
139
|
+
export declare function admissionBindingV3(rawFSB3: Uint8Array): Uint8Array;
|
|
140
|
+
export declare function acceptorAdmissionsHashV3(framesByCandidateID: ReadonlyMap<string, Uint8Array>): Uint8Array;
|
|
141
|
+
export declare function encodeFSA3ResponseV3(response: AdmissionResponseV3, admissionReasons?: ReadonlySet<string>): Uint8Array;
|
|
142
|
+
export declare function decodeFSA3ResponseV3(raw: Uint8Array): AdmissionResponseV3;
|
|
143
|
+
export declare function tlsPolicyDigestV3(policy: TransportSecurityPolicyV3): LabeledHashV3;
|
|
144
|
+
export declare function activePinsV3(policy: TransportSecurityPolicyV3, attemptNowUnixSeconds: number): readonly CertificatePinV3[];
|
|
145
|
+
export {};
|