summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 16:19:23 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2016-08-18 16:19:23 +0100
commit105ff162d4ae3776674cb1cbec6581e1511871d2 (patch)
treef4b8e6f5eb3a05548402cef07dc29f6f0d949a50 /synapse/rest
parentCopypasta the 3PU support code to also do 3PL (diff)
downloadsynapse-105ff162d4ae3776674cb1cbec6581e1511871d2.tar.xz
Authenticate 3PE lookup requests
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v2_alpha/thirdparty.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/rest/client/v2_alpha/thirdparty.py b/synapse/rest/client/v2_alpha/thirdparty.py
index eec08425e6..d229e4b818 100644
--- a/synapse/rest/client/v2_alpha/thirdparty.py
+++ b/synapse/rest/client/v2_alpha/thirdparty.py
@@ -31,10 +31,13 @@ class ThirdPartyUserServlet(RestServlet):
     def __init__(self, hs):
         super(ThirdPartyUserServlet, self).__init__()
 
+        self.auth = hs.get_auth()
         self.appservice_handler = hs.get_application_service_handler()
 
     @defer.inlineCallbacks
     def on_GET(self, request, protocol):
+        yield self.auth.get_user_by_req(request)
+
         fields = request.args
         del fields["access_token"]
 
@@ -50,10 +53,13 @@ class ThirdPartyLocationServlet(RestServlet):
     def __init__(self, hs):
         super(ThirdPartyLocationServlet, self).__init__()
 
+        self.auth = hs.get_auth()
         self.appservice_handler = hs.get_application_service_handler()
 
     @defer.inlineCallbacks
     def on_GET(self, request, protocol):
+        yield self.auth.get_user_by_req(request)
+
         fields = request.args
         del fields["access_token"]