summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-10-11 11:20:54 +0100
committerGitHub <noreply@github.com>2016-10-11 11:20:54 +0100
commita2f2516199dc0c4bb94b26a870da0d6531d57723 (patch)
tree3f4ad96f70e2ad39e8881d9f65e0380b547d3582 /synapse/api/auth.py
parentMerge pull request #1150 from Rugvip/state_key (diff)
parentrest/client/v1/register: use the correct requester in createUser (diff)
downloadsynapse-a2f2516199dc0c4bb94b26a870da0d6531d57723.tar.xz
Merge pull request #1157 from Rugvip/nolimit
Remove rate limiting from app service senders and fix get_or_create_user requester
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index b994f07de4..1b3b55d517 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -653,7 +653,7 @@ class Auth(object):
 
     @defer.inlineCallbacks
     def _get_appservice_user_id(self, request):
-        app_service = yield self.store.get_app_service_by_token(
+        app_service = self.store.get_app_service_by_token(
             get_access_token_from_request(
                 request, self.TOKEN_NOT_FOUND_HTTP_STATUS
             )
@@ -855,13 +855,12 @@ class Auth(object):
         }
         defer.returnValue(user_info)
 
-    @defer.inlineCallbacks
     def get_appservice_by_req(self, request):
         try:
             token = get_access_token_from_request(
                 request, self.TOKEN_NOT_FOUND_HTTP_STATUS
             )
-            service = yield self.store.get_app_service_by_token(token)
+            service = self.store.get_app_service_by_token(token)
             if not service:
                 logger.warn("Unrecognised appservice access token: %s" % (token,))
                 raise AuthError(
@@ -870,7 +869,7 @@ class Auth(object):
                     errcode=Codes.UNKNOWN_TOKEN
                 )
             request.authenticated_entity = service.sender
-            defer.returnValue(service)
+            return defer.succeed(service)
         except KeyError:
             raise AuthError(
                 self.TOKEN_NOT_FOUND_HTTP_STATUS, "Missing access token."