mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:44:49 -04:00
Fix pep8 warnings
This commit is contained in:
parent
b4b492824e
commit
7d709542ca
35 changed files with 179 additions and 135 deletions
|
@ -34,23 +34,23 @@ class VoipRestServlet(RestServlet):
|
|||
turnSecret = self.hs.config.turn_shared_secret
|
||||
userLifetime = self.hs.config.turn_user_lifetime
|
||||
if not turnUris or not turnSecret or not userLifetime:
|
||||
defer.returnValue( (200, {}) )
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
expiry = (self.hs.get_clock().time_msec() + userLifetime) / 1000
|
||||
username = "%d:%s" % (expiry, auth_user.to_string())
|
||||
|
||||
|
||||
mac = hmac.new(turnSecret, msg=username, digestmod=hashlib.sha1)
|
||||
# We need to use standard base64 encoding here, *not* syutil's encode_base64
|
||||
# because we need to add the standard padding to get the same result as the
|
||||
# TURN server.
|
||||
# We need to use standard base64 encoding here, *not* syutil's
|
||||
# encode_base64 because we need to add the standard padding to get the
|
||||
# same result as the TURN server.
|
||||
password = base64.b64encode(mac.digest())
|
||||
|
||||
defer.returnValue( (200, {
|
||||
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