summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-08 14:36:09 +0100
committerErik Johnston <erik@matrix.org>2016-06-08 14:36:09 +0100
commit958c968d028c38586f6b7eed8ee9c24c15e8c6e6 (patch)
treecb8de50d77634632410accd7db6039bf0348b7f2
parentMerge pull request #854 from matrix-org/erikj/federation_logging (diff)
parentLog user that is making /publicRooms calls (diff)
downloadsynapse-958c968d028c38586f6b7eed8ee9c24c15e8c6e6.tar.xz
Merge pull request #856 from matrix-org/erikj/fed_pub_rooms
Enable auth on /publicRoom endpoints
-rw-r--r--synapse/federation/transport/server.py5
-rw-r--r--synapse/rest/client/v1/room.py7
2 files changed, 7 insertions, 5 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py
index a1a334955f..ab9f38f010 100644
--- a/synapse/federation/transport/server.py
+++ b/synapse/federation/transport/server.py
@@ -532,11 +532,6 @@ class PublicRoomList(BaseFederationServlet):
         data = yield self.room_list_handler.get_local_public_room_list()
         defer.returnValue((200, data))
 
-    # Avoid doing remote HS authorization checks which are done by default by
-    # BaseFederationServlet.
-    def _wrap(self, code):
-        return code
-
 
 SERVLET_CLASSES = (
     FederationSendServlet,
diff --git a/synapse/rest/client/v1/room.py b/synapse/rest/client/v1/room.py
index db52a1fc39..604c2a565e 100644
--- a/synapse/rest/client/v1/room.py
+++ b/synapse/rest/client/v1/room.py
@@ -279,6 +279,13 @@ class PublicRoomListRestServlet(ClientV1RestServlet):
 
     @defer.inlineCallbacks
     def on_GET(self, request):
+        try:
+            yield self.auth.get_user_by_req(request)
+        except AuthError:
+            # This endpoint isn't authed, but its useful to know who's hitting
+            # it if they *do* supply an access token
+            pass
+
         handler = self.hs.get_room_list_handler()
         data = yield handler.get_aggregated_public_room_list()