p2party 0.14.2 → 0.14.7
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 +230 -30
- package/docs/getting-started.md +15 -0
- package/docs/protocol-v4-security.md +40 -0
- package/docs/references.md +28 -8
- package/docs/session-api.md +10 -2
- package/lib/api/signalingServerApi.d.ts +13 -2
- package/lib/api/webrtc/applyIceConfiguration.d.ts +9 -0
- package/lib/api/webrtc/dataChannelHandler.d.ts +10 -0
- package/lib/api/webrtc/deleteRoomData.d.ts +13 -0
- package/lib/api/webrtc/disconnectFromAllRoomsQuery.d.ts +2 -1
- package/lib/api/webrtc/disconnectFromRoomQuery.d.ts +2 -1
- package/lib/api/webrtc/disconnectQuery.d.ts +2 -1
- package/lib/api/webrtc/iceRepair.d.ts +3 -1
- package/lib/api/webrtc/index.d.ts +2 -1
- package/lib/api/webrtc/interfaces.d.ts +37 -0
- package/lib/api/webrtc/negotiationLock.d.ts +24 -0
- package/lib/api/webrtc/pendingOffer.d.ts +29 -0
- package/lib/api/webrtc/rebindDeadline.d.ts +61 -0
- package/lib/api/webrtc/remoteTransportChange.d.ts +142 -0
- package/lib/api/webrtc/retiredRemoteTransports.d.ts +70 -0
- package/lib/api/webrtc/roomEdgeBudget.d.ts +10 -0
- package/lib/api/webrtc/setDescriptionQuery.d.ts +8 -1
- package/lib/api/webrtc/settleOnClose.d.ts +36 -0
- package/lib/blindRendezvous/admissionInput.d.ts +11 -0
- package/lib/blindRendezvous/admissionPolicy.d.ts +217 -0
- package/lib/blindRendezvous/canonicalSchema.d.ts +139 -0
- package/lib/blindRendezvous/carrierEnvelope.d.ts +105 -0
- package/lib/blindRendezvous/coreReduce.d.ts +199 -0
- package/lib/blindRendezvous/derivations.d.ts +381 -0
- package/lib/blindRendezvous/identityHelloAdmission.d.ts +89 -0
- package/lib/blindRendezvous/identityHelloAdmissionPersistence.d.ts +133 -0
- package/lib/blindRendezvous/identityHelloHistoricalEvidence.d.ts +52 -0
- package/lib/blindRendezvous/identityHelloOpen.d.ts +167 -0
- package/lib/blindRendezvous/identityHelloTrial.d.ts +271 -0
- package/lib/blindRendezvous/localAdmissibleProject.d.ts +101 -0
- package/lib/blindRendezvous/localPresenceKeyBinding.d.ts +108 -0
- package/lib/blindRendezvous/localStableIdentityCustody.d.ts +46 -0
- package/lib/blindRendezvous/normativeKernel.d.ts +222 -0
- package/lib/blindRendezvous/operation.d.ts +137 -0
- package/lib/blindRendezvous/operationPayload.d.ts +134 -0
- package/lib/blindRendezvous/pairBootstrapSuite.d.ts +93 -0
- package/lib/blindRendezvous/pairCrypto.d.ts +122 -0
- package/lib/blindRendezvous/pairLedger.d.ts +154 -0
- package/lib/blindRendezvous/pairOpenBudget.d.ts +67 -0
- package/lib/blindRendezvous/pairOpenReservation.d.ts +157 -0
- package/lib/blindRendezvous/pairPlaintext.d.ts +240 -0
- package/lib/blindRendezvous/pairStepEnvelope.d.ts +60 -0
- package/lib/blindRendezvous/plannerState.d.ts +61 -0
- package/lib/blindRendezvous/projections.d.ts +71 -0
- package/lib/blindRendezvous/publicWindow.d.ts +330 -0
- package/lib/blindRendezvous/retainedOperationStore.d.ts +187 -0
- package/lib/blindRendezvous/roomInviteV2.d.ts +92 -0
- package/lib/blindRendezvous/roomPolicyV4.d.ts +90 -0
- package/lib/blindRendezvous/schemas.d.ts +221 -0
- package/lib/blindRendezvous/storeDescriptor.d.ts +160 -0
- package/lib/cryptography/aeadWasm.d.ts +18 -0
- package/lib/cryptography/byteInput.d.ts +12 -0
- package/lib/cryptography/carrierAead.d.ts +23 -0
- package/lib/cryptography/chacha20poly1305.d.ts +7 -0
- package/lib/cryptography/fips202.d.ts +10 -0
- package/lib/cryptography/hpke.d.ts +84 -0
- package/lib/cryptography/hpkeSuite.d.ts +39 -0
- package/lib/cryptography/hybridKem.d.ts +42 -0
- package/lib/cryptography/hybridKemSuite.d.ts +22 -0
- package/lib/cryptography/interfaces.d.ts +3 -0
- package/lib/cryptography/mlkem.d.ts +27 -1
- package/lib/cryptography/mnemonic.d.ts +65 -1
- package/lib/cryptography/ownedEd25519KeyMaterial.d.ts +27 -0
- package/lib/cryptography/webCryptoSha256.d.ts +20 -0
- package/lib/cryptography/x25519.d.ts +18 -0
- package/lib/cryptography/xchacha20poly1305.d.ts +7 -0
- package/lib/db/api.d.ts +6 -3
- package/lib/db/identityEd25519ClientBoundary.d.ts +13 -0
- package/lib/db/src/getDB.d.ts +2 -2
- package/lib/db/types.d.ts +52 -4
- package/lib/db.worker.js +1 -1
- package/lib/handlers/coverChannelRegistry.d.ts +22 -0
- package/lib/handlers/edgeTeardownFollowUp.d.ts +35 -0
- package/lib/handlers/handleChallenge.d.ts +2 -1
- package/lib/handlers/handleConnectToPeer.d.ts +1 -1
- package/lib/handlers/handleHandshake.d.ts +2 -6
- package/lib/handlers/handleSendMessage.d.ts +60 -7
- package/lib/handlers/handleWebSocketMessage.d.ts +1 -1
- package/lib/handlers/handshakeCore.d.ts +2 -7
- package/lib/handlers/handshakeFrame.d.ts +25 -0
- package/lib/handlers/ratchetGateWait.d.ts +13 -0
- package/lib/handlers/reconcile.d.ts +24 -0
- package/lib/handlers/requestRoom.d.ts +30 -0
- package/lib/handlers/roomResponse.d.ts +53 -0
- package/lib/index.d.ts +99 -12
- package/lib/index.js +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/libcrypto.provenance.json +5 -5
- package/lib/libcrypto.wasm +0 -0
- package/lib/middleware/roomListenerMiddleware.d.ts +4 -1
- package/lib/reducers/commonSlice.d.ts +3 -2
- package/lib/reducers/keyPairSlice.d.ts +3 -6
- package/lib/reducers/roomSlice.d.ts +81 -5
- package/lib/reducers/signalingServerSlice.d.ts +3 -2
- package/lib/session.d.ts +6 -3
- package/lib/session.js +1 -1
- package/lib/session.mjs +1 -1
- package/lib/store.d.ts +4 -2
- package/lib/utils/constants.d.ts +12 -0
- package/lib/utils/correlationId.d.ts +4 -0
- package/lib/utils/identityRestore.d.ts +108 -0
- package/lib/utils/interfaces.d.ts +25 -6
- package/lib/utils/roomConnectAdmission.d.ts +15 -0
- package/lib/utils/roomLeaveCoordinator.d.ts +38 -0
- package/lib/utils/roomRequestCoordinator.d.ts +104 -0
- package/lib/utils/roomRosterReconciler.d.ts +83 -0
- package/lib/utils/sdpFingerprint.d.ts +6 -0
- package/lib/utils/signalingAttemptLifecycle.d.ts +33 -0
- package/lib/utils/signalingAuth.d.ts +21 -2
- package/lib/utils/signalingBounds.d.ts +6 -0
- package/lib/utils/signalingFrame.d.ts +21 -0
- package/lib/utils/signalingHeartbeatWatchdog.d.ts +45 -0
- package/lib/utils/signalingIngressQueue.d.ts +49 -0
- package/lib/utils/signalingPeerRequestDebouncer.d.ts +13 -0
- package/lib/utils/signalingRoomLifecycle.d.ts +7 -0
- package/lib/utils/signalingRoomOperationLifecycle.d.ts +14 -0
- package/lib/utils/signalingServerBoundary.d.ts +11 -0
- package/lib/utils/terminalSettlement.d.ts +53 -0
- package/lib/utils/transportIdentity.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type SignalingPeerRequestKind = "join" | "empty-roster" | "redial" | "reconcile";
|
|
2
|
+
/**
|
|
3
|
+
* Bounds repeated peer-list requests only within one socket lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* A reconnect must never inherit the previous socket's timestamp: the first
|
|
6
|
+
* post-proof request is what rebuilds all WebRTC edges after teardown.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SignalingPeerRequestDebouncer {
|
|
9
|
+
#private;
|
|
10
|
+
shouldSend(kind: SignalingPeerRequestKind, roomId: string, minimumIntervalMs: number, now?: number): boolean;
|
|
11
|
+
resetSocketLifecycle(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const signalingPeerRequestDebouncer: SignalingPeerRequestDebouncer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SignalingRoomStatus {
|
|
2
|
+
readonly url: string;
|
|
3
|
+
readonly id?: string;
|
|
4
|
+
readonly signalingActive?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Inbound signaling is routable only to an exact, locally active room id. */
|
|
7
|
+
export declare const findActiveSignalingRoomIndex: (rooms: readonly SignalingRoomStatus[], roomId: string) => number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One invocation-order boundary for signaling joins, disconnects, and purges.
|
|
3
|
+
*
|
|
4
|
+
* A join places all awaited prework inside this boundary. A later terminal
|
|
5
|
+
* action therefore runs after it and owns the final state; a later invalid
|
|
6
|
+
* join never cancels an earlier valid one before its own validation succeeds.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SignalingRoomOperationLifecycle {
|
|
9
|
+
#private;
|
|
10
|
+
runJoin<T>(operation: () => Promise<T>): Promise<T>;
|
|
11
|
+
runRoomTerminal<T>(_roomUrl: string, operation: () => Promise<T>): Promise<T>;
|
|
12
|
+
runGlobalTerminal<T>(operation: () => Promise<T>): Promise<T>;
|
|
13
|
+
}
|
|
14
|
+
export declare const signalingRoomOperationLifecycle: SignalingRoomOperationLifecycle;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const canonicalSignalingServerUrl: (value: string) => string;
|
|
2
|
+
export declare const buildSignalingWebSocketUrl: (signalingServerUrl: string, publicKey: string) => string;
|
|
3
|
+
export interface SignalingServerSelection {
|
|
4
|
+
requestedServerUrl: string;
|
|
5
|
+
currentServerUrl: string;
|
|
6
|
+
hasActiveRooms: boolean;
|
|
7
|
+
isConnected: boolean;
|
|
8
|
+
isEstablishingConnection: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Enforce the SDK's one-server provenance for every retained active room. */
|
|
11
|
+
export declare const selectSignalingServerUrl: ({ requestedServerUrl, currentServerUrl, hasActiveRooms, isConnected, isEstablishingConnection, }: SignalingServerSelection) => string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type TerminalSettlementStep = () => void | Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* Run every fail-closed teardown step in order, even when an earlier storage or
|
|
4
|
+
* transport cleanup fails. The caller receives all failures only after the
|
|
5
|
+
* local terminal state has been attempted everywhere.
|
|
6
|
+
*/
|
|
7
|
+
export declare const runTerminalSettlement: (message: string, steps: readonly TerminalSettlementStep[]) => Promise<void>;
|
|
8
|
+
export interface IdentityPurgeSettlement {
|
|
9
|
+
readonly disconnectSignaling: TerminalSettlementStep;
|
|
10
|
+
readonly clearRoomPins: TerminalSettlementStep;
|
|
11
|
+
readonly resetIdentity: TerminalSettlementStep;
|
|
12
|
+
/**
|
|
13
|
+
* Close every authenticated WebRTC transport before awaiting either identity
|
|
14
|
+
* deletion. A slow or failed database worker must never leave a live channel
|
|
15
|
+
* able to receive under already-reset identity state.
|
|
16
|
+
*/
|
|
17
|
+
readonly teardownRooms: TerminalSettlementStep;
|
|
18
|
+
readonly deleteIdentityX25519: TerminalSettlementStep;
|
|
19
|
+
readonly deleteIdentityEd25519: TerminalSettlementStep;
|
|
20
|
+
/**
|
|
21
|
+
* The non-secret record of how the purged identity was created. It describes
|
|
22
|
+
* a key that no longer exists, so leaving it behind would let the next
|
|
23
|
+
* identity inherit a stale claim about whether it can be backed up.
|
|
24
|
+
*/
|
|
25
|
+
readonly deleteIdentityDerivation: TerminalSettlementStep;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* SSOT for identity-purge ordering. The X25519 wrapper is still removed before
|
|
29
|
+
* the Ed25519 identity that authenticates it, but transport termination comes
|
|
30
|
+
* first and every step settles even when another one fails.
|
|
31
|
+
*/
|
|
32
|
+
export declare const runIdentityPurgeSettlement: (steps: IdentityPurgeSettlement) => Promise<void>;
|
|
33
|
+
export interface RoomPurgeSettlement {
|
|
34
|
+
/**
|
|
35
|
+
* Tombstoning happens before this orchestrator. Close local RTC first; this
|
|
36
|
+
* step is awaited before any network revocation attempt begins.
|
|
37
|
+
*/
|
|
38
|
+
readonly closeLocalTransport: TerminalSettlementStep;
|
|
39
|
+
/**
|
|
40
|
+
* Starts immediately after local transport termination and may remain
|
|
41
|
+
* pending while durable local cleanup proceeds.
|
|
42
|
+
*/
|
|
43
|
+
readonly startRemoteRevocation: () => Promise<void>;
|
|
44
|
+
readonly deleteLocalData: TerminalSettlementStep;
|
|
45
|
+
readonly clearPinAttempts: TerminalSettlementStep;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* SSOT for a single-room purge completion boundary. Every local terminal step
|
|
49
|
+
* settles even on storage/network failure; a lone typed remote-revocation
|
|
50
|
+
* error is rethrown directly so callers can narrow it without unpacking an
|
|
51
|
+
* AggregateError.
|
|
52
|
+
*/
|
|
53
|
+
export declare const runRoomPurgeSettlement: (steps: RoomPurgeSettlement) => Promise<void>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Final transport-construction gate after every preceding async operation.
|
|
3
|
+
* A purge/reset or identity rotation invalidates the captured constructor.
|
|
4
|
+
*/
|
|
5
|
+
export declare const assertTransportIdentityCurrent: (initialPublicKey: string, currentPublicKey: string) => void;
|
package/package.json
CHANGED