summary refs log tree commit diff
path: root/synapse/handlers/federation.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Filter the results of user directory searching via the spam checker (#6888)Andrew Morgan2020-03-231-1/+1
|\ | | | | | | | | * commit '49f877d32': Filter the results of user directory searching via the spam checker (#6888)
* | Limit the number of events that can be requested when backfilling events (#6864)Andrew Morgan2020-03-231-0/+4
|\| | | | | | | | | * commit '7765bf398': Limit the number of events that can be requested when backfilling events (#6864)
| * Limit the number of events that can be requested when backfilling events (#6864)Patrick Cloke2020-02-061-0/+4
| | | | | | Limit the maximum number of events requested when backfilling events.
* | pass room version into FederationClient.send_join (#6854)Andrew Morgan2020-03-231-2/+1
|\| | | | | | | | | * commit 'b0c8bdd49': pass room version into FederationClient.send_join (#6854)
| * pass room version into FederationClient.send_join (#6854)Richard van der Hoff2020-02-061-2/+1
| | | | | | | | ... which allows us to sanity-check the create event.
* | Merge pull request #6823 from matrix-org/rav/redact_changes/5Andrew Morgan2020-03-231-6/+2
|\| | | | | | | | | | | | | | | | | | | * commit '9bcd37146': Update changelog Update changelog Update changelog Newsfile Simplify `room_version` handling in `FederationClient.send_invite` Pass room version object into `FederationClient.get_pdu`
| * Merge pull request #6823 from matrix-org/rav/redact_changes/5Richard van der Hoff2020-02-061-6/+2
| |\ | | | | | | pass room versions around
| | * Pass room version object into `FederationClient.get_pdu`Richard van der Hoff2020-02-051-6/+2
| | |
| * | Merge tag 'v1.10.0rc2' into developErik Johnston2020-02-061-14/+60
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.10.0rc2 (2020-02-06) ============================== Bugfixes -------- - Fix an issue with cross-signing where device signatures were not sent to remote servers. ([\#6844](https://github.com/matrix-org/synapse/issues/6844)) - Fix to the unknown remote device detection which was introduced in 1.10.rc1. ([\#6848](https://github.com/matrix-org/synapse/issues/6848)) Internal Changes ---------------- - Detect unexpected sender keys on remote encrypted events and resync device lists. ([\#6850](https://github.com/matrix-org/synapse/issues/6850))
* | | Check sender_key matches on inbound encrypted events. (#6850)Andrew Morgan2020-03-231-13/+59
|\ \ \ | | |/ | |/| | | | | | | * commit 'a58860e48': Check sender_key matches on inbound encrypted events. (#6850)
| * | Check sender_key matches on inbound encrypted events. (#6850)Erik Johnston2020-02-051-13/+59
| | | | | | | | | If they don't then the device lists are probably out of sync.
* | | Fix detecting unknown devices from remote encrypted events. (#6848)Andrew Morgan2020-03-231-1/+1
|\| | | | | | | | | | | | | | * commit '6475382d8': Fix detecting unknown devices from remote encrypted events. (#6848)
| * | Fix detecting unknown devices from remote encrypted events. (#6848)Erik Johnston2020-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We were looking at the wrong event type (`m.room.encryption` vs `m.room.encrypted`). Also fixup the duplicate `EvenTypes` entries. Introduced in #6776.
* | | Merge pull request #6837 from matrix-org/rav/federation_asyncAndrew Morgan2020-03-231-228/+201
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c7d6d5c69': (27 commits) make FederationHandler.send_invite async make FederationHandler.on_get_missing_events async changelog make FederationHandler.user_joined_room async make FederationHandler._clean_room_for_join async make FederationHandler._notify_persisted_event async make FederationHandler.persist_events_and_notify async make FederationHandler._make_and_verify_event async make FederationHandler.do_remotely_reject_invite async make FederationHandler._check_for_soft_fail async make FederationHandler._persist_auth_tree async make FederationHandler.do_invite_join async make FederationHandler.on_event_auth async make FederationHandler.on_exchange_third_party_invite_request async make FederationHandler.construct_auth_difference async make FederationHandler._update_context_for_auth_events async make FederationHandler._update_auth_events_and_context_for_auth async make FederationHandler.do_auth async make FederationHandler._prep_event async make FederationHandler._handle_new_event async ...
| * | make FederationHandler.send_invite asyncRichard van der Hoff2020-02-031-3/+2
| | |
| * | make FederationHandler.on_get_missing_events asyncRichard van der Hoff2020-02-031-5/+4
| | |
| * | make FederationHandler.user_joined_room asyncRichard van der Hoff2020-02-031-3/+3
| | |
| * | make FederationHandler._clean_room_for_join asyncRichard van der Hoff2020-02-031-4/+4
| | |
| * | make FederationHandler._notify_persisted_event asyncRichard van der Hoff2020-02-031-4/+6
| | |
| * | make FederationHandler.persist_events_and_notify asyncRichard van der Hoff2020-02-031-10/+10
| | |
| * | make FederationHandler._make_and_verify_event asyncRichard van der Hoff2020-02-031-5/+10
| | |
| * | make FederationHandler.do_remotely_reject_invite asyncRichard van der Hoff2020-02-031-6/+7
| | |
| * | make FederationHandler._check_for_soft_fail asyncRichard van der Hoff2020-02-031-13/+9
| | |
| * | make FederationHandler._persist_auth_tree asyncRichard van der Hoff2020-02-031-11/+7
| | |
| * | make FederationHandler.do_invite_join asyncRichard van der Hoff2020-02-031-16/+14
| | |
| * | make FederationHandler.on_event_auth asyncRichard van der Hoff2020-02-031-5/+4
| | |
| * | make FederationHandler.on_exchange_third_party_invite_request asyncRichard van der Hoff2020-02-031-14/+12
| | |
| * | make FederationHandler.construct_auth_difference asyncRichard van der Hoff2020-02-031-3/+4
| | |
| * | make FederationHandler._update_context_for_auth_events asyncRichard van der Hoff2020-02-031-10/+10
| | |
| * | make FederationHandler._update_auth_events_and_context_for_auth asyncRichard van der Hoff2020-02-031-20/+21
| | |
| * | make FederationHandler.do_auth asyncRichard van der Hoff2020-02-031-10/+14
| | |
| * | make FederationHandler._prep_event asyncRichard van der Hoff2020-02-031-23/+10
| | |
| * | make FederationHandler._handle_new_event asyncRichard van der Hoff2020-02-031-6/+7
| | |
| * | make FederationHandler._handle_new_events asyncRichard van der Hoff2020-02-031-8/+6
| | |
| * | make FederationHandler.on_make_leave_request asyncRichard van der Hoff2020-02-031-13/+10
| | |
| * | make FederationHandler.on_send_leave_request asyncRichard van der Hoff2020-02-031-5/+3
| | |
| * | make FederationHandler.on_make_join_request asyncRichard van der Hoff2020-02-031-13/+10
| | |
| * | make FederationHandler.on_invite_request asyncRichard van der Hoff2020-02-031-5/+4
| | |
| * | make FederationHandler.on_send_join_request asyncRichard van der Hoff2020-02-031-9/+7
| | |
| * | make FederationHandler.on_query_auth asyncRichard van der Hoff2020-02-031-7/+6
| |/
* | pass room_version into compute_event_signature (#6807)Andrew Morgan2020-03-231-1/+4
|\| | | | | | | | | * commit '7f93eb190': pass room_version into compute_event_signature (#6807)
| * pass room_version into compute_event_signature (#6807)Richard van der Hoff2020-01-311-1/+4
| |
* | Merge pull request #6820 from matrix-org/rav/get_room_version_idAndrew Morgan2020-03-231-9/+9
|\| | | | | | | | | | | | | * commit '160522e32': newsfile Add `get_room_version` method s/get_room_version/get_room_version_id/
| * Merge pull request #6820 from matrix-org/rav/get_room_version_idRichard van der Hoff2020-01-311-9/+9
| |\ | | | | | | Make `get_room_version` return a RoomVersion object
| | * s/get_room_version/get_room_version_id/Richard van der Hoff2020-01-311-9/+9
| | | | | | | | | | | | | | | ... to make way for a forthcoming get_room_version which returns a RoomVersion object.
* | | Fix bug with getting missing auth event during join 500'ed (#6810)Andrew Morgan2020-03-231-1/+5
|\| | | | | | | | | | | | | | * commit '7d846e870': Fix bug with getting missing auth event during join 500'ed (#6810)
| * | Fix bug with getting missing auth event during join 500'ed (#6810)Erik Johnston2020-01-311-1/+5
| |/
* | pass room version into FederationHandler.on_invite_request (#6805)Andrew Morgan2020-03-231-3/+3
|\| | | | | | | | | * commit '46a446828': pass room version into FederationHandler.on_invite_request (#6805)
| * pass room version into FederationHandler.on_invite_request (#6805)Richard van der Hoff2020-01-301-3/+3
| |
* | Resync remote device list when detected as stale. (#6786)Andrew Morgan2020-03-231-2/+16
|\| | | | | | | | | * commit 'b66032705': Resync remote device list when detected as stale. (#6786)
| * Resync remote device list when detected as stale. (#6786)Erik Johnston2020-01-301-2/+16
| |
* | Detect unknown remote devices and mark cache as stale (#6776)Andrew Morgan2020-03-231-0/+20
|\| | | | | | | | | * commit 'e17a11066': Detect unknown remote devices and mark cache as stale (#6776)
| * Detect unknown remote devices and mark cache as stale (#6776)Erik Johnston2020-01-281-0/+20
| | | | | | | | We just mark the fact that the cache may be stale in the database for now.
* | Pass room version object into event_auth.check and check_redaction (#6788)Andrew Morgan2020-03-231-7/+11
|\| | | | | | | | | * commit 'a8ce7aeb4': Pass room version object into event_auth.check and check_redaction (#6788)
| * Pass room version object into event_auth.check and check_redaction (#6788)Richard van der Hoff2020-01-281-7/+11
| | | | | | | | | | | | | | These are easier to work with than the strings and we normally have one around. This fixes `FederationHander._persist_auth_tree` which was passing a RoomVersion object into event_auth.check instead of a string.
* | Add `rooms.room_version` column (#6729)Andrew Morgan2020-03-231-15/+50
|\| | | | | | | | | * commit '8df862e45': Add `rooms.room_version` column (#6729)
| * Add `rooms.room_version` column (#6729)Erik Johnston2020-01-271-15/+50
| | | | | | This is so that we don't have to rely on pulling it out from `current_state_events` table.
* | Add StateMap type alias (#6715)Andrew Morgan2020-03-231-6/+4
|\| | | | | | | | | * commit 'd386f2f33': Add StateMap type alias (#6715)
| * Add StateMap type alias (#6715)Erik Johnston2020-01-161-6/+4
| |
* | Merge pull request #6652 from matrix-org/babolivier/depth_missing_eventsAndrew Morgan2020-03-201-2/+2
|\| | | | | | | | | | | * commit '0ab5853ec': Changelog Fix conditions failing if min_depth = 0
| * Fix conditions failing if min_depth = 0Brendan Abolivier2020-01-071-2/+2
| | | | | | | | This could result in Synapse not fetching prev_events for new events in the room if it has missed some events.
| * Merge branch 'master' into developRichard van der Hoff2019-12-201-1/+4
| |\
* | | Fix small extra argument passed to get_eventsAndrew Morgan2020-03-201-2/+9
| | |
* | | Change EventContext to use the Storage class (#6564)Andrew Morgan2020-03-201-7/+7
|\| | | | | | | | | | | | | | * commit 'fa780e972': Change EventContext to use the Storage class (#6564)
| * | Change EventContext to use the Storage class (#6564)Erik Johnston2019-12-201-7/+7
| | |
* | | Fix exceptions when attempting to backfill (#6576)Andrew Morgan2020-03-201-1/+4
|\ \ \ | | |/ | |/| | | | | | | * commit '03d3792f3': Fix exceptions when attempting to backfill (#6576)
| * | Fix exceptions when attempting to backfill (#6576)Richard van der Hoff2019-12-201-1/+4
| | | | | | | | | Fixes #6575
* | | Add database config class (#6513)Andrew Morgan2020-03-201-35/+33
|\ \ \ | | |/ | |/| | | | | | | | | | * commit '2284eb3a5': Add database config class (#6513) too many parens
| * | Merge release-v1.7.1 into developRichard van der Hoff2019-12-181-0/+1
| |\|
* | | Exclude rejected state events when calculating state at backwards extrems ↵Andrew Morgan2020-03-191-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | (#6527) * commit 'bbb75ff6e': Exclude rejected state events when calculating state at backwards extrems (#6527)
| * | Exclude rejected state events when calculating state at backwards extrems ↵Richard van der Hoff2019-12-161-1/+1
| | | | | | | | | | | | | | | (#6527) This fixes a weird bug where, if you were determined enough, you could end up with a rejected event forming part of the state at a backwards-extremity. Authing that backwards extrem would then lead to us trying to pull the rejected event from the db (with allow_rejected=False), which would fail with a 404.
* | | Persist auth/state events at backwards extremities when we fetch them (#6526)Andrew Morgan2020-03-191-39/+14
|\| | | | | | | | | | | | | | * commit 'ff773ff72': Persist auth/state events at backwards extremities when we fetch them (#6526)
| * | Persist auth/state events at backwards extremities when we fetch them (#6526)Richard van der Hoff2019-12-161-163/+80
| | | | | | | | | | | | The main point here is to make sure that the state returned by _get_state_in_room has been authed before we try to use it as state in the room.
| * | sanity-checking for events used in state res (#6531)Richard van der Hoff2019-12-161-0/+1
| | | | | | | | | | | | | | | When we perform state resolution, check that all of the events involved are in the right room.
* | | Check the room_id of events when fetching room state/auth (#6524)Andrew Morgan2020-03-191-24/+54
|\| | | | | | | | | | | | | | * commit '35bbe4ca7': Check the room_id of events when fetching room state/auth (#6524)
| * | Check the room_id of events when fetching room state/auth (#6524)Richard van der Hoff2019-12-161-24/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we request the state/auth_events to populate a backwards extremity (on backfill or in the case of missing events in a transaction push), we should check that the returned events are in the right room rather than blindly using them in the room state or auth chain. Given that _get_events_from_store_or_dest takes a room_id, it seems clear that it should be sanity-checking the room_id of the requested events, so let's do it there.
* | | Add `include_event_in_state` to _get_state_for_room (#6521)Andrew Morgan2020-03-191-18/+21
|\| | | | | | | | | | | | | | * commit '20d5ba16e': Add `include_event_in_state` to _get_state_for_room (#6521)
| * | Add `include_event_in_state` to _get_state_for_room (#6521)Richard van der Hoff2019-12-161-18/+21
| | | | | | | | | | | | | | | | | | Make it return the state *after* the requested event, rather than the one before it. This is a bit easier and requires fewer calls to get_events_from_store_or_dest.
* | | Move get_state methods into FederationHandler (#6503)Andrew Morgan2020-03-191-101/+93
|\| | | | | | | | | | | | | | * commit 'be294d6fd': Move get_state methods into FederationHandler (#6503)
| * | Move get_state methods into FederationHandler (#6503)Richard van der Hoff2019-12-161-6/+95
| | | | | | | | | | | | | | | This is a non-functional refactor as a precursor to some other work.
* | | Exclude rejected state events when calculating state at backwards extrems ↵Andrew Morgan2020-03-191-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | (#6527) * commit '6920d8889': Exclude rejected state events when calculating state at backwards extrems (#6527)
| * | Exclude rejected state events when calculating state at backwards extrems ↵Richard van der Hoff2019-12-161-1/+1
| | | | | | | | | | | | | | | (#6527) This fixes a weird bug where, if you were determined enough, you could end up with a rejected event forming part of the state at a backwards-extremity. Authing that backwards extrem would then lead to us trying to pull the rejected event from the db (with allow_rejected=False), which would fail with a 404.
* | | Persist auth/state events at backwards extremities when we fetch them (#6526)Andrew Morgan2020-03-191-167/+80
|\| | | | | | | | | | | | | | * commit 'bc7de8765': Persist auth/state events at backwards extremities when we fetch them (#6526)
| * | Persist auth/state events at backwards extremities when we fetch them (#6526)Richard van der Hoff2019-12-161-167/+80
| | | | | | | | | The main point here is to make sure that the state returned by _get_state_in_room has been authed before we try to use it as state in the room.
* | | sanity-checking for events used in state res (#6531)Andrew Morgan2020-03-191-0/+1
|\| | | | | | | | | | | | | | * commit '1da15f05f': sanity-checking for events used in state res (#6531)
| * | sanity-checking for events used in state res (#6531)Richard van der Hoff2019-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | When we perform state resolution, check that all of the events involved are in the right room.
* | | Check the room_id of events when fetching room state/auth (#6524)Andrew Morgan2020-03-191-23/+51
|\| | | | | | | | | | | | | | * commit '25f124432': Check the room_id of events when fetching room state/auth (#6524)
| * | Check the room_id of events when fetching room state/auth (#6524)Richard van der Hoff2019-12-121-23/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we request the state/auth_events to populate a backwards extremity (on backfill or in the case of missing events in a transaction push), we should check that the returned events are in the right room rather than blindly using them in the room state or auth chain. Given that _get_events_from_store_or_dest takes a room_id, it seems clear that it should be sanity-checking the room_id of the requested events, so let's do it there.
* | | Add `include_event_in_state` to _get_state_for_room (#6521)Andrew Morgan2020-03-191-22/+28
|\| | | | | | | | | | | | | | * commit '204535651': Add `include_event_in_state` to _get_state_for_room (#6521)
| * | Add `include_event_in_state` to _get_state_for_room (#6521)Richard van der Hoff2019-12-111-22/+28
| | | | | | | | | | | | | | | Make it return the state *after* the requested event, rather than the one before it. This is a bit easier and requires fewer calls to get_events_from_store_or_dest.
* | | Merge pull request #6517 from matrix-org/rav/event_auth/13Andrew Morgan2020-03-191-84/+75
|\| | | | | | | | | | | | | | | | | | | | | | | | | | * commit '894d2adda': changelog convert to async: FederationHandler._process_received_pdu convert to async: FederationHandler._get_state_for_room convert to async: FederationHandler.on_receive_pdu Convert federation backfill to async
| * | convert to async: FederationHandler._process_received_pduRichard van der Hoff2019-12-111-11/+10
| | | | | | | | | | | | also fix user_joined_room to consistently return deferreds
| * | convert to async: FederationHandler._get_state_for_roomRichard van der Hoff2019-12-111-21/+21
| | | | | | | | | | | | ... and _get_events_from_store_or_dest
| * | convert to async: FederationHandler.on_receive_pduRichard van der Hoff2019-12-111-27/+22
| | | | | | | | | | | | | | | | | | | | | and associated functions: * on_receive_pdu * handle_queued_pdus * get_missing_events_for_pdu
| * | Convert federation backfill to asyncRichard van der Hoff2019-12-111-25/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | PaginationHandler.get_messages is only called by RoomMessageListRestServlet, which is async. Chase the code path down from there: - FederationHandler.maybe_backfill (and nested try_backfill) - FederationHandler.backfill
* | | Clean up some logging (#6515)Andrew Morgan2020-03-191-18/+19
|\| | | | | | | | | | | | | | * commit '7c429f92d': Clean up some logging (#6515)
| * | Clean up some logging (#6515)Richard van der Hoff2019-12-111-18/+19
| | | | | | | | | | | | This just makes some of the logging easier to follow when things start going wrong.
* | | Prevent redacted events from appearing in message search (#6377)Andrew Morgan2020-03-191-2/+5
|\| | | | | | | | | | | | | | * commit 'fc316a489': Prevent redacted events from appearing in message search (#6377)
| * | Prevent redacted events from appearing in message search (#6377)Andrew Morgan2019-12-111-2/+5
| | |
* | | Prevent message search in upgraded rooms we're not in (#6385)Andrew Morgan2020-03-191-2/+2
|\| | | | | | | | | | | | | | * commit 'ea0f0ad41': Prevent message search in upgraded rooms we're not in (#6385)
| * | Prevent message search in upgraded rooms we're not in (#6385)Andrew Morgan2019-12-111-2/+2
| | |
* | | Move get_state methods into FederationHandler (#6503)Andrew Morgan2020-03-191-6/+95
|\| | | | | | | | | | | | | | * commit 'f8bc2ae88': Move get_state methods into FederationHandler (#6503)
| * | Move get_state methods into FederationHandler (#6503)Richard van der Hoff2019-12-101-6/+95
| |/ | | | | | | | | This is a non-functional refactor as a precursor to some other work.
* | Stronger typing in the federation handler (#6480)Andrew Morgan2020-03-191-24/+57
|\| | | | | | | | | * commit '63d6ad106': Stronger typing in the federation handler (#6480)
| * Stronger typing in the federation handler (#6480)Richard van der Hoff2019-12-051-24/+57
| | | | | | | | | | replace the event_info dict with an attrs thing
* | Sanity-check the rooms of auth events before pulling them in. (#6472)Andrew Morgan2020-03-191-9/+25
|\| | | | | | | | | * commit 'e1f4c83f4': Sanity-check the rooms of auth events before pulling them in. (#6472)
| * Sanity-check the rooms of auth events before pulling them in. (#6472)Richard van der Hoff2019-12-051-9/+25
| |
* | get rid of (most of) have_events from ↵Andrew Morgan2020-03-191-38/+24
|\| | | | | | | | | | | | | _update_auth_events_and_context_for_auth (#6468) * commit 'e203874ca': get rid of (most of) have_events from _update_auth_events_and_context_for_auth (#6468)
| * get rid of (most of) have_events from ↵Richard van der Hoff2019-12-041-38/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | _update_auth_events_and_context_for_auth (#6468) have_events was a map from event_id to rejection reason (or None) for events which are in our local database. It was used as filter on the list of event_ids being passed into get_events_as_list. However, since get_events_as_list will ignore any event_ids that are unknown or rejected, we can equivalently just leave it to get_events_as_list to do the filtering. That means that we don't have to keep `have_events` up-to-date, and can use `have_seen_events` instead of `get_seen_events_with_rejection` in the one place we do need it.
* | Add ephemeral messages support (MSC2228) (#6409)Andrew Morgan2020-03-191-0/+8
|\| | | | | | | | | * commit '54dd5dc12': Add ephemeral messages support (MSC2228) (#6409)
| * Add ephemeral messages support (MSC2228) (#6409)Brendan Abolivier2019-12-031-0/+8
| | | | | | | | | | | | | | | | Implement part [MSC2228](https://github.com/matrix-org/matrix-doc/pull/2228). The parts that differ are: * the feature is hidden behind a configuration flag (`enable_ephemeral_messages`) * self-destruction doesn't happen for state events * only implement support for the `m.self_destruct_after` field (not the `m.self_destruct` one) * doesn't send synthetic redactions to clients because for this specific case we consider the clients to be able to destroy an event themselves, instead we just censor it (by pruning its JSON) in the database
* | Fix: Pillow error when uploading RGBA image (#3325) (#6241)Andrew Morgan2020-03-191-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '81731c6e7': Fix: Pillow error when uploading RGBA image (#3325) (#6241) Add User-Interactive Auth to /account/3pid/add (#6119) Lint Changelog Discard retention policies when retrieving state blacklist more tests Newsfile Add tests Propagate reason in remotely rejected invites MSC2367 Allow reason field on all member events
| * Propagate reason in remotely rejected invitesErik Johnston2019-11-281-2/+2
| |
| * Merge pull request #6358 from matrix-org/babolivier/message_retentionBrendan Abolivier2019-11-271-2/+2
| |\ | | | | | | Implement message retention policies (MSC1763)
| | * Merge branch 'develop' into babolivier/message_retentionBrendan Abolivier2019-11-261-3/+8
| | |\
| | * | Fix 3PID invite exchangeBrendan Abolivier2019-11-191-1/+1
| | | |
| | * | Implement per-room message retention policiesBrendan Abolivier2019-11-041-1/+1
| | | |
* | | | Merge pull request #6343 from matrix-org/rav/event_auth/4Andrew Morgan2020-03-181-37/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '651d930f1': remove confusing fixme newsfile Use get_events_as_list rather than lots of calls to get_event Update some docstrings and comments Simplify _update_auth_events_and_context_for_auth
| * | | remove confusing fixmeRichard van der Hoff2019-11-261-6/+0
| | | |
| * | | Merge remote-tracking branch 'origin/develop' into rav/event_auth/4Richard van der Hoff2019-11-181-2/+2
| |\ \ \ | | | |/ | | |/|
| * | | Use get_events_as_list rather than lots of calls to get_eventRichard van der Hoff2019-11-081-16/+8
| | | | | | | | | | | | | | | | It's more efficient and clearer.
| * | | Update some docstrings and commentsRichard van der Hoff2019-11-081-8/+31
| | | |
| * | | Simplify _update_auth_events_and_context_for_authRichard van der Hoff2019-11-081-11/+9
| | | | | | | | | | | | | | | | | | | | move event_key calculation into _update_context_for_auth_events, since it's only used there.
* | | | Replace instance variations of homeserver with correct case/spacing (#6357)Andrew Morgan2020-03-181-2/+2
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | * commit '6e1b40dc2': sample config Add changelog A couple more instances Replace instance variations of homeserver with correct case/spacing
| * | | Replace instance variations of homeserver with correct case/spacingAndrew Morgan2019-11-121-2/+2
| |/ /
* | | Fix bug which caused rejected events to be stored with the wrong room state ↵Andrew Morgan2020-03-161-0/+1
|\| | | | | | | | | | | | | | | | | | | | (#6320) * commit '807ec3bd9': Fix bug which caused rejected events to be stored with the wrong room state (#6320)
| * | Fix bug which caused rejected events to be stored with the wrong room state ↵Richard van der Hoff2019-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#6320) Fixes a bug where rejected events were persisted with the wrong state group. Also fixes an occasional internal-server-error when receiving events over federation which are rejected and (possibly because they are backwards-extremities) have no prev_group. Fixes #6289.
* | | Add some checks that we aren't using state from rejected events (#6330)Andrew Morgan2020-03-161-1/+5
|\| | | | | | | | | | | | | | * commit '0e3ab8afd': Add some checks that we aren't using state from rejected events (#6330)
| * | Add some checks that we aren't using state from rejected events (#6330)Richard van der Hoff2019-11-051-1/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | * Raise an exception if accessing state for rejected events Add some sanity checks on accessing state_group etc for rejected events. * Skip calculating push actions for rejected events It didn't actually cause any bugs, because rejected events get filtered out at various later points, but there's not point in trying to calculate the push actions for a rejected event.
* | Merge pull request #6301 from matrix-org/babolivier/msc2326Andrew Morgan2020-03-161-19/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f496d2587': Incorporate review Factor out an _AsyncEventContextImpl (#6298) Update synapse/storage/data_stores/main/schema/delta/56/event_labels.sql Add more data to the event_labels table and fix the indexes Add unstable feature flag Lint Incorporate review Lint Changelog Add integration tests for /messages Add more integration testing Add integration tests for sync Add unit tests Add index on label Implement filtering Store labels for new events Add database table for keeping track of labels on events
| * Factor out an _AsyncEventContextImpl (#6298)Richard van der Hoff2019-11-011-19/+19
| | | | | | | | | | | | The intention here is to make it clearer which fields we can expect to be populated when: notably, that the _event_type etc aren't used for the synchronous impl of EventContext.
* | Depublish a room from the public rooms list when it is upgraded (#6232)Andrew Morgan2020-03-161-1/+29
|\| | | | | | | | | * commit 'ace947e8d': Depublish a room from the public rooms list when it is upgraded (#6232)
| * Depublish a room from the public rooms list when it is upgraded (#6232)Andrew Morgan2019-11-011-1/+29
| |
* | Update black to 19.10b0 (#6304)Andrew Morgan2020-03-161-4/+5
|\| | | | | | | | | * commit '020add509': Update black to 19.10b0 (#6304)
| * Update black to 19.10b0 (#6304)Amber Brown2019-11-011-4/+5
| | | | | | * update version of black and also fix the mypy config being overridden
* | Merge pull request #6294 from matrix-org/erikj/add_state_storageAndrew Morgan2020-03-161-9/+10
|\|
| * Merge pull request #6294 from matrix-org/erikj/add_state_storageErik Johnston2019-10-311-9/+10
| |\ | | | | | | Add StateGroupStorage interface
| | * Port to use state storageErik Johnston2019-10-301-9/+10
| | |
* | | Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2020-03-161-16/+20
|\| |
| * | Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2019-10-311-16/+20
| |/ | | | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
* | Merge pull request #6240 from matrix-org/erikj/split_out_persistence_storeAndrew Morgan2020-03-161-1/+2
|\|
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-10-301-3/+19
| |\ | | | | | | | | | erikj/split_out_persistence_store
| * | Use new EventPersistenceStoreErik Johnston2019-10-231-1/+2
| | |
* | | Fix log line that was printing undefined value (#6278)Andrew Morgan2020-03-161-1/+1
|\ \ \ | | |/ | |/| | | | * commit 'a2276d4d3':
| * | Fix log line that was printing undefined value (#6278)Andrew Morgan2019-10-301-1/+1
| | |
* | | Improve signature checking on some federation APIs (#6262)Andrew Morgan2020-03-161-2/+18
|\| | | | | | | | | | | | | | * commit '172f264ed': Improve signature checking on some federation APIs (#6262)
| * | Improve signature checking on some federation APIs (#6262)Richard van der Hoff2019-10-281-2/+18
| |/ | | | | | | | | Make sure that we check that events sent over /send_join, /send_leave, and /invite, are correctly signed and come from the expected servers.
* | Remove Auth.check method (#6217)Andrew Morgan2020-03-161-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '93eaeec75': Remove Auth.check method (#6217) add note about database upgrade use the right function for when we're already in runInteraction add user signature stream change cache to slaved device store black use stream ID generator instead of timestamp make isort happy apply PR review suggestions fix formatting add changelog make changes from PR review don't need to return the hidden column any more really fix queries to work with Postgres PostgreSQL, Y U no like? remove extra SQL query param add changelog file apply changes from PR review allow uploading keys for cross-signing allow devices to be marked as "hidden"
| * Remove Auth.check method (#6217)Richard van der Hoff2019-10-181-3/+4
| | | | | | This method was somewhat redundant, and confusing.
* | Merge pull request #6214 from matrix-org/rav/event_auth/1Andrew Morgan2020-03-161-102/+0
|\| | | | | | | | | | | | | * commit '47ada4dff': changelog rip out some unreachable code Remove dead check_auth script
| * rip out some unreachable codeRichard van der Hoff2019-10-171-102/+0
| | | | | | | | The only possible rejection reason is AUTH_ERROR, so all of this is unreachable.
| * TypoBrendan Abolivier2019-10-041-1/+1
| |
| * LintBrendan Abolivier2019-10-041-3/+1
| |
| * Incorporate reviewBrendan Abolivier2019-10-041-14/+8
| |
| * Add test caseBrendan Abolivier2019-10-031-1/+1
| |
| * LintBrendan Abolivier2019-10-021-1/+3
| |
| * Don't 500 code when trying to exchange a revoked 3PID inviteBrendan Abolivier2019-10-021-2/+13
| | | | | | | | | | | | | | | | While this is not documented in the spec (but should be), Riot (and other clients) revoke 3PID invites by sending a m.room.third_party_invite event with an empty ({}) content to the room's state. When the invited 3PID gets associated with a MXID, the identity server (which doesn't know about revocations) sends down to the MXID's homeserver all of the undelivered invites it has for this 3PID. The homeserver then tries to talk to the inviting homeserver in order to exchange these invite for m.room.member events. When one of the invite is revoked, the inviting homeserver responds with a 500 error because it tries to extract a 'display_name' property from the content, which is empty. This might cause the invited server to consider that the server is down and not try to exchange other, valid invites (or at least delay it). This fix handles the case of revoked invites by avoiding trying to fetch a 'display_name' from the original invite's content, and letting the m.room.member event fail the auth rules (because, since the original invite's content is empty, it doesn't have public keys), which results in sending a 403 with the correct error message to the invited server.
* | Remove origin parameter from add_display_name_to_third_party_invite and add ↵Andrew Morgan2020-02-251-1/+6
|\| | | | | | | params to docstring (#6010)
| * Remove origin parameter from add_display_name_to_third_party_invite and add ↵Andrew Morgan2019-09-111-1/+6
| | | | | | | | | | | | | | params to docstring (#6010) Another small fixup noticed during work on a larger PR. The `origin` field of `add_display_name_to_third_party_invite` is not used and likely was just carried over from the `on_PUT` method of `FederationThirdPartyInviteExchangeServlet` which, like all other servlets, provides an `origin` argument. Since it's not used anywhere in the handler function though, we should remove it from the function arguments.
* | Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2020-02-241-1/+1
|\|
| * Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-1/+1
| | | | | | | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* | Implement a structured logging output system. (#5680)Andrew Morgan2020-02-211-2/+3
|\|
| * Implement a structured logging output system. (#5680)Amber Brown2019-08-281-2/+3
| |
* | Merge pull request #5790 from matrix-org/erikj/groups_request_errorsAndrew Morgan2020-02-201-0/+3
|\|
| * Merge pull request #5790 from matrix-org/erikj/groups_request_errorsErik Johnston2019-08-011-0/+3
| |\ | | | | | | Handle RequestSendFailed exception correctly in more places.
| | * Don't log as exception when failing durig backfillErik Johnston2019-07-301-0/+3
| | |
* | | Room Complexity Client Implementation (#5783)Andrew Morgan2020-02-201-0/+25
|\| |
| * | Room Complexity Client Implementation (#5783)Amber Brown2019-07-301-0/+25
| |/
| * Merge pull request #5744 from matrix-org/erikj/log_leave_origin_mismatchRichard van der Hoff2019-07-261-2/+35
| |\ | | | | | | Log when we receive a /make_* request from a different origin
* | \ Merge branch 'erikj/log_leave_origin_mismatch' into release-v1.2.1Andrew Morgan2020-02-191-2/+35
|\ \ \ | | |/ | |/|
| * | Log when we receive a /make_* request from a different originRichard van der Hoff2019-07-261-2/+35
| | |
* | | Replace returnValue with return (#5736)Andrew Morgan2020-02-191-42/+40
|\ \ \ | | |/ | |/|
| * | Replace returnValue with return (#5736)Amber Brown2019-07-231-42/+40
| |/
* | Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Andrew Morgan2020-02-141-21/+22
|\|
| * Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Amber Brown2019-07-041-21/+22
| |
* | Run Black. (#5482)Andrew Morgan2020-02-131-1/+1
|\|
| * Run Black. (#5482)Amber Brown2019-06-201-521/+363
| |
| * Merge pull request #5042 from matrix-org/erikj/fix_get_missing_events_errorErik Johnston2019-06-191-9/+19
| |\ | | | | | | Handle the case of `get_missing_events` failing
* | | Dinsic Blacking with black==18.6b2Andrew Morgan2020-02-111-521/+366
| | |
* | | Add some logging to 3pid invite sig verification (#5015)Andrew Morgan2020-02-101-8/+38
|\| |
| * | Add some logging to 3pid invite sig verification (#5015)David Baker2019-06-181-8/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I had to add quite a lot of logging to diagnose a problem with 3pid invites - we only logged the one failure which isn't all that informative. NB. I'm not convinced the logic of this loop is right: I think it should just accept a single valid signature from a trusted source rather than fail if *any* signature is invalid. Also it should probably not skip the rest of middle loop if a check fails? However, I'm deliberately not changing the logic here.
* | | Fix loglineAndrew Morgan2020-02-101-1/+1
|\ \ \ | | |/ | |/|
| * | Fix loglineErik Johnston2019-06-181-1/+1
| | |
* | | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-02-101-9/+19
|\| | | | | | | | | | | erikj/fix_get_missing_events_error
| * | Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-06-181-132/+289
| |\| | | | | | | | | | erikj/fix_get_missing_events_error
| | * Merge pull request #5464 from matrix-org/erikj/3pid_remote_invite_stateErik Johnston2019-06-171-6/+0
| | |\ | | | | | | | | Fix 3PID invite room state over federation.
| * | | Handle the case of `get_missing_events` failingErik Johnston2019-04-101-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if a call to `/get_missing_events` fails we log an exception and stop processing the top level event we received over federation. Instead let's try and handle it sensibly given it is a somewhat expected failure mode.
* | | | TypoBrendan Abolivier2019-10-041-1/+1
| | | |
* | | | LintBrendan Abolivier2019-10-041-3/+1
| | | |
* | | | Incorporate reviewBrendan Abolivier2019-10-041-14/+8
| | | |
* | | | Add test caseBrendan Abolivier2019-10-041-1/+1
| | | |
* | | | LintBrendan Abolivier2019-10-041-1/+3
| | | |
* | | | Don't 500 code when trying to exchange a revoked 3PID inviteBrendan Abolivier2019-10-041-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While this is not documented in the spec (but should be), Riot (and other clients) revoke 3PID invites by sending a m.room.third_party_invite event with an empty ({}) content to the room's state. When the invited 3PID gets associated with a MXID, the identity server (which doesn't know about revocations) sends down to the MXID's homeserver all of the undelivered invites it has for this 3PID. The homeserver then tries to talk to the inviting homeserver in order to exchange these invite for m.room.member events. When one of the invite is revoked, the inviting homeserver responds with a 500 error because it tries to extract a 'display_name' property from the content, which is empty. This might cause the invited server to consider that the server is down and not try to exchange other, valid invites (or at least delay it). This fix handles the case of revoked invites by avoiding trying to fetch a 'display_name' from the original invite's content, and letting the m.room.member event fail the auth rules (because, since the original invite's content is empty, it doesn't have public keys), which results in sending a 403 with the correct error message to the invited server.
* | | | Implement per-room message retention policiesBrendan Abolivier2019-08-281-2/+2
| | | |
* | | | Merge pull request #5471 from matrix-org/erikj/3pid_remote_invite_stateBrendan Abolivier2019-06-171-6/+0
|\ \ \ \ | | |_|/ | |/| | Port "Fix 3PID invite room state over federation" to dinsic
| * | | Fix 3PID invite room state over federation.Erik Johnston2019-06-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes that when a user exchanges a 3PID invite for a proper invite over federation it does not include the `invite_room_state` key. This was due to synapse incorrectly sending out two invite requests.
* | | | Merge branch 'babolivier/third_party_event_rules' into dinsicBrendan Abolivier2019-06-141-2/+66
|\ \ \ \ | | |_|/ | |/| |
| * | | Add plugin APIs for implementations of custom event rules.Brendan Abolivier2019-06-141-2/+66
| |/ /
* | | Merge branch 'master' into dinsicBrendan Abolivier2019-06-121-123/+218
|\| |
| * | Add logging when request fails and clarify we ignore errors.Erik Johnston2019-06-051-4/+12
| | |
| * | Fix handling of failures when calling /event_auth.Erik Johnston2019-06-031-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When processing an incoming event over federation, we may try and resolve any unexpected differences in auth events. This is a non-essential process and so should not stop the processing of the event if it fails (e.g. due to the remote disappearing or not implementing the necessary endpoints). Fixes #3330
| * | Simplifications and comments in do_auth (#5227)Richard van der Hoff2019-05-231-120/+181
| | | | | | | | | | | | | | | I was staring at this function trying to figure out wtf it was actually doing. This is (hopefully) a non-functional refactor which makes it a bit clearer.
* | | Merge branch 'master' into dinsicBrendan Abolivier2019-06-111-1/+6
|\| |
| * | Exclude soft-failed events from fwd-extremity candidates. (#5146)Richard van der Hoff2019-05-211-1/+6
| |/ | | | | | | | | | | | | | | When considering the candidates to be forward-extremities, we must exclude soft failures. Hopefully fixes #5090.
* | [DINSIC] Block internal users from inviting external users to a public room ↵Andrew Morgan2019-04-161-0/+3
| | | | | | | | | | | | (#5061) Co-Authored-By: babolivier <contact@brendanabolivier.com>
* | Merge branch 'develop' into dinsicAndrew Morgan2019-04-151-8/+5
|\|
| * Collect room-version variations into one place (#4969)Richard van der Hoff2019-04-011-8/+5
| | | | | | | | Collect all the things that make room-versions different to one another into one place, so that it's easier to define new room versions.
* | Add 3PID invite support to spam checkerErik Johnston2019-03-211-1/+2
| |
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/dinsic-mergedErik Johnston2019-03-211-1/+139
|\|
| * Factor out soft fail checksErik Johnston2019-03-081-5/+22
| |
| * Implement soft failErik Johnston2019-03-061-1/+76
| |
| * clarify commentsErik Johnston2019-03-051-8/+11
| |
| * Only check history visibility when filteringErik Johnston2019-03-041-1/+3
| | | | | | | | | | | | When filtering events to send to server we check more than just history visibility. However when deciding whether to backfill or not we only care about the history visibility.
| * s/get_forward_events/get_successor_events/Erik Johnston2019-03-041-1/+1
| |
| * Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-03-041-3/+31
| |\ | | | | | | | | | erikj/stop_fed_not_in_room
| * | Update commentsErik Johnston2019-02-271-3/+13
| | |
| * | Stop backpaginating when events not visibleErik Johnston2019-02-201-0/+31
| | |
* | | Add invite_list and cloning param to create room ruleErik Johnston2019-03-181-1/+1
| |/ |/|
* | Fix typoErik Johnston2019-02-251-1/+1
| |
* | More commentsErik Johnston2019-02-251-0/+4
| |
* | Assert rather than clobber the valuesErik Johnston2019-02-251-2/+2
| |
* | Add comments and paranoiaErik Johnston2019-02-251-2/+23
| |
* | Fix backfill storing incorrect state for eventsErik Johnston2019-02-221-1/+4
|/
* Fix flake8 (#4519)Amber Brown2019-01-301-1/+1
|
* Use snder and not event ID domain to check if oursErik Johnston2019-01-291-0/+8
| | | | | | The transaction queue only sends out events that we generate. This was done by checking domain of event ID, but that can no longer be used. Instead, we may as well use the sender field.
* Fixup calls to `comput_event_signature`Erik Johnston2019-01-291-1/+1
| | | | | | | | We currently pass FrozenEvent instead of `dict` to `compute_event_signature`, which works by accident due to `dict(event)` producing the correct result. This fixes PR #4493 commit 855a151
* Merge pull request #4494 from matrix-org/erikj/fixup_event_validatorErik Johnston2019-01-291-2/+5
|\ | | | | Split up event validation between event and builder
| * Split up event validation between event and builderErik Johnston2019-01-281-2/+5
| | | | | | | | | | | | | | | | | | The validator was being run on the EventBuilder objects, and so the validator only checked a subset of fields. With the upcoming EventBuilder refactor even fewer fields will be there to validate. To get around this we split the validation into those that can be run against an EventBuilder and those run against a fully fledged event.
* | Pass through room version to event authErik Johnston2019-01-251-8/+12
|/
* Require event format version to parse or create eventsErik Johnston2019-01-251-28/+44
|
* Merge branch 'develop' of github.com:matrix-org/synapse into erikj/msc_1813Erik Johnston2019-01-251-31/+18
|\
| * Merge pull request #4448 from matrix-org/erikj/get_pdu_versionsErik Johnston2019-01-241-2/+15
| |\ | | | | | | Add room_version param to get_pdu
| | * Review commentsErik Johnston2019-01-241-0/+5
| | |
| | * Add room_version param to get_pduErik Johnston2019-01-231-2/+10
| | | | | | | | | | | | | | | When we add new event format we'll need to know the event format or room version when parsing events.
| * | Remove unecessary setting of outlier bitErik Johnston2019-01-241-2/+0
| | |
| * | Use term 'out of band membership' insteadErik Johnston2019-01-241-2/+2
| | |
| * | Clarify the invite flowsErik Johnston2019-01-231-1/+11
| | |
| * | Remove unnecessary '_sign_event'Erik Johnston2019-01-231-14/+0
| | |
| * | Store rejected remote invite events as outliersErik Johnston2019-01-231-32/+12
| |/ | | | | | | | | | | | | | | | | | | | | Currently they're stored as non-outliers even though the server isn't in the room, which can be problematic in places where the code assumes it has the state for all non outlier events. In particular, there is an edge case where persisting the leave event triggers a state resolution, which requires looking up the room version from state. Since the server doesn't have the state, this causes an exception to be thrown.
* / Implement MSC 1813 - Add room version to make APIsErik Johnston2019-01-231-1/+1
|/ | | | | We also implement `make_membership_event` converting the returned room version to an event format version.
* Remove hack to support rejoining roomsErik Johnston2018-11-091-74/+42
|
* Simplify to always drop events if server isn't in the roomErik Johnston2018-11-091-14/+9
|
* Add helpers for getting prev and auth events (#4139)Erik Johnston2018-11-061-24/+24
| | | | | | | * Add helpers for getting prev and auth events This is in preparation for allowing the event format to change between room versions.
* Merge pull request #4040 from matrix-org/erikj/states_res_v2_rebaseErik Johnston2018-10-241-15/+15
|\ | | | | Add v2 state resolution algorithm
| * CommentErik Johnston2018-10-241-2/+5
| |
| * Rename resolve_events_with_factoryErik Johnston2018-10-241-2/+2
| |
| * Fix up use of resolve_events_with_factoryErik Johnston2018-10-161-13/+10
| |
* | Remove redundant run_as_background_process() from pusherpoolRichard van der Hoff2018-10-221-2/+2
| | | | | | | | | | | | | | `on_new_notifications` and `on_new_receipts` in `HttpPusher` and `EmailPusher` now always return synchronously, so we can remove the `defer.gatherResults` on their results, and the `run_as_background_process` wrappers can be removed too because the PusherPool methods will now complete quickly enough.
* | Fix incorrect truncation in get_missing_eventsRichard van der Hoff2018-10-161-7/+5
|/ | | | | | | | | It's quite important that get_missing_events returns the *latest* events in the room; however we were pulling event ids out of the database until we got *at least* 10, and then taking the *earliest* of the results. We also shouldn't really be relying on depth, and should be checking the room_id.
* Avoid reraise, to improve stacktracesRichard van der Hoff2018-10-011-10/+10
|