MSC4195: MatrixRTC Transport using LiveKit Backend#4195
MSC4195: MatrixRTC Transport using LiveKit Backend#4195hughns wants to merge 24 commits intomatrix-org:mainfrom
Conversation
054a23c to
6072744
Compare
proposals/4195-matrixrtc-livekit.md
Outdated
|
|
||
| The homeserver restriction could be applied by checking the `matrix_server_name` field of the OpenID token before validating the token. | ||
|
|
||
| The `room_id` could be validated too, and checking that the Matrix user from the OpenID token is a member of the room. |
There was a problem hiding this comment.
From my understanding there's no API that allows room_id validation. Without that implementing access control in a federated environment seems infeasible however.
Given that all members in a session use one SFU via oldest_membership, just validating against matrix_server_name (authenticated using TLS / OpenID) would require allowlisting any server that users might want to join from.
Ideally access control could check either for an allowlisted server or for an existing session with the oldest member being on an allowlisted server, gating an SFU to sessions being started by their "own" users.
There was a problem hiding this comment.
The implementation in element-hq/lk-jwt-service#67 does allow limiting creation of new SFU rooms based on servers in a given allowlist, but still allows arbitrary users to join
There was a problem hiding this comment.
With the context provided in element-hq/synapse#18967, I believe we can do better by not using ID tokens or a lk-jwt-service altogether.
Instead of a client authenticating against all remote SFUs using an ID token, an extended /transports Client-Server API can return matching credentials, obtained by the user's homeserver over federation. This removes the need for the somewhat bespoke ID token mechanism (which needs to do server name lookup over HTTP and DNS as a fallback. By design that also doesn't play nicely with MAS and OIDC native Matrix), reusing existing server to server authentication. Crucially, this allows for proper per-room tokens.
…seudonymous `livekit_alias` Derivation"
…urity considerations
| End-to-end encryption is mapped into the LiveKit frame level encryption mechanism described | ||
| [here](https://github.com/livekit/livekit/issues/1035). | ||
|
|
||
| Where a shared password is used by the application it is used as the `string` input to the LiveKit | ||
| key derivation function (which uses PBKDF2) and all participants use the same derived key for | ||
| encryption and decryption. | ||
|
|
||
| Where a per-participant key is used it is imported as the byte array input to the LiveKit key | ||
| derivation function (which uses HKDF). The `index` field of the `m.rtc.encryption_keys` event is | ||
| used as the key index for the key provider. | ||
|
|
||
| On receipt of the `m.rtc.encryption_keys` event the application can associate the received key with | ||
| the LiveKit participant identity by calculating the pseudonymous LiveKit participant identity as | ||
| described above. |
There was a problem hiding this comment.
I would like more details on how to implement this.
I've been trying to get it to work in matrix-jukebox, but had no success in getting compatibility with Element Call.
(I'm implementing the old version of the spec without slots and multiSFU for now)
| encryption and decryption. | ||
|
|
||
| Where a per-participant key is used it is imported as the byte array input to the LiveKit key | ||
| derivation function (which uses HKDF). The `index` field of the `m.rtc.encryption_keys` event is |
There was a problem hiding this comment.
It seems like multiple LiveKit SDKs (Rust, Flutter) only support using PBKDF2, so using HKDF here is going to limit compatibility with non-web based clients out of the box
There was a problem hiding this comment.
This also affects the SDKs using Rust-FFI (like python and maybe others)
|
This is blocked on MSC4143's block: #4143 (comment) |
Rendered
Implementation
Dependencies:
To-do:
POST /get_token