Skip to content
Snippets Groups Projects
Commit c3dd2ecd authored by Erik Johnston's avatar Erik Johnston
Browse files

Merge pull request #230 from matrix-org/erikj/appservice_auth_entity

Set request.authenticated_entity for application services
parents 38a965b8 ee59af9a
No related branches found
No related tags found
No related merge requests found
...@@ -352,6 +352,8 @@ class Auth(object): ...@@ -352,6 +352,8 @@ class Auth(object):
if not user_id: if not user_id:
raise KeyError raise KeyError
request.authenticated_entity = user_id
defer.returnValue( defer.returnValue(
(UserID.from_string(user_id), ClientInfo("", "")) (UserID.from_string(user_id), ClientInfo("", ""))
) )
...@@ -425,6 +427,7 @@ class Auth(object): ...@@ -425,6 +427,7 @@ class Auth(object):
"Unrecognised access token.", "Unrecognised access token.",
errcode=Codes.UNKNOWN_TOKEN errcode=Codes.UNKNOWN_TOKEN
) )
request.authenticated_entity = service.sender
defer.returnValue(service) defer.returnValue(service)
except KeyError: except KeyError:
raise AuthError( raise AuthError(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment