summary refs log tree commit diff
path: root/synapse/rest/client/v1/voip.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-06-26 22:34:41 +0100
committerRichard van der Hoff <richard@matrix.org>2019-06-26 22:34:41 +0100
commita4daa899ec4cd195fc10936f68df5c78314b366c (patch)
tree35e88ff388b0f7652773a79930b732aa04f16bde /synapse/rest/client/v1/voip.py
parentchangelog (diff)
parentImprove docs on choosing server_name (#5558) (diff)
downloadsynapse-a4daa899ec4cd195fc10936f68df5c78314b366c.tar.xz
Merge branch 'develop' into rav/saml2_client
Diffstat (limited to 'synapse/rest/client/v1/voip.py')
-rw-r--r--synapse/rest/client/v1/voip.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/synapse/rest/client/v1/voip.py b/synapse/rest/client/v1/voip.py
index 6381049210..41b3171ac8 100644
--- a/synapse/rest/client/v1/voip.py
+++ b/synapse/rest/client/v1/voip.py
@@ -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, {})