Преглед на файлове

lowercase to fix tokens with uppercase letters (e.g., slack JWTs)

j8
Scott Boone преди 4 години
родител
ревизия
e6242f5bc7
променени са 1 файла, в които са добавени 5 реда и са изтрити 6 реда
  1. 5
    6
      resources/prosody-plugins/token/util.lib.lua

+ 5
- 6
resources/prosody-plugins/token/util.lib.lua Целия файл

@@ -337,11 +337,11 @@ function Util:verify_room(session, room_address)
337 337
         return true;
338 338
     end
339 339
 
340
-    local auth_room = session.jitsi_meet_room;
340
+    local auth_room = string.lower(session.jitsi_meet_room);
341 341
     if not self.enableDomainVerification then
342 342
         -- if auth_room is missing, this means user is anonymous (no token for
343 343
         -- its domain) we let it through, jicofo is verifying creation domain
344
-        if auth_room and room ~= string.lower(auth_room) and auth_room ~= '*' then
344
+        if auth_room and room ~= auth_room and auth_room ~= '*' then
345 345
             return false;
346 346
         end
347 347
 
@@ -383,7 +383,7 @@ function Util:verify_room(session, room_address)
383 383
         end
384 384
     end
385 385
 
386
-    local auth_domain = session.jitsi_meet_domain;
386
+    local auth_domain = string.lower(session.jitsi_meet_domain);
387 387
     local subdomain_to_check;
388 388
     if target_subdomain then
389 389
         if auth_domain == '*' then
@@ -401,7 +401,7 @@ function Util:verify_room(session, room_address)
401 401
         end
402 402
 
403 403
         return room_address_to_verify == jid.join(
404
-            "["..string.lower(subdomain_to_check).."]"..string.lower(room_to_check), self.muc_domain);
404
+            "["..subdomain_to_check).."]"..room_to_check, self.muc_domain);
405 405
     else
406 406
         if auth_domain == '*' then
407 407
             -- check for wildcard in JWT claim, allow access if found
@@ -412,8 +412,7 @@ function Util:verify_room(session, room_address)
412 412
         end
413 413
         -- we do not have a domain part (multidomain is not enabled)
414 414
         -- verify with info from the token
415
-        return room_address_to_verify == jid.join(
416
-            string.lower(room_to_check), string.lower(subdomain_to_check));
415
+        return room_address_to_verify == jid.join(room_to_check, subdomain_to_check);
417 416
     end
418 417
 end
419 418
 

Loading…
Отказ
Запис