diff options
author | Patrik Oldsberg <patrik.oldsberg@ericsson.com> | 2016-10-06 10:43:32 +0200 |
---|---|---|
committer | Patrik Oldsberg <patrik.oldsberg@ericsson.com> | 2016-10-06 15:24:59 +0200 |
commit | 9bfc61779111624e972939491a0b5c02190d3463 (patch) | |
tree | 303e11feba4c129b17b65bcb7384ee44296d0fc2 /synapse/api | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-9bfc61779111624e972939491a0b5c02190d3463.tar.xz |
storage/appservice: make appservice methods only relying on the cache synchronous
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/auth.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index e75fd518be..27599124d2 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." |