mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-01-31 07:03:25 -05:00
Remove redundant code from event authorisation implementation. (#6502)
This commit is contained in:
parent
35f3c366ef
commit
424fd58237
1
changelog.d/6502.removal
Normal file
1
changelog.d/6502.removal
Normal file
@ -0,0 +1 @@
|
|||||||
|
Remove redundant code from event authorisation implementation.
|
@ -42,6 +42,8 @@ def check(room_version, event, auth_events, do_sig_check=True, do_size_check=Tru
|
|||||||
Returns:
|
Returns:
|
||||||
if the auth checks pass.
|
if the auth checks pass.
|
||||||
"""
|
"""
|
||||||
|
assert isinstance(auth_events, dict)
|
||||||
|
|
||||||
if do_size_check:
|
if do_size_check:
|
||||||
_check_size_limits(event)
|
_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):
|
if not event.signatures.get(event_id_domain):
|
||||||
raise AuthError(403, "Event not signed by sending server")
|
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:
|
if event.type == EventTypes.Create:
|
||||||
sender_domain = get_domain_from_id(event.sender)
|
sender_domain = get_domain_from_id(event.sender)
|
||||||
room_id_domain = get_domain_from_id(event.room_id)
|
room_id_domain = get_domain_from_id(event.room_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user