summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-18 16:30:11 +0100
committerErik Johnston <erik@matrix.org>2015-08-18 16:30:11 +0100
commitc3dd2ecd5ed8b6a1d17da7ea604111f828b2c36b (patch)
treec260334c503ced59118c492f5aebe8e2f610e272
parentMerge pull request #227 from matrix-org/erikj/receipts_take2 (diff)
parentSet request.authenticated_entity for application services (diff)
downloadsynapse-c3dd2ecd5ed8b6a1d17da7ea604111f828b2c36b.tar.xz
Merge pull request #230 from matrix-org/erikj/appservice_auth_entity
Set request.authenticated_entity for application services
-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(