Browse Source

Verify room name using regex in JWT

j8
Andrei Bora 4 years ago
parent
commit
572b99b208
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      resources/prosody-plugins/token/util.lib.lua

+ 11
- 2
resources/prosody-plugins/token/util.lib.lua View File

@@ -370,8 +370,17 @@ function Util:verify_room(session, room_address)
370 370
             room_to_check = room_node;
371 371
         end
372 372
     else
373
-        -- no wildcard, so check room against authorized room in token
374
-        room_to_check = auth_room;
373
+        -- no wildcard, so check room against authorized room regex from the token
374
+        if target_room ~= nil then
375
+            -- room with subdomain
376
+            room_to_check = target_room:match(auth_room);
377
+        else
378
+            room_to_check = room_node:match(auth_room);
379
+        end
380
+        module:log("debug", "room to check: %s", room_to_check)
381
+        if not room_to_check then
382
+            return false
383
+        end
375 384
     end
376 385
 
377 386
     local auth_domain = session.jitsi_meet_domain;

Loading…
Cancel
Save