Skip to content

Commit d123675

Browse files
feat: auto create rooms for tokens with the RoomCreate grant (livekit#4320)
This patch updates the check for auto creating rooms to also consider the RoomCreate grant per token instead of just the global config option. With this patch, applications can decide on their own whether users or which users can auto create rooms. This allows applications that rely on auto creation (saving an API call) to co-exist with those who might want to mint tokens for subscribe-only users. Specifically LaSuite Meet relies on the auto create behavior, however enabling the global config option would make a MatrixRTC deployment vulnerable to abuse, as users on remote homeservers get tokens in order to subscribe.
1 parent 7a3e595 commit d123675

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/service/roomallocator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func (r *StandardRoomAllocator) SelectRoomNode(ctx context.Context, roomName liv
174174

175175
func (r *StandardRoomAllocator) ValidateCreateRoom(ctx context.Context, roomName livekit.RoomName) error {
176176
// when auto create is disabled, we'll check to ensure it's already created
177-
if !r.config.Room.AutoCreate {
177+
if !r.config.Room.AutoCreate && EnsureCreatePermission(ctx) != nil {
178178
_, _, err := r.roomStore.LoadRoom(ctx, roomName, false)
179179
if err != nil {
180180
return err

0 commit comments

Comments
 (0)