livekit-client 1.12.3 → 1.13.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +198 -107
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +515 -192
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +2 -5
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/turn.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/webrtc.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts +9 -3
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/KeyProvider.d.ts +10 -7
- package/dist/src/e2ee/KeyProvider.d.ts.map +1 -1
- package/dist/src/e2ee/constants.d.ts +2 -0
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/events.d.ts +34 -0
- package/dist/src/e2ee/events.d.ts.map +1 -0
- package/dist/src/e2ee/index.d.ts +1 -0
- package/dist/src/e2ee/index.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +23 -33
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/utils.d.ts +1 -0
- package/dist/src/e2ee/utils.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +18 -13
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts +6 -8
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
- package/dist/src/e2ee/worker/SifGuard.d.ts +11 -0
- package/dist/src/e2ee/worker/SifGuard.d.ts.map +1 -0
- package/dist/src/options.d.ts +5 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/proto/livekit_models_pb.d.ts.map +1 -1
- package/dist/src/proto/livekit_rtc_pb.d.ts.map +1 -1
- package/dist/src/room/DeviceManager.d.ts +1 -0
- package/dist/src/room/DeviceManager.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/defaults.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +1 -0
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +5 -0
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +0 -5
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/timers.d.ts +2 -2
- package/dist/src/room/timers.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts +9 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +3 -3
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +6 -0
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/processor/types.d.ts +14 -2
- package/dist/src/room/track/processor/types.d.ts.map +1 -1
- package/dist/src/room/types.d.ts +1 -1
- package/dist/src/room/types.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -5
- package/dist/ts4.2/src/e2ee/E2eeManager.d.ts +9 -3
- package/dist/ts4.2/src/e2ee/KeyProvider.d.ts +10 -7
- package/dist/ts4.2/src/e2ee/constants.d.ts +2 -0
- package/dist/ts4.2/src/e2ee/events.d.ts +34 -0
- package/dist/ts4.2/src/e2ee/index.d.ts +1 -0
- package/dist/ts4.2/src/e2ee/types.d.ts +23 -33
- package/dist/ts4.2/src/e2ee/utils.d.ts +1 -0
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +18 -13
- package/dist/ts4.2/src/e2ee/worker/ParticipantKeyHandler.d.ts +6 -8
- package/dist/ts4.2/src/e2ee/worker/SifGuard.d.ts +11 -0
- package/dist/ts4.2/src/options.d.ts +5 -0
- package/dist/ts4.2/src/room/DeviceManager.d.ts +1 -0
- package/dist/ts4.2/src/room/Room.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +1 -0
- package/dist/ts4.2/src/room/participant/Participant.d.ts +5 -0
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +0 -5
- package/dist/ts4.2/src/room/timers.d.ts +2 -2
- package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +9 -1
- package/dist/ts4.2/src/room/track/LocalTrack.d.ts +3 -3
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +6 -0
- package/dist/ts4.2/src/room/track/processor/types.d.ts +14 -2
- package/dist/ts4.2/src/room/types.d.ts +1 -1
- package/package.json +15 -16
- package/src/api/SignalClient.ts +13 -9
- package/src/connectionHelper/checks/turn.ts +1 -0
- package/src/connectionHelper/checks/webrtc.ts +9 -7
- package/src/connectionHelper/checks/websocket.ts +1 -0
- package/src/e2ee/E2eeManager.ts +129 -76
- package/src/e2ee/KeyProvider.ts +31 -16
- package/src/e2ee/constants.ts +3 -0
- package/src/e2ee/events.ts +48 -0
- package/src/e2ee/index.ts +1 -0
- package/src/e2ee/types.ts +27 -41
- package/src/e2ee/utils.ts +9 -0
- package/src/e2ee/worker/FrameCryptor.ts +90 -47
- package/src/e2ee/worker/ParticipantKeyHandler.ts +25 -26
- package/src/e2ee/worker/SifGuard.ts +47 -0
- package/src/e2ee/worker/e2ee.worker.ts +75 -68
- package/src/options.ts +6 -0
- package/src/proto/livekit_models_pb.ts +14 -0
- package/src/proto/livekit_rtc_pb.ts +14 -0
- package/src/room/DeviceManager.ts +7 -2
- package/src/room/PCTransport.ts +12 -2
- package/src/room/RTCEngine.ts +3 -2
- package/src/room/Room.ts +47 -22
- package/src/room/defaults.ts +1 -0
- package/src/room/participant/LocalParticipant.ts +18 -2
- package/src/room/participant/Participant.ts +16 -0
- package/src/room/participant/RemoteParticipant.ts +0 -12
- package/src/room/track/LocalAudioTrack.ts +45 -0
- package/src/room/track/LocalTrack.ts +22 -14
- package/src/room/track/LocalVideoTrack.ts +39 -0
- package/src/room/track/RemoteAudioTrack.ts +9 -1
- package/src/room/track/RemoteTrackPublication.ts +2 -2
- package/src/room/track/facingMode.ts +1 -1
- package/src/room/track/processor/types.ts +18 -2
- package/src/room/types.ts +5 -1
@@ -1,17 +1,13 @@
|
|
1
1
|
import { ParticipantInfo, ReconnectReason, Room, SpeakerInfo, VideoLayer } from '../proto/livekit_models_pb';
|
2
2
|
import { AddTrackRequest, ConnectionQualityUpdate, JoinResponse, LeaveRequest, ReconnectResponse, SessionDescription, SignalRequest, SignalTarget, SimulateScenario, StreamStateUpdate, SubscribedQualityUpdate, SubscriptionPermissionUpdate, SubscriptionResponse, SyncState, TrackPermission, TrackPublishedResponse, TrackUnpublishedResponse, UpdateSubscription, UpdateTrackSettings } from '../proto/livekit_rtc_pb';
|
3
3
|
import { AsyncQueue } from '../utils/AsyncQueue';
|
4
|
-
interface ConnectOpts {
|
5
|
-
autoSubscribe: boolean;
|
4
|
+
interface ConnectOpts extends SignalOptions {
|
6
5
|
/** internal */
|
7
6
|
reconnect?: boolean;
|
8
7
|
/** internal */
|
9
8
|
reconnectReason?: number;
|
10
9
|
/** internal */
|
11
10
|
sid?: string;
|
12
|
-
/** @deprecated */
|
13
|
-
publishOnly?: string;
|
14
|
-
adaptiveStream?: boolean;
|
15
11
|
}
|
16
12
|
export interface SignalOptions {
|
17
13
|
autoSubscribe: boolean;
|
@@ -20,6 +16,7 @@ export interface SignalOptions {
|
|
20
16
|
adaptiveStream?: boolean;
|
21
17
|
maxRetries: number;
|
22
18
|
e2eeEnabled: boolean;
|
19
|
+
websocketTimeout: number;
|
23
20
|
}
|
24
21
|
type SignalMessage = SignalRequest['message'];
|
25
22
|
/** @internal */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SignalClient.d.ts","sourceRoot":"","sources":["../../../src/api/SignalClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,eAAe,EACf,eAAe,EACf,IAAI,EACJ,WAAW,EACX,UAAU,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EAEvB,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EAGxB,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,UAAU,
|
1
|
+
{"version":3,"file":"SignalClient.d.ts","sourceRoot":"","sources":["../../../src/api/SignalClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,eAAe,EACf,eAAe,EACf,IAAI,EACJ,WAAW,EACX,UAAU,EACX,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,YAAY,EAGZ,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EAEb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EAEvB,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EAGxB,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,UAAU,EAAE,MAAM,qB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OAAO,CAAC,iBAAiB;CAO1B;AAoBD,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,qBAAqB,GAAG,yBAAyB,GACrD,kBAAkB,CAMpB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/turn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,SAAU,SAAQ,OAAO;IACpC,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/turn.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,SAAU,SAAQ,OAAO;IACpC,IAAI,WAAW,IAAI,MAAM,CAExB;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CA8C/B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"webrtc.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/webrtc.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"webrtc.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/webrtc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,WAAY,SAAQ,OAAO;IACtC,IAAI,WAAW,IAAI,MAAM,CAExB;cAEe,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAyDzC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,cAAe,SAAQ,OAAO;IACzC,IAAI,WAAW,IAAI,MAAM,CAExB;cAEe,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;
|
1
|
+
{"version":3,"file":"websocket.d.ts","sourceRoot":"","sources":["../../../../src/connectionHelper/checks/websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,cAAe,SAAQ,OAAO;IACzC,IAAI,WAAW,IAAI,MAAM,CAExB;cAEe,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBzC"}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import type TypedEventEmitter from 'typed-emitter';
|
2
2
|
import type RTCEngine from '../room/RTCEngine';
|
3
3
|
import type Room from '../room/Room';
|
4
|
-
import type
|
4
|
+
import { type E2EEManagerCallbacks } from './events';
|
5
|
+
import type { E2EEOptions } from './types';
|
5
6
|
declare const E2EEManager_base: new () => TypedEventEmitter<E2EEManagerCallbacks>;
|
6
7
|
/**
|
7
8
|
* @experimental
|
@@ -11,7 +12,6 @@ export declare class E2EEManager extends E2EEManager_base {
|
|
11
12
|
protected room?: Room;
|
12
13
|
private encryptionEnabled;
|
13
14
|
private keyProvider;
|
14
|
-
get isEnabled(): boolean;
|
15
15
|
constructor(options: E2EEOptions);
|
16
16
|
/**
|
17
17
|
* @internal
|
@@ -20,14 +20,20 @@ export declare class E2EEManager extends E2EEManager_base {
|
|
20
20
|
/**
|
21
21
|
* @internal
|
22
22
|
*/
|
23
|
-
setParticipantCryptorEnabled(enabled: boolean,
|
23
|
+
setParticipantCryptorEnabled(enabled: boolean, participantIdentity: string): void;
|
24
|
+
/**
|
25
|
+
* @internal
|
26
|
+
*/
|
27
|
+
setSifTrailer(trailer: Uint8Array): void;
|
24
28
|
private onWorkerMessage;
|
25
29
|
private onWorkerError;
|
26
30
|
setupEngine(engine: RTCEngine): void;
|
27
31
|
private setupEventListeners;
|
28
32
|
private postRatchetRequest;
|
29
33
|
private postKey;
|
34
|
+
private postEnable;
|
30
35
|
private postRTPMap;
|
36
|
+
private postSifTrailer;
|
31
37
|
private setupE2EEReceiver;
|
32
38
|
private setupE2EESender;
|
33
39
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"E2eeManager.d.ts","sourceRoot":"","sources":["../../../src/e2ee/E2eeManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AAUrC,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"E2eeManager.d.ts","sourceRoot":"","sources":["../../../src/e2ee/E2eeManager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AAUrC,OAAO,EAAE,KAAK,oBAAoB,EAAqC,MAAM,UAAU,CAAC;AACxF,OAAO,KAAK,EACV,WAAW,EAYZ,MAAM,SAAS,CAAC;0CAM2C,kBAAkB,oBAAoB,CAAC;AAHnG;;GAEG;AACH,qBAAa,WAAY,SAAQ,gBAAmE;IAClG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAEtB,OAAO,CAAC,iBAAiB,CAAU;IAEnC,OAAO,CAAC,WAAW,CAAkB;gBAEzB,OAAO,EAAE,WAAW;IAOhC;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI;IA0BhB;;OAEG;IACH,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM;IAK1E;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,UAAU;IAQjC,OAAO,CAAC,eAAe,CA+CrB;IAEF,OAAO,CAAC,aAAa,CAGnB;IAEK,WAAW,CAAC,MAAM,EAAE,SAAS;IAMpC,OAAO,CAAC,mBAAmB;IAwD3B,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,eAAe;IAQvB;;;;OAIG;YACW,cAAc;IAiE5B;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAuCrB"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type TypedEventEmitter from 'typed-emitter';
|
2
|
-
import
|
2
|
+
import { type KeyProviderCallbacks } from './events';
|
3
|
+
import type { KeyInfo, KeyProviderOptions } from './types';
|
3
4
|
declare const BaseKeyProvider_base: new () => TypedEventEmitter<KeyProviderCallbacks>;
|
4
5
|
/**
|
5
6
|
* @experimental
|
@@ -11,12 +12,12 @@ export declare class BaseKeyProvider extends BaseKeyProvider_base {
|
|
11
12
|
/**
|
12
13
|
* callback to invoke once a key has been set for a participant
|
13
14
|
* @param key
|
14
|
-
* @param
|
15
|
+
* @param participantIdentity
|
15
16
|
* @param keyIndex
|
16
17
|
*/
|
17
|
-
protected onSetEncryptionKey(key: CryptoKey,
|
18
|
+
protected onSetEncryptionKey(key: CryptoKey, participantIdentity?: string, keyIndex?: number): void;
|
18
19
|
/**
|
19
|
-
* callback being invoked after a ratchet request has been performed on
|
20
|
+
* callback being invoked after a ratchet request has been performed on a participant
|
20
21
|
* that surfaces the new key material.
|
21
22
|
* @param material
|
22
23
|
* @param keyIndex
|
@@ -24,7 +25,7 @@ export declare class BaseKeyProvider extends BaseKeyProvider_base {
|
|
24
25
|
protected onKeyRatcheted: (material: CryptoKey, keyIndex?: number) => void;
|
25
26
|
getKeys(): KeyInfo[];
|
26
27
|
getOptions(): KeyProviderOptions;
|
27
|
-
ratchetKey(
|
28
|
+
ratchetKey(participantIdentity?: string, keyIndex?: number): void;
|
28
29
|
}
|
29
30
|
/**
|
30
31
|
* A basic KeyProvider implementation intended for a single shared
|
@@ -35,10 +36,12 @@ export declare class ExternalE2EEKeyProvider extends BaseKeyProvider {
|
|
35
36
|
ratchetInterval: number | undefined;
|
36
37
|
constructor(options?: Partial<Omit<KeyProviderOptions, 'sharedKey'>>);
|
37
38
|
/**
|
38
|
-
* Accepts a passphrase that's used to create the crypto keys
|
39
|
+
* Accepts a passphrase that's used to create the crypto keys.
|
40
|
+
* When passing in a string, PBKDF2 is used.
|
41
|
+
* When passing in an Array buffer of cryptographically random numbers, HKDF is being used. (recommended)
|
39
42
|
* @param key
|
40
43
|
*/
|
41
|
-
setKey(key: string): Promise<void>;
|
44
|
+
setKey(key: string | ArrayBuffer): Promise<void>;
|
42
45
|
}
|
43
46
|
export {};
|
44
47
|
//# sourceMappingURL=KeyProvider.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"KeyProvider.d.ts","sourceRoot":"","sources":["../../../src/e2ee/KeyProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;
|
1
|
+
{"version":3,"file":"KeyProvider.d.ts","sourceRoot":"","sources":["../../../src/e2ee/KeyProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAE,KAAK,oBAAoB,EAAoB,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;8CAMK,kBAAkB,oBAAoB,CAAC;AAHvG;;GAEG;AACH,qBAAa,eAAgB,SAAQ,oBAAmE;IACtG,OAAO,CAAC,UAAU,CAAuB;IAEzC,OAAO,CAAC,OAAO,CAAqB;gBAExB,OAAO,GAAE,OAAO,CAAC,kBAAkB,CAAM;IAOrD;;;;;OAKG;IACH,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,SAAS,EAAE,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;IAM5F;;;;;OAKG;IACH,SAAS,CAAC,cAAc,aAAc,SAAS,aAAa,MAAM,UAEhE;IAEF,OAAO;IAIP,UAAU;IAIV,UAAU,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;CAG3D;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,eAAe;IAC1D,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;gBAExB,OAAO,GAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAM;IAaxE;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;CAOvC"}
|
@@ -12,4 +12,6 @@ export declare const IV_LENGTH = 12;
|
|
12
12
|
export declare const E2EE_FLAG = "lk_e2ee";
|
13
13
|
export declare const SALT = "LKFrameEncryptionKey";
|
14
14
|
export declare const KEY_PROVIDER_DEFAULTS: KeyProviderOptions;
|
15
|
+
export declare const MAX_SIF_COUNT = 100;
|
16
|
+
export declare const MAX_SIF_DURATION = 2000;
|
15
17
|
//# sourceMappingURL=constants.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/e2ee/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAK9C,eAAO,MAAM,YAAY,KAAK,CAAC;AAG/B,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAY/C,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAIX,eAAO,MAAM,SAAS,KAAK,CAAC;AAG5B,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,eAAO,MAAM,IAAI,yBAAyB,CAAC;AAE3C,eAAO,MAAM,qBAAqB,EAAE,kBAK1B,CAAC"}
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/e2ee/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAK9C,eAAO,MAAM,YAAY,KAAK,CAAC;AAG/B,eAAO,MAAM,4BAA4B,KAAK,CAAC;AAY/C,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAIX,eAAO,MAAM,SAAS,KAAK,CAAC;AAG5B,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,eAAO,MAAM,IAAI,yBAAyB,CAAC;AAE3C,eAAO,MAAM,qBAAqB,EAAE,kBAK1B,CAAC;AAEX,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,gBAAgB,OAAO,CAAC"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type Participant from '../room/participant/Participant';
|
2
|
+
import type { CryptorError } from './errors';
|
3
|
+
import type { KeyInfo } from './types';
|
4
|
+
export declare enum KeyProviderEvent {
|
5
|
+
SetKey = "setKey",
|
6
|
+
RatchetRequest = "ratchetRequest",
|
7
|
+
KeyRatcheted = "keyRatcheted"
|
8
|
+
}
|
9
|
+
export type KeyProviderCallbacks = {
|
10
|
+
[KeyProviderEvent.SetKey]: (keyInfo: KeyInfo) => void;
|
11
|
+
[KeyProviderEvent.RatchetRequest]: (participantIdentity?: string, keyIndex?: number) => void;
|
12
|
+
[KeyProviderEvent.KeyRatcheted]: (material: CryptoKey, keyIndex?: number) => void;
|
13
|
+
};
|
14
|
+
export declare enum KeyHandlerEvent {
|
15
|
+
KeyRatcheted = "keyRatcheted"
|
16
|
+
}
|
17
|
+
export type ParticipantKeyHandlerCallbacks = {
|
18
|
+
[KeyHandlerEvent.KeyRatcheted]: (material: CryptoKey, participantIdentity: string, keyIndex?: number) => void;
|
19
|
+
};
|
20
|
+
export declare enum EncryptionEvent {
|
21
|
+
ParticipantEncryptionStatusChanged = "participantEncryptionStatusChanged",
|
22
|
+
EncryptionError = "encryptionError"
|
23
|
+
}
|
24
|
+
export type E2EEManagerCallbacks = {
|
25
|
+
[EncryptionEvent.ParticipantEncryptionStatusChanged]: (enabled: boolean, participant: Participant) => void;
|
26
|
+
[EncryptionEvent.EncryptionError]: (error: Error) => void;
|
27
|
+
};
|
28
|
+
export type CryptorCallbacks = {
|
29
|
+
[CryptorEvent.Error]: (error: CryptorError) => void;
|
30
|
+
};
|
31
|
+
export declare enum CryptorEvent {
|
32
|
+
Error = "cryptorError"
|
33
|
+
}
|
34
|
+
//# sourceMappingURL=events.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/e2ee/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;CAC9B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7F,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACnF,CAAC;AAEF,oBAAY,eAAe;IACzB,YAAY,iBAAiB;CAC9B;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAC9B,QAAQ,EAAE,SAAS,EACnB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,CAAC,EAAE,MAAM,KACd,IAAI,CAAC;CACX,CAAC;AAEF,oBAAY,eAAe;IACzB,kCAAkC,uCAAuC;IACzE,eAAe,oBAAoB;CACpC;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,eAAe,CAAC,kCAAkC,CAAC,EAAE,CACpD,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,KACrB,IAAI,CAAC;IACV,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CACrD,CAAC;AAEF,oBAAY,YAAY;IACtB,KAAK,iBAAiB;CACvB"}
|
package/dist/src/e2ee/index.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/e2ee/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/e2ee/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
package/dist/src/e2ee/types.d.ts
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import type Participant from '../room/participant/Participant';
|
2
1
|
import type { VideoCodec } from '../room/track/options';
|
3
2
|
import type { BaseKeyProvider } from './KeyProvider';
|
4
|
-
import type { CryptorError } from './errors';
|
5
3
|
export interface BaseMessage {
|
6
4
|
kind: string;
|
7
5
|
data?: unknown;
|
@@ -15,7 +13,8 @@ export interface InitMessage extends BaseMessage {
|
|
15
13
|
export interface SetKeyMessage extends BaseMessage {
|
16
14
|
kind: 'setKey';
|
17
15
|
data: {
|
18
|
-
|
16
|
+
participantIdentity?: string;
|
17
|
+
isPublisher: boolean;
|
19
18
|
key: CryptoKey;
|
20
19
|
keyIndex?: number;
|
21
20
|
};
|
@@ -24,12 +23,19 @@ export interface RTPVideoMapMessage extends BaseMessage {
|
|
24
23
|
kind: 'setRTPMap';
|
25
24
|
data: {
|
26
25
|
map: Map<number, VideoCodec>;
|
26
|
+
participantIdentity: string;
|
27
|
+
};
|
28
|
+
}
|
29
|
+
export interface SifTrailerMessage extends BaseMessage {
|
30
|
+
kind: 'setSifTrailer';
|
31
|
+
data: {
|
32
|
+
trailer: Uint8Array;
|
27
33
|
};
|
28
34
|
}
|
29
35
|
export interface EncodeMessage extends BaseMessage {
|
30
36
|
kind: 'decode' | 'encode';
|
31
37
|
data: {
|
32
|
-
|
38
|
+
participantIdentity: string;
|
33
39
|
readableStream: ReadableStream;
|
34
40
|
writableStream: WritableStream;
|
35
41
|
trackId: string;
|
@@ -39,14 +45,14 @@ export interface EncodeMessage extends BaseMessage {
|
|
39
45
|
export interface RemoveTransformMessage extends BaseMessage {
|
40
46
|
kind: 'removeTransform';
|
41
47
|
data: {
|
42
|
-
|
48
|
+
participantIdentity: string;
|
43
49
|
trackId: string;
|
44
50
|
};
|
45
51
|
}
|
46
52
|
export interface UpdateCodecMessage extends BaseMessage {
|
47
53
|
kind: 'updateCodec';
|
48
54
|
data: {
|
49
|
-
|
55
|
+
participantIdentity: string;
|
50
56
|
trackId: string;
|
51
57
|
codec: VideoCodec;
|
52
58
|
};
|
@@ -54,13 +60,14 @@ export interface UpdateCodecMessage extends BaseMessage {
|
|
54
60
|
export interface RatchetRequestMessage extends BaseMessage {
|
55
61
|
kind: 'ratchetRequest';
|
56
62
|
data: {
|
57
|
-
|
63
|
+
participantIdentity?: string;
|
58
64
|
keyIndex?: number;
|
59
65
|
};
|
60
66
|
}
|
61
67
|
export interface RatchetMessage extends BaseMessage {
|
62
68
|
kind: 'ratchetKey';
|
63
69
|
data: {
|
70
|
+
participantIdentity: string;
|
64
71
|
keyIndex?: number;
|
65
72
|
material: CryptoKey;
|
66
73
|
};
|
@@ -74,11 +81,17 @@ export interface ErrorMessage extends BaseMessage {
|
|
74
81
|
export interface EnableMessage extends BaseMessage {
|
75
82
|
kind: 'enable';
|
76
83
|
data: {
|
77
|
-
|
84
|
+
participantIdentity: string;
|
85
|
+
enabled: boolean;
|
86
|
+
};
|
87
|
+
}
|
88
|
+
export interface InitAck extends BaseMessage {
|
89
|
+
kind: 'initAck';
|
90
|
+
data: {
|
78
91
|
enabled: boolean;
|
79
92
|
};
|
80
93
|
}
|
81
|
-
export type E2EEWorkerMessage = InitMessage | SetKeyMessage | EncodeMessage | ErrorMessage | EnableMessage | RemoveTransformMessage | RTPVideoMapMessage | UpdateCodecMessage | RatchetRequestMessage | RatchetMessage;
|
94
|
+
export type E2EEWorkerMessage = InitMessage | SetKeyMessage | EncodeMessage | ErrorMessage | EnableMessage | RemoveTransformMessage | RTPVideoMapMessage | UpdateCodecMessage | RatchetRequestMessage | RatchetMessage | SifTrailerMessage | InitAck;
|
82
95
|
export type KeySet = {
|
83
96
|
material: CryptoKey;
|
84
97
|
encryptionKey: CryptoKey;
|
@@ -89,32 +102,9 @@ export type KeyProviderOptions = {
|
|
89
102
|
ratchetWindowSize: number;
|
90
103
|
failureTolerance: number;
|
91
104
|
};
|
92
|
-
export type KeyProviderCallbacks = {
|
93
|
-
setKey: (keyInfo: KeyInfo) => void;
|
94
|
-
ratchetRequest: (participantId?: string, keyIndex?: number) => void;
|
95
|
-
/** currently only emitted for local participant */
|
96
|
-
keyRatcheted: (material: CryptoKey, keyIndex?: number) => void;
|
97
|
-
};
|
98
|
-
export type ParticipantKeyHandlerCallbacks = {
|
99
|
-
keyRatcheted: (material: CryptoKey, keyIndex?: number, participantId?: string) => void;
|
100
|
-
};
|
101
|
-
export type E2EEManagerCallbacks = {
|
102
|
-
participantEncryptionStatusChanged: (enabled: boolean, participant?: Participant) => void;
|
103
|
-
encryptionError: (error: Error) => void;
|
104
|
-
};
|
105
|
-
export declare const EncryptionEvent: {
|
106
|
-
readonly ParticipantEncryptionStatusChanged: "participantEncryptionStatusChanged";
|
107
|
-
readonly Error: "encryptionError";
|
108
|
-
};
|
109
|
-
export type CryptorCallbacks = {
|
110
|
-
cryptorError: (error: CryptorError) => void;
|
111
|
-
};
|
112
|
-
export declare const CryptorEvent: {
|
113
|
-
readonly Error: "cryptorError";
|
114
|
-
};
|
115
105
|
export type KeyInfo = {
|
116
106
|
key: CryptoKey;
|
117
|
-
|
107
|
+
participantIdentity?: string;
|
118
108
|
keyIndex?: number;
|
119
109
|
};
|
120
110
|
export type E2EEOptions = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/e2ee/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/e2ee/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,WAAW;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QACJ,kBAAkB,EAAE,kBAAkB,CAAC;KACxC,CAAC;CACH;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE;QACJ,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,WAAW,EAAE,OAAO,CAAC;QACrB,GAAG,EAAE,SAAS,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACH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AC7B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,gBAAgB;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,2BAA2B;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B,CAAC"}
|
package/dist/src/e2ee/utils.d.ts
CHANGED
@@ -6,6 +6,7 @@ export declare function importKey(keyBytes: Uint8Array | ArrayBuffer, algorithm?
|
|
6
6
|
name: string;
|
7
7
|
}, usage?: 'derive' | 'encrypt'): Promise<CryptoKey>;
|
8
8
|
export declare function createKeyMaterialFromString(password: string): Promise<CryptoKey>;
|
9
|
+
export declare function createKeyMaterialFromBuffer(cryptoBuffer: ArrayBuffer): Promise<CryptoKey>;
|
9
10
|
/**
|
10
11
|
* Derives a set of keys from the master key.
|
11
12
|
* See https://tools.ietf.org/html/draft-omara-sframe-00#section-4.3.1
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/e2ee/utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,YAE9B;AAED,wBAAgB,0BAA0B,YAGzC;AAED,wBAAgB,2BAA2B,YAM1C;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,GACjD,KAAK,IAAI,oBAAoB,CAE/B;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,UAAU,GAAG,WAAW,EAClC,SAAS,GAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAmC,EACrE,KAAK,GAAE,QAAQ,GAAG,SAAqB,sBAUxC;AAED,wBAAsB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,sBAcjE;AA0BD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;;;GAiBjE;AAED,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,kCAM1D;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAKrF"}
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/e2ee/utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,eAAe,YAE9B;AAED,wBAAgB,0BAA0B,YAGzC;AAED,wBAAgB,2BAA2B,YAM1C;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,GACjD,KAAK,IAAI,oBAAoB,CAE/B;AAED,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,UAAU,GAAG,WAAW,EAClC,SAAS,GAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAmC,EACrE,KAAK,GAAE,QAAQ,GAAG,SAAqB,sBAUxC;AAED,wBAAsB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,sBAcjE;AAED,wBAAsB,2BAA2B,CAAC,YAAY,EAAE,WAAW,sBAO1E;AA0BD;;;GAGG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM;;;GAiBjE;AAED,wBAAgB,aAAa,IAAI,UAAU,CAE1C;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,kCAM1D;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAKrF"}
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import type TypedEventEmitter from 'typed-emitter';
|
2
2
|
import type { VideoCodec } from '../../room/track/options';
|
3
|
-
import { CryptorCallbacks
|
3
|
+
import { CryptorCallbacks } from '../events';
|
4
|
+
import type { KeyProviderOptions } from '../types';
|
4
5
|
import type { ParticipantKeyHandler } from './ParticipantKeyHandler';
|
6
|
+
export declare const encryptionEnabledMap: Map<string, boolean>;
|
5
7
|
export interface FrameCryptorConstructor {
|
6
8
|
new (opts?: unknown): BaseFrameCryptor;
|
7
9
|
}
|
@@ -13,8 +15,8 @@ export interface TransformerInfo {
|
|
13
15
|
}
|
14
16
|
declare const BaseFrameCryptor_base: new () => TypedEventEmitter<CryptorCallbacks>;
|
15
17
|
export declare class BaseFrameCryptor extends BaseFrameCryptor_base {
|
16
|
-
encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
17
|
-
decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
18
|
+
protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
19
|
+
protected decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<any>;
|
18
20
|
}
|
19
21
|
/**
|
20
22
|
* Cryptor is responsible for en-/decrypting media frames.
|
@@ -22,7 +24,7 @@ export declare class BaseFrameCryptor extends BaseFrameCryptor_base {
|
|
22
24
|
*/
|
23
25
|
export declare class FrameCryptor extends BaseFrameCryptor {
|
24
26
|
private sendCounts;
|
25
|
-
private
|
27
|
+
private participantIdentity;
|
26
28
|
private trackId;
|
27
29
|
private keys;
|
28
30
|
private videoCodec?;
|
@@ -31,12 +33,13 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
31
33
|
/**
|
32
34
|
* used for detecting server injected unencrypted frames
|
33
35
|
*/
|
34
|
-
private
|
36
|
+
private sifTrailer;
|
37
|
+
private sifGuard;
|
35
38
|
constructor(opts: {
|
36
39
|
keys: ParticipantKeyHandler;
|
37
|
-
|
40
|
+
participantIdentity: string;
|
38
41
|
keyProviderOptions: KeyProviderOptions;
|
39
|
-
|
42
|
+
sifTrailer?: Uint8Array;
|
40
43
|
});
|
41
44
|
/**
|
42
45
|
* Assign a different participant to the cryptor.
|
@@ -46,7 +49,8 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
46
49
|
*/
|
47
50
|
setParticipant(id: string, keys: ParticipantKeyHandler): void;
|
48
51
|
unsetParticipant(): void;
|
49
|
-
|
52
|
+
isEnabled(): boolean | undefined;
|
53
|
+
getParticipantIdentity(): string | undefined;
|
50
54
|
getTrackId(): string | undefined;
|
51
55
|
/**
|
52
56
|
* Update the video codec used by the mediaStreamTrack
|
@@ -59,6 +63,7 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
59
63
|
*/
|
60
64
|
setRtpMap(map: Map<number, VideoCodec>): void;
|
61
65
|
setupTransform(operation: 'encode' | 'decode', readable: ReadableStream, writable: WritableStream, trackId: string, codec?: VideoCodec): void;
|
66
|
+
setSifTrailer(trailer: Uint8Array): void;
|
62
67
|
/**
|
63
68
|
* Function that will be injected in a stream and will encrypt the given encoded frames.
|
64
69
|
*
|
@@ -81,19 +86,19 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
81
86
|
* 8) Append a single byte for the key identifier.
|
82
87
|
* 9) Enqueue the encrypted frame for sending.
|
83
88
|
*/
|
84
|
-
encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
89
|
+
protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
85
90
|
/**
|
86
91
|
* Function that will be injected in a stream and will decrypt the given encoded frames.
|
87
92
|
*
|
88
93
|
* @param {RTCEncodedVideoFrame|RTCEncodedAudioFrame} encodedFrame - Encoded video frame.
|
89
94
|
* @param {TransformStreamDefaultController} controller - TransportStreamController.
|
90
95
|
*/
|
91
|
-
decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
96
|
+
protected decodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
92
97
|
/**
|
93
98
|
* Function that will decrypt the given encoded frame. If the decryption fails, it will
|
94
99
|
* ratchet the key for up to RATCHET_WINDOW_SIZE times.
|
95
100
|
*/
|
96
|
-
decryptFrame
|
101
|
+
private decryptFrame;
|
97
102
|
/**
|
98
103
|
* Construct the IV used for AES-GCM and sent (in plain) with the packet similar to
|
99
104
|
* https://tools.ietf.org/html/rfc7714#section-8.1
|
@@ -114,11 +119,11 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
114
119
|
* See also https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams
|
115
120
|
*/
|
116
121
|
private makeIV;
|
117
|
-
getUnencryptedBytes
|
122
|
+
private getUnencryptedBytes;
|
118
123
|
/**
|
119
124
|
* inspects frame payloadtype if available and maps it to the codec specified in rtpMap
|
120
125
|
*/
|
121
|
-
getVideoCodec
|
126
|
+
private getVideoCodec;
|
122
127
|
}
|
123
128
|
/**
|
124
129
|
* Slice the NALUs present in the supplied buffer, assuming it is already byte-aligned
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FrameCryptor.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/FrameCryptor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,
|
1
|
+
{"version":3,"file":"FrameCryptor.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/FrameCryptor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAgB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAwB,kBAAkB,EAAU,MAAM,UAAU,CAAC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A4B;IAC5B,GAAG,IAAI;IACP,4BAA4B;IAC5B,GAAG,IAAI;IACP,sBAAsB;IACtB,OAAO,KAAK;IACZ,oBAAoB;IACpB,UAAU,KAAK;IACf,kBAAkB;IAClB,WAAW,KAAK;IAChB,uCAAuC;IACvC,OAAO,KAAK;IACZ,sBAAsB;IACtB,WAAW,KAAK;IAChB,oCAAoC;IACpC,UAAU,KAAK;IACf,0BAA0B;IAC1B,GAAG,KAAK;IAIR,qEAAqE;IACrE,SAAS,KAAK;IACd,4BAA4B;IAC5B,SAAS,KAAK;IACd,0FAA0F;IAC1F,eAAe,KAAK;CAGrB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,GAAG,OAAO,CAQ/F"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type TypedEventEmitter from 'typed-emitter';
|
2
|
-
import
|
2
|
+
import { type ParticipantKeyHandlerCallbacks } from '../events';
|
3
|
+
import type { KeyProviderOptions, KeySet } from '../types';
|
3
4
|
declare const ParticipantKeyHandler_base: new () => TypedEventEmitter<ParticipantKeyHandlerCallbacks>;
|
4
5
|
/**
|
5
6
|
* ParticipantKeyHandler is responsible for providing a cryptor instance with the
|
@@ -12,15 +13,13 @@ declare const ParticipantKeyHandler_base: new () => TypedEventEmitter<Participan
|
|
12
13
|
export declare class ParticipantKeyHandler extends ParticipantKeyHandler_base {
|
13
14
|
private currentKeyIndex;
|
14
15
|
private cryptoKeyRing;
|
15
|
-
private enabled;
|
16
16
|
private keyProviderOptions;
|
17
17
|
private ratchetPromiseMap;
|
18
|
-
private
|
18
|
+
private participantIdentity;
|
19
19
|
private decryptionFailureCount;
|
20
20
|
private _hasValidKey;
|
21
21
|
get hasValidKey(): boolean;
|
22
|
-
constructor(
|
23
|
-
setEnabled(enabled: boolean): void;
|
22
|
+
constructor(participantIdentity: string, keyProviderOptions: KeyProviderOptions);
|
24
23
|
decryptionFailure(): void;
|
25
24
|
decryptionSuccess(): void;
|
26
25
|
/**
|
@@ -50,16 +49,15 @@ export declare class ParticipantKeyHandler extends ParticipantKeyHandler_base {
|
|
50
49
|
* also updates the currentKeyIndex
|
51
50
|
*/
|
52
51
|
setKeyFromMaterial(material: CryptoKey, keyIndex?: number, emitRatchetEvent?: boolean): Promise<void>;
|
53
|
-
setKeySet(keySet: KeySet, keyIndex: number, emitRatchetEvent?: boolean):
|
52
|
+
setKeySet(keySet: KeySet, keyIndex: number, emitRatchetEvent?: boolean): void;
|
54
53
|
setCurrentKeyIndex(index: number): Promise<void>;
|
55
|
-
isEnabled(): boolean;
|
56
54
|
getCurrentKeyIndex(): number;
|
57
55
|
/**
|
58
56
|
* returns currently used KeySet or the one at `keyIndex` if provided
|
59
57
|
* @param keyIndex
|
60
58
|
* @returns
|
61
59
|
*/
|
62
|
-
getKeySet(keyIndex?: number): KeySet;
|
60
|
+
getKeySet(keyIndex?: number): KeySet | undefined;
|
63
61
|
}
|
64
62
|
export {};
|
65
63
|
//# sourceMappingURL=ParticipantKeyHandler.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ParticipantKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/ParticipantKeyHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"ParticipantKeyHandler.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/ParticipantKeyHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,eAAe,CAAC;AAGnD,OAAO,EAAmB,KAAK,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;oDAcW,kBAAkB,8BAA8B,CAAC;AARvH;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,0BAA6E;IACtH,OAAO,CAAC,eAAe,CAAS;IAEhC,OAAO,CAAC,aAAa,CAA4B;IAEjD,OAAO,CAAC,kBAAkB,CAAqB;IAE/C,OAAO,CAAC,iBAAiB,CAAkC;IAE3D,OAAO,CAAC,mBAAmB,CAAS;IAEpC,OAAO,CAAC,sBAAsB,CAAK;IAEnC,OAAO,CAAC,YAAY,CAAiB;IAErC,IAAI,WAAW,YAEd;gBAEW,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB;IAU/E,iBAAiB;IAYjB,iBAAiB;IAIjB;;;OAGG;IACH,cAAc;IAKd;;;;;;OAMG;IACH,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,CAAC,SAAS,CAAC;IA0ChE;;;;;OAKG;IACG,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,SAAI;IAK9C;;;;;OAKG;IACG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,SAAI,EAAE,gBAAgB,UAAQ;IASpF,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,UAAQ;IAQ9D,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAKtC,kBAAkB;IAIlB;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM;CAG5B"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export declare class SifGuard {
|
2
|
+
private consecutiveSifCount;
|
3
|
+
private sifSequenceStartedAt;
|
4
|
+
private lastSifReceivedAt;
|
5
|
+
private userFramesSinceSif;
|
6
|
+
recordSif(): void;
|
7
|
+
recordUserFrame(): void;
|
8
|
+
isSifAllowed(): boolean;
|
9
|
+
reset(): void;
|
10
|
+
}
|
11
|
+
//# sourceMappingURL=SifGuard.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SifGuard.d.ts","sourceRoot":"","sources":["../../../../src/e2ee/worker/SifGuard.ts"],"names":[],"mappings":"AAEA,qBAAa,QAAQ;IACnB,OAAO,CAAC,mBAAmB,CAAK;IAEhC,OAAO,CAAC,oBAAoB,CAAqB;IAEjD,OAAO,CAAC,iBAAiB,CAAa;IAEtC,OAAO,CAAC,kBAAkB,CAAa;IAEvC,SAAS;IAMT,eAAe;IAgBf,YAAY;IAQZ,KAAK;CAKN"}
|
package/dist/src/options.d.ts
CHANGED
@@ -23,6 +23,9 @@ export interface InternalRoomOptions {
|
|
23
23
|
* enable Dynacast, off by default. With Dynacast dynamically pauses
|
24
24
|
* video layers that are not being consumed by any subscribers, significantly
|
25
25
|
* reducing publishing CPU and bandwidth usage.
|
26
|
+
*
|
27
|
+
* Dynacast will be enabled if SVC codecs (VP9/AV1) are used. Multi-codec simulcast
|
28
|
+
* requires dynacast
|
26
29
|
*/
|
27
30
|
dynacast: boolean;
|
28
31
|
/**
|
@@ -95,6 +98,8 @@ export interface InternalRoomConnectOptions {
|
|
95
98
|
publishOnly?: string;
|
96
99
|
/** specifies how often an initial join connection is allowed to retry (only applicable if server is not reachable) */
|
97
100
|
maxRetries: number;
|
101
|
+
/** amount of time for Websocket connection to be established, defaults to 15s */
|
102
|
+
websocketTimeout: number;
|
98
103
|
}
|
99
104
|
/**
|
100
105
|
* Options for Room.connect()
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;G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