MCPcopy Create free account
hub / github.com/Syncplay/syncplay / check

Method check

syncplay/utils.py:516–527  ·  view source on GitHub ↗
(roomName, password, salt)

Source from the content-addressed store, hash-verified

514
515 @staticmethod
516 def check(roomName, password, salt):
517 if not password or not re.match(RoomPasswordProvider.PASSWORD_REGEX, password):
518 raise ValueError()
519
520 if not roomName:
521 raise NotControlledRoom()
522 match = re.match(RoomPasswordProvider.CONTROLLED_ROOM_REGEX, roomName)
523 if not match:
524 raise NotControlledRoom()
525 roomHash = match.group(2)
526 computedHash = RoomPasswordProvider._computeRoomHash(match.group(1), password, salt)
527 return roomHash == computedHash
528
529 @staticmethod
530 def getControlledRoomName(roomName, password, salt):

Callers 1

authRoomControllerMethod · 0.80

Calls 2

NotControlledRoomClass · 0.85
_computeRoomHashMethod · 0.80

Tested by

no test coverage detected