diff options
author | Jorik Schellekens <joriks@matrix.org> | 2019-07-16 18:43:11 +0100 |
---|---|---|
committer | Jorik Schellekens <joriks@matrix.org> | 2019-07-23 16:06:33 +0100 |
commit | 4824e30810729712a80968bb1a1b5044b0dad1c1 (patch) | |
tree | 648950a434a994c41c95cbaf6d05d8162102f3ac /synapse/api/auth.py | |
parent | Better args wrapper (diff) | |
download | synapse-4824e30810729712a80968bb1a1b5044b0dad1c1.tar.xz |
Add user _id
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r-- | synapse/api/auth.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 351790cca4..39882bc30a 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -22,6 +22,7 @@ from netaddr import IPAddress from twisted.internet import defer +import synapse.logging.opentracing as opentracing import synapse.types from synapse import event_auth from synapse.api.constants import EventTypes, JoinRules, Membership @@ -209,6 +210,10 @@ class Auth(object): user_id, app_service = yield self._get_appservice_user_id(request) if user_id: request.authenticated_entity = user_id + opentracing.set_tag("authenticated_entity", user_id) + # there is at least one other place where authenticated entity is + # set. user_id is tagged incase authenticated_entity is clobbered + opentracing.set_tag("user_id", user_id) if ip_addr and self.hs.config.track_appservice_user_ips: yield self.store.insert_client_ip( @@ -260,6 +265,11 @@ class Auth(object): request.authenticated_entity = user.to_string() + opentracing.set_tag("authenticated_entity", user.to_string()) + # there is at least one other place where authenticated entity is + # set. user_id is tagged incase authenticated_entity is clobbered + opentracing.set_tag("user_id", user.to_string()) + return synapse.types.create_requester( user, token_id, is_guest, device_id, app_service=app_service ) |