diff options
author | Richard van der Hoff <richard@matrix.org> | 2022-06-13 11:34:59 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2022-06-13 11:34:59 +0100 |
commit | f68b5e5773a9e74c0f895190aaedce41f8565fa7 (patch) | |
tree | 0601c8b98bc68e25e7466cd220d8034cac29f27f /synapse/handlers/federation.py | |
parent | Revert "Changelog" (diff) | |
parent | changelog (diff) | |
download | synapse-f68b5e5773a9e74c0f895190aaedce41f8565fa7.tar.xz |
Merge branch 'rav/simplify_event_auth_interface' into develop
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 5e16139626..1e5694244a 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -800,9 +800,7 @@ class FederationHandler: # The remote hasn't signed it yet, obviously. We'll do the full checks # when we get the event back in `on_send_join_request` - await self._event_auth_handler.check_auth_rules_from_context( - room_version, event, context - ) + await self._event_auth_handler.check_auth_rules_from_context(event, context) return event async def on_invite_request( @@ -973,9 +971,7 @@ class FederationHandler: try: # The remote hasn't signed it yet, obviously. We'll do the full checks # when we get the event back in `on_send_leave_request` - await self._event_auth_handler.check_auth_rules_from_context( - room_version_obj, event, context - ) + await self._event_auth_handler.check_auth_rules_from_context(event, context) except AuthError as e: logger.warning("Failed to create new leave %r because %s", event, e) raise e @@ -1034,9 +1030,7 @@ class FederationHandler: try: # The remote hasn't signed it yet, obviously. We'll do the full checks # when we get the event back in `on_send_knock_request` - await self._event_auth_handler.check_auth_rules_from_context( - room_version_obj, event, context - ) + await self._event_auth_handler.check_auth_rules_from_context(event, context) except AuthError as e: logger.warning("Failed to create new knock %r because %s", event, e) raise e @@ -1207,9 +1201,9 @@ class FederationHandler: event.internal_metadata.send_on_behalf_of = self.hs.hostname try: - validate_event_for_room_version(room_version_obj, event) + validate_event_for_room_version(event) await self._event_auth_handler.check_auth_rules_from_context( - room_version_obj, event, context + event, context ) except AuthError as e: logger.warning("Denying new third party invite %r because %s", event, e) @@ -1259,10 +1253,8 @@ class FederationHandler: ) try: - validate_event_for_room_version(room_version_obj, event) - await self._event_auth_handler.check_auth_rules_from_context( - room_version_obj, event, context - ) + validate_event_for_room_version(event) + await self._event_auth_handler.check_auth_rules_from_context(event, context) except AuthError as e: logger.warning("Denying third party invite %r because %s", event, e) raise e |