Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #856 from matrix-org/erikj/fed_pub_rooms
Browse files Browse the repository at this point in the history
Enable auth on /publicRoom endpoints
  • Loading branch information
erikjohnston committed Jun 8, 2016
2 parents 746b2f5 + efeabd3 commit 958c968
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,6 @@ def on_GET(self, request):
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,
Expand Down
7 changes: 7 additions & 0 deletions synapse/rest/client/v1/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 958c968

Please sign in to comment.