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

Commit

Permalink
Remove redundant code from event authorisation implementation. (#6502)
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Dec 10, 2019
1 parent 35f3c36 commit 424fd58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/6502.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove redundant code from event authorisation implementation.
8 changes: 2 additions & 6 deletions synapse/event_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ def check(room_version, event, auth_events, do_sig_check=True, do_size_check=Tru
Returns:
if the auth checks pass.
"""
assert isinstance(auth_events, dict)

if do_size_check:
_check_size_limits(event)

Expand Down Expand Up @@ -74,12 +76,6 @@ def check(room_version, event, auth_events, do_sig_check=True, do_size_check=Tru
if not event.signatures.get(event_id_domain):
raise AuthError(403, "Event not signed by sending server")

if auth_events is None:
# Oh, we don't know what the state of the room was, so we
# are trusting that this is allowed (at least for now)
logger.warning("Trusting event: %s", event.event_id)
return

if event.type == EventTypes.Create:
sender_domain = get_domain_from_id(event.sender)
room_id_domain = get_domain_from_id(event.room_id)
Expand Down

0 comments on commit 424fd58

Please sign in to comment.