summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-19 17:47:21 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-19 17:47:21 +0000
commit5d68a2f9c97aa4549fdf54b29aed61c70f6ba656 (patch)
tree6295220c8cc86dbb60977770ec666262ca3cc8ee
parentMerge pull request #6505 from matrix-org/erikj/make_deferred_yiedable (diff)
parentRemove redundant code from event authorisation implementation. (#6502) (diff)
downloadsynapse-5d68a2f9c97aa4549fdf54b29aed61c70f6ba656.tar.xz
Remove redundant code from event authorisation implementation. (#6502)
* commit '424fd5823':
  Remove redundant code from event authorisation implementation. (#6502)
-rw-r--r--changelog.d/6502.removal1
-rw-r--r--synapse/event_auth.py8
2 files changed, 3 insertions, 6 deletions
diff --git a/changelog.d/6502.removal b/changelog.d/6502.removal
new file mode 100644

index 0000000000..0b72261d58 --- /dev/null +++ b/changelog.d/6502.removal
@@ -0,0 +1 @@ +Remove redundant code from event authorisation implementation. diff --git a/synapse/event_auth.py b/synapse/event_auth.py
index ec3243b27b..c940b84470 100644 --- a/synapse/event_auth.py +++ b/synapse/event_auth.py
@@ -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) @@ -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)