mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-27 20:22:07 +03:00
Merge pull request #856 from matrix-org/erikj/fed_pub_rooms
Enable auth on /publicRoom endpoints
This commit is contained in:
commit
958c968d02
2 changed files with 7 additions and 5 deletions
|
@ -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,
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue