Move methods involving event authentication to EventAuthHandler. (#10268)

Instead of mixing them with user authentication methods.
This commit is contained in:
Patrick Cloke 2021-07-01 14:25:37 -04:00 committed by GitHub
parent 0aab50c772
commit 8d609435c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 112 additions and 106 deletions

View file

@ -472,7 +472,7 @@ class SpaceSummaryHandler:
# If this is a request over federation, check if the host is in the room or
# is in one of the spaces specified via the join rules.
elif origin:
if await self._auth.check_host_in_room(room_id, origin):
if await self._event_auth_handler.check_host_in_room(room_id, origin):
return True
# Alternately, if the host has a user in any of the spaces specified
@ -485,7 +485,9 @@ class SpaceSummaryHandler:
await self._event_auth_handler.get_rooms_that_allow_join(state_ids)
)
for space_id in allowed_rooms:
if await self._auth.check_host_in_room(space_id, origin):
if await self._event_auth_handler.check_host_in_room(
space_id, origin
):
return True
# otherwise, check if the room is peekable