Compare commits

...

6 Commits

Author SHA1 Message Date
Hugh Nimmo-Smith
3e440c3805 Fix yarn.lock 2024-08-12 17:22:45 +01:00
Hugh Nimmo-Smith
b893c5f951 Extra logging 2024-08-12 17:21:42 +01:00
Hugh Nimmo-Smith
14394cef69 Bump js-sdk 2024-08-12 17:21:42 +01:00
Hugh Nimmo-Smith
8ac28d2f2e Lint 2024-08-12 17:21:40 +01:00
Hugh Nimmo-Smith
1b3e0149a1 Bump js-sdk 2024-08-12 17:21:40 +01:00
Hugh Nimmo-Smith
5820cbc152 Use updated js-sdk containing encryption key enhancements 2024-08-12 17:21:14 +01:00
3 changed files with 15 additions and 5 deletions

View File

@@ -62,7 +62,7 @@
"i18next-http-backend": "^2.0.0",
"livekit-client": "^2.0.2",
"lodash": "^4.17.21",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#9176d3a671114be97ee7a42155a6d40a233384f1",
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#755f83039a2f2e0d3fcf7dbd116bb9ac45a3b49d",
"matrix-widget-api": "^1.8.2",
"normalize.css": "^8.0.1",
"observable-hooks": "^4.2.3",

View File

@@ -15,12 +15,15 @@ limitations under the License.
*/
import { BaseKeyProvider, createKeyMaterialFromBuffer } from "livekit-client";
import { logger } from "matrix-js-sdk/src/logger";
import { encodeUnpaddedBase64 } from "matrix-js-sdk";
import { logger as parentLogger } from "matrix-js-sdk/src/logger";
import {
MatrixRTCSession,
MatrixRTCSessionEvent,
} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
const logger = parentLogger.getChild("MatrixKeyProvider");
export class MatrixKeyProvider extends BaseKeyProvider {
private rtcSession?: MatrixRTCSession;
@@ -29,6 +32,9 @@ export class MatrixKeyProvider extends BaseKeyProvider {
}
public setRTCSession(rtcSession: MatrixRTCSession): void {
logger.debug(
`Setting new RTC session for key provider: this.rtcSession=${!!this.rtcSession}`,
);
if (this.rtcSession) {
this.rtcSession.off(
MatrixRTCSessionEvent.EncryptionKeyChanged,
@@ -60,6 +66,10 @@ export class MatrixKeyProvider extends BaseKeyProvider {
encryptionKeyIndex: number,
participantId: string,
): Promise<void> => {
logger.debug(
`Will send key to livekit room=${this.rtcSession?.room.roomId} participantId=${participantId} encryptionKeyIndex=${encryptionKeyIndex}: ${encodeUnpaddedBase64(encryptionKey)}`,
);
this.onSetEncryptionKey(
await createKeyMaterialFromBuffer(encryptionKey),
participantId,
@@ -67,7 +77,7 @@ export class MatrixKeyProvider extends BaseKeyProvider {
);
logger.debug(
`Sent new key to livekit room=${this.rtcSession?.room.roomId} participantId=${participantId} encryptionKeyIndex=${encryptionKeyIndex}`,
`Sent new key to livekit room=${this.rtcSession?.room.roomId} participantId=${participantId} encryptionKeyIndex=${encryptionKeyIndex}: ${encodeUnpaddedBase64(encryptionKey)}`,
);
};
}

View File

@@ -6643,9 +6643,9 @@ matrix-events-sdk@0.0.1:
resolved "https://registry.yarnpkg.com/matrix-events-sdk/-/matrix-events-sdk-0.0.1.tgz#c8c38911e2cb29023b0bbac8d6f32e0de2c957dd"
integrity sha512-1QEOsXO+bhyCroIe2/A5OwaxHvBm7EsSQ46DEDn8RBIfQwN5HWBpFvyWWR4QY0KHPPnnJdI99wgRiAl7Ad5qaA==
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#9176d3a671114be97ee7a42155a6d40a233384f1":
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#755f83039a2f2e0d3fcf7dbd116bb9ac45a3b49d":
version "34.2.0"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/9176d3a671114be97ee7a42155a6d40a233384f1"
resolved "https://codeload.github.com/matrix-org/matrix-js-sdk/tar.gz/755f83039a2f2e0d3fcf7dbd116bb9ac45a3b49d"
dependencies:
"@babel/runtime" "^7.12.5"
"@matrix-org/matrix-sdk-crypto-wasm" "^7.0.0"