mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:44:49 -04:00
Run Black. (#5482)
This commit is contained in:
parent
7dcf984075
commit
32e7c9e7f2
376 changed files with 9142 additions and 10388 deletions
|
@ -34,8 +34,7 @@ class VoipRestServlet(RestServlet):
|
|||
@defer.inlineCallbacks
|
||||
def on_GET(self, request):
|
||||
requester = yield self.auth.get_user_by_req(
|
||||
request,
|
||||
self.hs.config.turn_allow_guests
|
||||
request, self.hs.config.turn_allow_guests
|
||||
)
|
||||
|
||||
turnUris = self.hs.config.turn_uris
|
||||
|
@ -49,9 +48,7 @@ class VoipRestServlet(RestServlet):
|
|||
username = "%d:%s" % (expiry, requester.user.to_string())
|
||||
|
||||
mac = hmac.new(
|
||||
turnSecret.encode(),
|
||||
msg=username.encode(),
|
||||
digestmod=hashlib.sha1
|
||||
turnSecret.encode(), msg=username.encode(), digestmod=hashlib.sha1
|
||||
)
|
||||
# We need to use standard padded base64 encoding here
|
||||
# encode_base64 because we need to add the standard padding to get the
|
||||
|
@ -65,12 +62,17 @@ class VoipRestServlet(RestServlet):
|
|||
else:
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
defer.returnValue((200, {
|
||||
'username': username,
|
||||
'password': password,
|
||||
'ttl': userLifetime / 1000,
|
||||
'uris': turnUris,
|
||||
}))
|
||||
defer.returnValue(
|
||||
(
|
||||
200,
|
||||
{
|
||||
"username": username,
|
||||
"password": password,
|
||||
"ttl": userLifetime / 1000,
|
||||
"uris": turnUris,
|
||||
},
|
||||
)
|
||||
)
|
||||
|
||||
def on_OPTIONS(self, request):
|
||||
return (200, {})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue