summary refs log tree commit diff
path: root/synapse/event_auth.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2021-10-04 14:17:05 +0100
committerBrendan Abolivier <babolivier@matrix.org>2021-10-04 14:17:05 +0100
commitebbd37b66db2c5ed700d50dd00e3e108d7f1268c (patch)
tree235bd75367c221a98d10c03eb86d63173e875bb2 /synapse/event_auth.py
parentMerge branch 'release-v1.44' into matrix-org-hotfixes (diff)
parentFix error in `get_user_ip_and_agents` when fetching from the database (#10968) (diff)
downloadsynapse-ebbd37b66db2c5ed700d50dd00e3e108d7f1268c.tar.xz
Merge branch 'release-v1.44' into matrix-org-hotfixes
Diffstat (limited to 'synapse/event_auth.py')
-rw-r--r--synapse/event_auth.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/event_auth.py b/synapse/event_auth.py

index fc50a0e71a..650402836c 100644 --- a/synapse/event_auth.py +++ b/synapse/event_auth.py
@@ -115,11 +115,11 @@ def check( is_invite_via_allow_rule = ( event.type == EventTypes.Member and event.membership == Membership.JOIN - and "join_authorised_via_users_server" in event.content + and EventContentFields.AUTHORISING_USER in event.content ) if is_invite_via_allow_rule: authoriser_domain = get_domain_from_id( - event.content["join_authorised_via_users_server"] + event.content[EventContentFields.AUTHORISING_USER] ) if not event.signatures.get(authoriser_domain): raise AuthError(403, "Event not signed by authorising server") @@ -381,7 +381,9 @@ def _is_membership_change_allowed( # Note that if the caller is in the room or invited, then they do # not need to meet the allow rules. if not caller_in_room and not caller_invited: - authorising_user = event.content.get("join_authorised_via_users_server") + authorising_user = event.content.get( + EventContentFields.AUTHORISING_USER + ) if authorising_user is None: raise AuthError(403, "Join event is missing authorising user.") @@ -836,10 +838,10 @@ def auth_types_for_event( auth_types.add(key) if room_version.msc3083_join_rules and membership == Membership.JOIN: - if "join_authorised_via_users_server" in event.content: + if EventContentFields.AUTHORISING_USER in event.content: key = ( EventTypes.Member, - event.content["join_authorised_via_users_server"], + event.content[EventContentFields.AUTHORISING_USER], ) auth_types.add(key)