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

Commit

Permalink
Update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Jun 30, 2022
1 parent dcf4c20 commit 41df503
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion synapse/handlers/federation_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,9 @@ async def _check_event_auth(
)

# ... and check that the event passes auth at those auth events.
# https://spec.matrix.org/v1.3/server-server-api/#checks-performed-on-receipt-of-a-pdu:
# 4. Passes authorization rules based on the event’s auth events,
# otherwise it is rejected.
try:
await check_state_independent_auth_rules(self._store, event)
check_state_dependent_auth_rules(event, claimed_auth_events)
Expand All @@ -1531,7 +1534,10 @@ async def _check_event_auth(
context.rejected = RejectedReason.AUTH_ERROR
return context

# now check auth against what we think the auth events *should* be.
# now check the auth rules pass against the room state before the event
# https://spec.matrix.org/v1.3/server-server-api/#checks-performed-on-receipt-of-a-pdu:
# 5. Passes authorization rules based on the state before the event,
# otherwise it is rejected.
event_types = event_auth.auth_types_for_event(event.room_version, event)
prev_state_ids = await context.get_prev_state_ids(
StateFilter.from_types(event_types)
Expand Down

0 comments on commit 41df503

Please sign in to comment.