summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-18 15:16:28 +0100
committerErik Johnston <erik@matrix.org>2015-08-18 15:17:47 +0100
commitee59af9ac0ede0efe97cb70edbe6ed9e21ff8db4 (patch)
treecf98058c8cbc5b92b3fe01d2dc61c0daa2c3b45d /synapse/api/auth.py
parentTypo (diff)
downloadsynapse-ee59af9ac0ede0efe97cb70edbe6ed9e21ff8db4.tar.xz
Set request.authenticated_entity for application services
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index a7f428a96c..1e3b0fbfb7 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -352,6 +352,8 @@ class Auth(object):
                 if not user_id:
                     raise KeyError
 
+                request.authenticated_entity = user_id
+
                 defer.returnValue(
                     (UserID.from_string(user_id), ClientInfo("", ""))
                 )
@@ -425,6 +427,7 @@ class Auth(object):
                     "Unrecognised access token.",
                     errcode=Codes.UNKNOWN_TOKEN
                 )
+            request.authenticated_entity = service.sender
             defer.returnValue(service)
         except KeyError:
             raise AuthError(