summary refs log tree commit diff
path: root/tests/federation (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use full GitHub links instead of bare issue numbers. (#16637)Patrick Cloke2023-11-151-1/+1
|
* Remove more usages of cursor_to_dict. (#16551)Patrick Cloke2023-10-261-1/+0
| | | Mostly to improve type safety.
* Stop sending incorrect knock_state_events. (#16403)Patrick Cloke2023-10-061-1/+1
| | | | | | | | | Synapse was incorrectly implemented with a knock_state_events property on some APIs (instead of knock_room_state). This was correct in Synapse 1.70.0, but *both* fields were sent to also be compatible with Synapse versions expecting the wrong field. Enough time has passed that only the correct field needs to be included/handled.
* Add a cache around server ACL checking (#16360)Patrick Cloke2023-09-261-13/+22
| | | | | * Pre-compiles the server ACLs onto an object per room and invalidates them when new events come in. * Converts the server ACL checking into Rust.
* Don't wake up destination transaction queue if they're not due for retry. ↵Erik Johnston2023-09-041-9/+18
| | | | (#16223)
* Bump mypy-zope & mypy. (#16188)Patrick Cloke2023-08-294-18/+18
|
* Replace make_awaitable with AsyncMock (#16179)Patrick Cloke2023-08-243-43/+40
| | | | Python 3.8 provides a native AsyncMock, we can replace the homegrown version we have.
* Switch from `matrix://` to `matrix-federation://` scheme for internal ↵Eric Eastwood2023-06-201-2/+2
| | | | | | | Synapse routing of outbound federation traffic (#15806) `matrix://` is a registered specced scheme nowadays and doesn't make sense for our internal to Synapse use case anymore. ([discussion] (https://github.com/matrix-org/synapse/pull/15773#discussion_r1227598679))
* Regularly try to wake up dests instead of waiting for next PDU/EDU (#15743)Mathieu Velten2023-06-161-13/+9
|
* Rename blacklist/whitelist internally. (#15620)Patrick Cloke2023-05-191-1/+1
| | | | Avoid renaming configuration settings for now and rename internal code to use blocklist and allowlist instead.
* Remove experimental configuration flags & unstable values for faster joins ↵Patrick Cloke2023-05-191-32/+3
| | | | | | | (#15625) Synapse will no longer send (or respond to) the unstable flags for faster joins. These were only available behind a configuration flag and handled in parallel with the stable flags.
* Finish type hints for federation client HTTP code. (#15465)Patrick Cloke2023-04-241-5/+5
|
* Ensure fed-sender catchup does not block for full state (#15248)David Robertson2023-03-131-1/+86
| | | | * Reproduce bad scenario in test * Avoid catchup optimisation for partial state rooms
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-222-5/+0
|
* Add final type hint to tests.unittest. (#15072)Patrick Cloke2023-02-144-58/+68
| | | | Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
* Type hints for tests.federation (#14991)David Robertson2023-02-068-91/+125
| | | | | | | | | | | | | * Make tests.federation pass mypy * Untyped defs in tests.federation.transport * test methods return None * Remaining type hints in tests.federation * Changelog * Avoid an uncessary type-ignore
* Fix type hints in knocking tests. (#14887)Andrew Morgan2023-01-251-3/+3
|
* Stabilise serving partial join responses (#14839)David Robertson2023-01-171-2/+1
| | | | | Serving partial join responses is no longer experimental. They will only be served under the stable identifier if the the undocumented config flag experimental.msc3706_enabled is set to true. Synapse continues to request a partial join only if the undocumented config flag experimental.faster_joins is set to true; this setting remains present and unaffected.
* Also use stable name in SendJoinResponse struct (#14841)David Robertson2023-01-161-3/+3
| | | | | | | | | | | | | | | | | * Also use stable name in SendJoinResponse struct follow-up to #14832 * Changelog * Fix a rename I missed * Run black * Update synapse/federation/federation_client.py Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Use stable identifiers for faster joins (#14832)David Robertson2023-01-132-21/+58
| | | | | | | | | | | * Use new query param when requesting a partial join * Read new query param when serving partial join * Provide new field names when serving partial joins * Read new field names from partial join response * Changelog
* Modernize unit tests configuration settings for workers. (#14568)realtyem2022-12-012-12/+36
| | | | Use the newer foo_instances configuration instead of the deprecated flags to enable specific features (e.g. start_pushers).
* Use servers list approx to send read receipts when in partial state (#14549)Mathieu Velten2022-11-301-0/+4
| | | Signed-off-by: Mathieu Velten <mathieuv@matrix.org>
* Include thread information when sending receipts over federation. (#14466)Patrick Cloke2022-11-281-0/+77
| | | | | | | | | | | | Include the thread_id field when sending read receipts over federation. This might result in the same user having multiple read receipts per-room, meaning multiple EDUs must be sent to encapsulate those receipts. This restructures the PerDestinationQueue APIs to support multiple receipt EDUs, queue_read_receipt now becomes linear time in the number of queued threaded receipts in the room for the given user, it is expected this is a small number since receipt EDUs are sent as filler in transactions.
* Include heroes in partial join responses' state (#14442)David Robertson2022-11-151-4/+7
| | | | | | | | | | | * Pull out hero selection logic * Include heroes in partial join response's state * Changelog * Fixup trial test * Remove TODO
* Run trial tests against Python 3.11 (#13812)David Robertson2022-11-011-0/+11
|
* Refactor MSC3030 `/timestamp_to_event` to move away from our snowflake pull ↵Eric Eastwood2022-10-261-4/+8
| | | | | | | | | from `destination` pattern (#14096) 1. `federation_client.timestamp_to_event(...)` now handles all `destination` looping and uses our generic `_try_destination_list(...)` helper. 2. Consistently handling `NotRetryingDestination` and `FederationDeniedError` across `get_pdu` , backfill, and the generic `_try_destination_list` which is used for many places we use this pattern. 3. `get_pdu(...)` now returns `PulledPduInfo` so we know which `destination` we ended up pulling the PDU from
* Refactor OIDC tests to better mimic an actual OIDC provider. (#13910)Quentin Gliech2022-10-251-29/+7
| | | | | | | | | This implements a fake OIDC server, which intercepts calls to the HTTP client. Improves accuracy of tests by covering more internal methods. One particular example was the ID token validation, which previously mocked. This uncovered an incorrect dependency: Synapse actually requires at least authlib 0.15.1, not 0.14.0.
* Bump flake8-bugbear from 21.3.2 to 22.9.23 (#14042)dependabot[bot]2022-10-191-4/+3
| | | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Erik Johnston <erik@matrix.org> Co-authored-by: David Robertson <davidr@element.io>
* Always close _all_ `ijson` coroutines, even if doing so raises Exceptions ↵David Robertson2022-10-061-0/+37
| | | | (#14065)
* Track when the pulled event signature fails (#13815)Eric Eastwood2022-10-031-0/+75
| | | | | | | | | Because we're doing the recording in `_check_sigs_and_hash_for_pulled_events_and_fetch` (previously named `_check_sigs_and_hash_and_fetch`), this means we will track signature failures for `backfill`, `get_room_state`, `get_event_auth`, and `get_missing_events` (all pulled event scenarios). And we also record signature failures from `get_pdu`. Part of https://github.com/matrix-org/synapse/issues/13700 Part of https://github.com/matrix-org/synapse/issues/13676 and https://github.com/matrix-org/synapse/issues/13356 This PR will be especially important for https://github.com/matrix-org/synapse/pull/13816 so we can avoid the costly `_get_state_ids_after_missing_prev_event` down the line when `/messages` calls backfill.
* Accept & store thread IDs for receipts (implement MSC3771). (#13782)Patrick Cloke2022-09-231-3/+18
| | | | Updates the `/receipts` endpoint and receipt EDU handler to parse a `thread_id` from the body and insert it in the database.
* Generalise the `@cancellable` annotation so it can be used on functions ↵reivilibre2022-08-311-1/+2
| | | | other than just servlet methods. (#13662)
* Update `get_users_in_room` mis-use to get hosts with dedicated ↵Eric Eastwood2022-08-241-5/+12
| | | | | `get_current_hosts_in_room` (#13605) See https://github.com/matrix-org/synapse/pull/13575#discussion_r953023755
* Use literals in place of `HTTPStatus` constants in tests (#13463)Dirk Klimpel2022-08-052-6/+4
|
* Update `get_pdu` to return the original, pristine `EventBase` (#13320)Eric Eastwood2022-07-201-12/+113
| | | | | | | | | | | | Update `get_pdu` to return the untouched, pristine `EventBase` as it was originally seen over federation (no metadata added). Previously, we returned the same `event` reference that we stored in the cache which downstream code modified in place and added metadata like setting it as an `outlier` and essentially poisoned our cache. Now we always return a copy of the `event` so the original can stay pristine in our cache and re-used for the next cache call. Split out from https://github.com/matrix-org/synapse/pull/13205 As discussed at: - https://github.com/matrix-org/synapse/pull/13205#discussion_r918365746 - https://github.com/matrix-org/synapse/pull/13205#discussion_r918366125 Related to https://github.com/matrix-org/synapse/issues/12584. This PR doesn't fix that issue because it hits [`get_event` which exists from the local database before it tries to `get_pdu`](https://github.com/matrix-org/synapse/blob/7864f33e286dec22368dc0b11c06eebb1462a51e/synapse/federation/federation_client.py#L581-L594).
* Validate federation destinations and log an error if server name is invalid. ↵Shay2022-07-201-2/+2
| | | | (#13318)
* Rate limit joins per-room (#13276)David Robertson2022-07-191-1/+62
|
* Use HTTPStatus constants in place of literals in tests. (#13297)Dirk Klimpel2022-07-153-9/+12
|
* Rename test case method to `add_hashes_and_signatures_from_other_server` ↵David Robertson2022-07-122-12/+7
| | | | (#13255)
* Clean up the test code for client disconnections (#12929)Sean Quah2022-06-071-6/+4
| | | | | | | * Reword failure message about `await_result=False` * Use `reactor.advance()` instead of `reactor.pump()` * Raise `AssertionError`s ourselves * Un-instance method `_test_disconnect` * Replace `ThreadedMemoryReactorClock` with `MemoryReactorClock`
* Reduce state pulled from DB due to sending typing and receipts over ↵Erik Johnston2022-06-061-7/+7
| | | | | federation (#12964) Reducing the amount of state we pull from the DB is useful as fetching state is expensive in terms of DB, CPU and memory.
* Reduce the amount of state we pull from the DB (#12811)Erik Johnston2022-06-061-2/+4
|
* Additional constants for EDU types. (#12884)Patrick Cloke2022-05-272-13/+17
| | | Instead of hard-coding strings in many places.
* Make handling of federation Authorization header (more) compliant with ↵Hubert Chathi2022-05-181-1/+28
| | | | | | | | | | | | RFC7230 (#12774) The main differences are: - values with delimiters (such as colons) should be quoted, so always quote the origin, since it could contain a colon followed by a port number - should allow more than one space after "X-Matrix" - quoted values with backslash-escaped characters should be unescaped - names should be case insensitive
* Complain if a federation endpoint has the `@cancellable` flag (#12705)Sean Quah2022-05-111-0/+2
| | | | | | | | `BaseFederationServlet` wraps its endpoints in a bunch of async code that has not been vetted for compatibility with cancellation. Fail CI if a `@cancellable` flag is applied to a federation endpoint. Signed-off-by: Sean Quah <seanq@element.io>
* Respect the `@cancellable` flag for `RestServlet`s and ↵Sean Quah2022-05-112-0/+125
| | | | | | | | | | | | | | | `BaseFederationServlet`s (#12699) Both `RestServlet`s and `BaseFederationServlet`s register their handlers with `HttpServer.register_paths` / `JsonResource.register_paths`. Update `JsonResource` to respect the `@cancellable` flag on handlers registered in this way. Although `ReplicationEndpoint` also registers itself using `register_paths`, it does not pass the handler method that would have the `@cancellable` flag directly, and so needs separate handling. Signed-off-by: Sean Quah <seanq@element.io>
* Prefer `make_awaitable` over `defer.succeed` in tests (#12505)Sean Quah2022-04-272-2/+2
| | | | | | | | | | | When configuring the return values of mocks, prefer awaitables from `make_awaitable` over `defer.succeed`. `Deferred`s are only awaitable once, so it is inappropriate for a mock to return the same `Deferred` multiple times. Also update `run_in_background` to support functions that return arbitrary awaitables. Signed-off-by: Sean Quah <seanq@element.io>
* Back out implementation of MSC2314 (#12474)Richard van der Hoff2022-04-191-39/+2
| | | | | | | | MSC2314 has now been closed, so we're backing out its implementation, which originally happened in #6176. Unfortunately it's not a direct revert, as that PR mixed in a bunch of unrelated changes to tests etc.
* Only send out device list updates for our own users (#12465)Erik Johnston2022-04-141-1/+42
| | | Broke in #12365
* Process device list updates asynchronously (#12365)Erik Johnston2022-04-121-8/+0
|
* Track device list updates per room. (#12321)Erik Johnston2022-04-041-6/+17
| | | | | | | | | | | | | | This is a first step in dealing with #7721. The idea is basically that rather than calculating the full set of users a device list update needs to be sent to up front, we instead simply record the rooms the user was in at the time of the change. This will allow a few things: 1. we can defer calculating the set of remote servers that need to be poked about the change; and 2. during `/sync` and `/keys/changes` we can avoid also avoid calculating users who share rooms with other users, and instead just look at the rooms that have changed. However, care needs to be taken to correctly handle server downgrades. As such this PR writes to both `device_lists_changes_in_room` and the `device_lists_outbound_pokes` table synchronously. In a future release we can then bump the database schema compat version to `69` and then we can assume that the new `device_lists_changes_in_room` exists and is handled. There is a temporary option to disable writing to `device_lists_outbound_pokes` synchronously, allowing us to test the new code path does work (and by implication upgrading to a future release and downgrading to this one will work correctly). Note: Ideally we'd do the calculation of room to servers on a worker (e.g. the background worker), but currently only master can write to the `device_list_outbound_pokes` table.
* Remove references to "msc2403" (#12165)Andrew Morgan2022-03-301-2/+1
|
* Spread out sending device lists to remote hosts (#12132)Erik Johnston2022-03-041-4/+48
|
* Actually fix bad debug logging rejecting device list & signing key ↵David Robertson2022-02-281-1/+19
| | | | transactions (#12098)
* Replace assertEquals and friends with non-deprecated versions. (#12092)Patrick Cloke2022-02-284-18/+18
|
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-234-18/+20
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Faster joins: Support for calling `/federation/v1/state` (#12013)Richard van der Hoff2022-02-221-0/+149
| | | | This is an endpoint that we have server-side support for, but no client-side support. It's going to be useful for resyncing partial-stated rooms, so let's introduce it.
* Faster joins: parse msc3706 fields in send_join response (#12011)Richard van der Hoff2022-02-171-0/+32
| | | Part of my work on #11249: add code to handle the new fields added in MSC3706.
* Implement MSC3706: partial state in `/send_join` response (#11967)Richard van der Hoff2022-02-121-0/+148
| | | | | | | | | | | | * Make `get_auth_chain_ids` return a Set It has a set internally, and a set is often useful where it gets used, so let's avoid converting to an intermediate list. * Minor refactors in `on_send_join_request` A little bit of non-functional groundwork * Implement MSC3706: partial state in /send_join response
* Tests: replace mocked Authenticator with the real thing (#11913)Richard van der Hoff2022-02-114-10/+8
| | | | | | | | | | | | If we prepopulate the test homeserver with a key for a remote homeserver, we can make federation requests to it without having to stub out the authenticator. This has two advantages: * means that what we are testing is closer to reality (ie, we now have complete tests for the incoming-request-authorisation flow) * some tests require that other objects be signed by the remote server (eg, the event in `/send_join`), and doing that would require a whole separate set of mocking out. It's much simpler just to use real keys.
* Include the topic event in the prejoin state, per MSC3173. (#11666)Patrick Cloke2022-01-041-0/+9
| | | | Invites and knocks will now include the topic in the stripped state send to clients before joining the room.
* Send and handle cross-signing messages using the stable prefix. (#10520)Hubert Chathi2021-12-081-2/+3
|
* Add missing copyright header. (#11460)Patrick Cloke2021-11-301-0/+14
|
* Add a test case for the SendJoinParser (#11441)David Robertson2021-11-291-0/+50
| | | This would have caught the bug #11438 introduced in #11217 and fixed in #11439.
* Fix errors in Synapse logs from unit tests. (#10939)Patrick Cloke2021-09-301-3/+3
| | | | | Fix some harmless errors from background processes (mostly due to awaiting Mock objects) that occurred in the Synapse logs during unit tests.
* Use direct references for configuration variables (part 6). (#10916)Patrick Cloke2021-09-291-1/+1
|
* Split `FederationHandler` in half (#10692)Richard van der Hoff2021-08-261-1/+1
| | | The idea here is to take anything to do with incoming events and move it out to a separate handler, as a way of making FederationHandler smaller.
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-175-5/+5
|
* Return errors from `send_join` etc if the event is rejected (#10243)Richard van der Hoff2021-06-241-3/+1
| | | Rather than persisting rejected events via `send_join` and friends, raise a 403 if someone tries to pull a fast one.
* Remove the experimental flag for knocking and use stable prefixes / ↵Patrick Cloke2021-06-151-13/+9
| | | | | | | endpoints. (#10167) * Room version 7 for knocking. * Stable prefixes and endpoints (both client and federation) for knocking. * Removes the experimental configuration flag.
* Implement knock feature (#6739)Sorunome2021-06-091-0/+302
| | | | | | This PR aims to implement the knock feature as proposed in https://github.com/matrix-org/matrix-doc/pull/2403 Signed-off-by: Sorunome mail@sorunome.de Signed-off-by: Andrew Morgan andrewm@element.io
* Merge pull request from GHSA-x345-32rc-8h85Richard van der Hoff2021-05-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests for push rule pattern matching * tests for acl pattern matching * factor out common `re.escape` * Factor out common re.compile * Factor out common anchoring code * add word_boundary support to `glob_to_regex` * Use `glob_to_regex` in push rule evaluator NB that this drops support for character classes. I don't think anyone ever used them. * Improve efficiency of globs with multiple wildcards The idea here is that we compress multiple `*` globs into a single `.*`. We also need to consider `?`, since `*?*` is as hard to implement efficiently as `**`. * add assertion on regex pattern * Fix mypy * Simplify glob_to_regex * Inline the glob_to_regex helper function Signed-off-by: Dan Callahan <danc@element.io> * Moar comments Signed-off-by: Dan Callahan <danc@element.io> Co-authored-by: Dan Callahan <danc@element.io>
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-144-4/+0
| | | | | | | Part of #9744 Removes all redundant `# -*- coding: utf-8 -*-` lines from files, as python 3 automatically reads source code as utf-8 now. `Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>`
* Use mock from the stdlib. (#9772)Patrick Cloke2021-04-093-5/+3
|
* Make federation catchup send last event from any server. (#9640)Erik Johnston2021-03-181-0/+49
| | | | | | | | | | | | | | Currently federation catchup will send the last *local* event that we failed to send to the remote. This can cause issues for large rooms where lots of servers have sent events while the remote server was down, as when it comes back up again it'll be flooded with events from various points in the DAG. Instead, let's make it so that all the servers send the most recent events, even if its not theirs. The remote should deduplicate the events, so there shouldn't be much overhead in doing this. Alternatively, the servers could only send local events if they were also extremities and hope that the other server will send the event over, but that is a bit risky.
* Don't go into federation catch up mode so easily (#9561)Erik Johnston2021-03-151-1/+2
| | | | | | | | | | Federation catch up mode is very inefficient if the number of events that the remote server has missed is small, since handling gaps can be very expensive, c.f. #9492. Instead of going into catch up mode whenever we see an error, we instead do so only if we've backed off from trying the remote for more than an hour (the assumption being that in such a case it is more than a transient failure).
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-162-7/+12
| | | | | | | - Update black version to the latest - Run black auto formatting over the codebase - Run autoformatting according to [`docs/code_style.md `](https://github.com/matrix-org/synapse/blob/80d6dc9783aa80886a133756028984dbf8920168/docs/code_style.md) - Update `code_style.md` docs around installing black to use the correct version
* Fix RoomDirectoryFederationTests and make them actually run (#8998)Andrew Morgan2020-12-302-21/+18
| | | | | | | | | | The `RoomDirectoryFederationTests` tests were not being run unless explicitly called as an `__init__.py` file was not present in `tests/federation/transport/`. Thus the folder was not a python module, and `trial` did not look inside for any test cases to run. This was found while working on #6739. This PR adds a `__init__.py` and also fixes the test in a couple ways: - Switch to subclassing `unittest.FederatingHomeserverTestCase` instead, which sets up federation endpoints for us. - Supply a `federation_auth_origin` to `make_request` in order to more act like the request is coming from another server, instead of just an unauthenicated client requesting a federation endpoint. I found that the second point makes no difference to the test passing, but felt like the right thing to do if we're testing over federation.
* Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-153-11/+7
| | | | This was never used, so let's get rid of it.
* Remove redundant `HomeserverTestCase.render`Richard van der Hoff2020-11-163-7/+0
|
* Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup (#8322)reivilibre2020-09-181-0/+99
| | | | | | | | | | Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Fix _set_destination_retry_timings This came about because the code assumed that retry_interval could not be NULL — which has been challenged by catch-up.
* Catch-up after Federation Outage (split, 4): catch-up loop (#8272)reivilibre2020-09-151-0/+165
|
* Merge tag 'v1.20.0rc3' into developPatrick Cloke2020-09-111-0/+33
|\ | | | | | | | | | | | | | | | | | | Synapse 1.20.0rc3 (2020-09-11) ============================== Bugfixes -------- - Fix a bug introduced in v1.20.0rc1 where the wrong exception was raised when invalid JSON data is encountered. ([\#8291](https://github.com/matrix-org/synapse/issues/8291))
| * Fix the exception that is raised when invalid JSON is encountered. (#8291)Patrick Cloke2020-09-101-0/+33
| |
* | Allow for make_awaitable's return value to be re-used. (#8261)Patrick Cloke2020-09-082-21/+11
| |
* | Add tests for `last_successful_stream_ordering` (#8258)reivilibre2020-09-071-0/+76
| |
* | Catch-up after Federation Outage (split, 1) (#8230)reivilibre2020-09-041-0/+82
|/ | | Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Do not yield on awaitables in tests. (#8193)Patrick Cloke2020-08-271-4/+2
|
* Fix unawaited coroutine error in tests. (#8072)Patrick Cloke2020-08-131-10/+20
|
* Convert federation client to async/await. (#7975)Patrick Cloke2020-07-302-15/+16
|
* Option to allow server admins to join complex rooms (#7902)lugino-emeritus2020-07-281-0/+109
| | | | | Fixes #7901. Signed-off-by: Niklas Tittjung <nik_t.01@web.de>
* Convert state resolution to async/await (#7942)Patrick Cloke2020-07-241-12/+7
|
* Add option to enable encryption by default for new rooms (#7639)Andrew Morgan2020-06-101-1/+5
| | | | | | | | | Fixes https://github.com/matrix-org/synapse/issues/2431 Adds config option `encryption_enabled_by_default_for_room_type`, which determines whether encryption should be enabled with the default encryption algorithm in private or public rooms upon creation. Whether the room is private or public is decided based upon the room creation preset that is used. Part of this PR is also pulling out all of the individual instances of `m.megolm.v1.aes-sha2` into a constant variable to eliminate typos ala https://github.com/matrix-org/synapse/pull/7637 Based on #7637
* Fix encryption algorithm typos in tests/comments (#7637)Andrew Morgan2020-06-041-1/+1
| | | | | | | | @uhoreg has confirmed these were both typos. They are only in comments and tests though, rather than anything critical. Introduced in: * https://github.com/matrix-org/synapse/pull/7157 * https://github.com/matrix-org/synapse/pull/5726
* Add ability to wait for replication streams (#7542)Erik Johnston2020-05-221-2/+6
| | | | | | | The idea here is that if an instance persists an event via the replication HTTP API it can return before we receive that event over replication, which can lead to races where code assumes that persisting an event immediately updates various caches (e.g. current state of the room). Most of Synapse doesn't hit such races, so we don't do the waiting automagically, instead we do so where necessary to avoid unnecessary delays. We may decide to change our minds here if it turns out there are a lot of subtle races going on. People probably want to look at this commit by commit.
* Fix device list update stream ids going backward (#7158)Richard van der Hoff2020-04-031-0/+6
| | | | | | | | | | | | | | | | Occasionally we could get a federation device list update transaction which looked like: ``` [ {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D2', 'prev_id': [], 'stream_id': 12, 'deleted': True}}, {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D1', 'prev_id': [12], 'stream_id': 11, 'deleted': True}}, {'edu_type': 'm.device_list_update', 'content': {'user_id': '@user:test', 'device_id': 'D3', 'prev_id': [11], 'stream_id': 13, 'deleted': True}} ] ``` Having `stream_ids` which are lower than `prev_ids` looks odd. It might work (I'm not actually sure), but in any case it doesn't seem like a reasonable thing to expect other implementations to support.
* Rewrite prune_old_outbound_device_pokes for efficiency (#7159)Richard van der Hoff2020-03-301-0/+92
| | | | make sure we clear out all but one update for the user
* Add tests for outbound device pokesRichard van der Hoff2020-03-271-3/+300
|
* Remove spurious "name" parameter to `default_config`Richard van der Hoff2020-03-241-2/+2
| | | | | this is never set to anything other than "test", and is a source of unnecessary boilerplate.
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-1/+1
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Add a `make_event_from_dict` method (#6858)Richard van der Hoff2020-02-071-2/+2
| | | | | | | ... and use it in places where it's trivial to do so. This will make it easier to pass room versions into the FrozenEvent constructors.
* privacy by default for room dir (#6355)Neil Johnson2019-12-041-0/+52
| | | | Ensure that the the default settings for the room directory are that the it is hidden from public view by default.
* Implementation of MSC2314 (#6176)Amber Brown2019-11-283-26/+69
|
* Remove test debugsErik Johnston2019-08-201-1/+0
|
* Room Complexity Client Implementation (#5783)Amber Brown2019-07-301-3/+74
|
* Run Black. (#5482)Amber Brown2019-06-202-25/+25
|
* Implement the SHHS complexity API (#5216)Amber Brown2019-05-301-0/+90
|
* Run Black on the tests again (#5170)Amber Brown2019-05-101-47/+66
|
* Batch up outgoing read-receipts to reduce federation traffic. (#4890)Richard van der Hoff2019-03-201-0/+128
| | | | Rate-limit outgoing read-receipts as per #4730.
* Run black.black2018-08-101-15/+11
|
* run isortAmber Brown2018-07-091-0/+1
|
* Implementation of server_aclsRichard van der Hoff2018-07-042-0/+57
| | | | | ... as described at https://docs.google.com/document/d/1EttUVzjc2DWe2ciw4XPtNpUpIl9lWXGEsy2ewDS7rtw.
* Remove redundated BaseHomeServerErik Johnston2016-01-262-303/+0
|
* copyrightsMatthew Hodgson2016-01-071-1/+1
|
* Update testsErik Johnston2015-11-171-0/+2
|
* Make work in both Maria and SQLite. Fix testsErik Johnston2015-04-011-3/+7
|
* Factor out some of the common homeserver setup code into aMark Haines2015-02-111-8/+3
| | | | setup_test_homeserver function in utils.
* Supply auth_chain along with current state in '/state/', fetch auth events ↵Mark Haines2014-12-181-0/+2
| | | | from a remote server if we are missing some of them
* Fix replication testsErik Johnston2014-12-111-12/+6
|
* fix UTs by telling all the mock stores about the new methods for tracking ↵Matthew Hodgson2014-12-091-0/+5
| | | | retries
* replace user_id with senderMark Haines2014-11-191-0/+3
|
* Merge PDUs and Events into one objectMark Haines2014-11-141-4/+4
|
* SYN-103: Remove "origin" and "destination" keys from edusMark Haines2014-11-131-3/+0
|
* event <-> pdu mappings are now trivial and will soon be scrappedErik Johnston2014-11-041-167/+0
|
* Fix up federation testsErik Johnston2014-11-041-114/+124
|
* Merge branch 'develop' into event_signingMark Haines2014-10-172-7/+7
|\ | | | | | | | | Conflicts: synapse/federation/replication.py
| * keep 'origin_server_ts' as 'ts' in the database to avoid needlessly updating ↵Mark Haines2014-10-171-2/+2
| | | | | | | | schema
| * SPEC-7: Rename 'ts' to 'origin_server_ts'Mark Haines2014-10-172-9/+9
| |
* | Include hashes of previous pdus when referencing themMark Haines2014-10-162-3/+3
| |
* | Sign outgoing PDUs.Mark Haines2014-10-161-3/+10
| |
* | persist hashes and origin signatures for PDUsMark Haines2014-10-151-1/+3
|/
* SYN-103: Ignore the 'origin' key in received EDUs. Instead take the origin ↵Mark Haines2014-10-141-0/+1
| | | | from the transaction itself
* Verify signatures for server2server requestsMark Haines2014-10-131-0/+1
|
* SYN-75 sign at the request level rather than the transaction levelMark Haines2014-10-131-2/+2
|
* Merge branch develop into server2server_signingMark Haines2014-10-131-2/+3
|\ | | | | | | | | Conflicts: synapse/app/homeserver.py
| * Add a keyword argument to get_json to avoid retrying on DNS failures. Rather ↵Mark Haines2014-10-021-2/+3
| | | | | | | | than passing MatrixHttpClient.RETRY_DNS_LOOKUP_FAILURES as a fake query string parameter
* | SYN-75 Verify signatures on server to server transactionsMark Haines2014-09-301-0/+1
| |
* | Sign federation transactionsMark Haines2014-09-241-1/+4
|/
* Fix unit tests after adding extra argument on put_jsonErik Johnston2014-09-151-3/+6
|
* Have all unit tests import from our own subclass of trial's unittest ↵Paul "LeoNerd" Evans2014-09-122-6/+2
| | | | TestCase; set up logging in ONE PLACE ONLY
* fix the copyright holder from matrix.org to OpenMarket Ltd, as matrix.org ↵Matthew Hodgson2014-09-032-2/+2
| | | | hasn't been incorporated in time for launch.
* change the world: make the default matrix API URL prefix /_matrix rather ↵Matthew Hodgson2014-08-311-9/+9
| | | | | | than /matrix to make it easier for existing websites to mount a HS in their namespace without collisions. perl -pi -e 's#/matrix#/_matrix#g' ./cmdclient/console.py ./docs/client-server/howto.rst ./docs/client-server/specification.rst ./docs/client-server/swagger_matrix/directory ./docs/client-server/swagger_matrix/events ./docs/client-server/swagger_matrix/login ./docs/client-server/swagger_matrix/presence ./docs/client-server/swagger_matrix/profile ./docs/client-server/swagger_matrix/registration ./docs/client-server/swagger_matrix/rooms ./docs/server-server/specification.rst ./graph/graph.py ./jsfiddles/create_room_send_msg/demo.js ./jsfiddles/event_stream/demo.js ./jsfiddles/example_app/demo.js ./jsfiddles/register_login/demo.js ./jsfiddles/room_memberships/demo.js ./synapse/api/urls.py ./tests/federation/test_federation.py ./tests/handlers/test_presence.py ./tests/handlers/test_typing.py ./tests/rest/test_events.py ./tests/rest/test_presence.py ./tests/rest/test_profile.py ./tests/rest/test_rooms.py ./webclient/components/fileUpload/file-upload-service.js ./webclient/components/matrix/matrix-service.js
* Move pdu and event persistence into a single persist_event functionMark Haines2014-08-261-1/+1
|
* Rename MockHttpServer to MockHttpResource as it stands for one server ↵Paul "LeoNerd" Evans2014-08-191-9/+9
| | | | resource rather than an entire server
* Removed http_server from HomeServer. Updated unit tests to use either ↵Kegan Dougal2014-08-141-1/+1
| | | | resource_for_federation or resource_for_client depending on what is being tested.
* Move MockClock into tests.utils so we can reüse itPaul "LeoNerd" Evans2014-08-131-11/+1
|
* Define the concept of a 'federation Query'; creating API for making and ↵Paul "LeoNerd" Evans2014-08-131-0/+38
| | | | handling Queries on the Federation's increasingly-inaccurately-named ReplicationLayer
* Namespace all the Federation HTTP URLs to /matrix/federation/v1/...Paul "LeoNerd" Evans2014-08-131-7/+8
|
* add in copyrights to everything, not just the synapse subdir, and add a ↵Matthew Hodgson2014-08-132-0/+28
| | | | copyrighter.pl whilst we're at it
* Reference Matrix Home Servermatrix.org2014-08-123-0/+386