summary refs log tree commit diff
path: root/tests/rest/client/utils.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Return some room data in Sliding Sync `/sync` (#17320)Eric Eastwood2024-07-021-2/+2
| | | | | | - Timeline events - Stripped `invite_state` Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync
* Add Sliding Sync `/sync` endpoint (initial implementation) (#17187)Eric Eastwood2024-06-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575): Sliding Sync This iteration only focuses on returning the list of room IDs in the sliding window API (without sorting/filtering). Rooms appear in the Sliding sync response based on: - `invite`, `join`, `knock`, `ban` membership events - Kicks (`leave` membership events where `sender` is different from the `user_id`/`state_key`) - `newly_left` (rooms that were left during the given token range, > `from_token` and <= `to_token`) - In order for bans/kicks to not show up, you need to `/forget` those rooms. This doesn't modify the event itself though and only adds the `forgotten` flag to `room_memberships` in Synapse. There isn't a way to tell when a room was forgotten at the moment so we can't factor it into the from/to range. ### Example request `POST http://localhost:8008/_matrix/client/unstable/org.matrix.msc3575/sync` ```json { "lists": { "foo-list": { "ranges": [ [0, 99] ], "sort": [ "by_notification_level", "by_recency", "by_name" ], "required_state": [ ["m.room.join_rules", ""], ["m.room.history_visibility", ""], ["m.space.child", "*"] ], "timeline_limit": 100 } } } ``` Response: ```json { "next_pos": "s58_224_0_13_10_1_1_16_0_1", "lists": { "foo-list": { "count": 1, "ops": [ { "op": "SYNC", "range": [0, 99], "room_ids": [ "!MmgikIyFzsuvtnbvVG:my.synapse.linux.server" ] } ] } }, "rooms": {}, "extensions": {} } ```
* Bring auto-accept invite logic into Synapse (#17147)devonh2024-05-211-0/+2
| | | | | | | | | | | | | | This PR ports the logic from the [synapse_auto_accept_invite](https://github.com/matrix-org/synapse-auto-accept-invite) module into synapse. I went with the naive approach of injecting the "module" next to where third party modules are currently loaded. If there is a better/preferred way to handle this, I'm all ears. It wasn't obvious to me if there was a better location to add this logic that would cleanly apply to all incoming invite events. Relies on https://github.com/element-hq/synapse/pull/17166 to fix linter errors.
* Fix bug in `/sync` response for archived rooms (#16932)Richard van der Hoff2024-04-041-7/+11
| | | | | | | | | | | | This PR fixes a very, very niche edge-case, but I've got some more work coming which will otherwise make the problem worse. The bug happens when the syncing user leaves a room, and has a sync filter which includes "left" rooms, but sets the timeline limit to 0. In that case, the state returned in the `state` section is calculated incorrectly. The fix is to pass a token corresponding to the point that the user leaves the room through to `compute_state_delta`.
* Bump black from 23.10.1 to 24.2.0 (#16936)dependabot[bot]2024-03-131-4/+2
|
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+3
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Handle wildcard type filters properly (#14984)Mo Balaa2024-01-221-1/+2
|
* Update license headersPatrick Cloke2023-11-211-13/+16
|
* Register media servlets via regex. (#16419)Patrick Cloke2023-10-061-4/+2
| | | | | This converts the media servlet URLs in the same way as (most) of the rest of Synapse. This will give more flexibility in the versions each endpoint exists under.
* Fix-up type hints in tests/server.py. (#15084)Patrick Cloke2023-02-171-20/+38
| | | | | This file was being ignored by mypy, we remove that and add the missing type hints & deal with any fallout.
* Implement MSC3912: Relation-based redactions (#14260)Brendan Abolivier2022-11-031-0/+37
| | | Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Support OIDC backchannel logouts (#11414)Quentin Gliech2022-10-311-4/+51
| | | | | | | If configured an OIDC IdP can log a user's session out of Synapse when they log out of the identity provider. The IdP sends a request directly to Synapse (and must be configured with an endpoint) when a user logs out.
* Refactor OIDC tests to better mimic an actual OIDC provider. (#13910)Quentin Gliech2022-10-251-65/+71
| | | | | | | | | 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.
* Allow admins to require a manual approval process before new accounts can be ↵Brendan Abolivier2022-09-291-3/+9
| | | | used (using MSC3866) (#13556)
* Use literals in place of `HTTPStatus` constants in tests (#13463)Dirk Klimpel2022-08-051-18/+10
|
* Remove unnecessary `json.dumps` from tests (#13303)Dirk Klimpel2022-07-171-4/+4
|
* Uniformize spam-checker API, part 5: expand other spam-checker callbacks to ↵David Teller2022-07-111-0/+21
| | | | | | return `Tuple[Codes, dict]` (#13044) Signed-off-by: David Teller <davidt@element.io> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Default to `private` room visibility rather than `public` when a client does ↵reivilibre2022-04-011-4/+7
| | | | not specify one, according to spec. (#12350)
* Add type hints to `tests/rest/client` (#12084)Dirk Klimpel2022-02-281-11/+25
|
* Add type hints to `tests/rest/client` (#12072)Dirk Klimpel2022-02-241-32/+53
|
* Add some tests for propagation of device list changes between local users ↵Andrew Morgan2022-02-151-1/+5
| | | | (#11972)
* Allow specifying the application service-specific `user_id` parameter in the ↵reivilibre2022-02-031-5/+26
| | | | `join` test helper. (#11616)
* Test that bans win a join against a race when computing `/sync` response ↵David Robertson2022-01-071-0/+10
| | | | (#11701)
* Misc typing fixes for tests, part 2 of N (#11330)David Robertson2021-11-161-9/+42
|
* Misc typing fixes for `tests`, part 1 of N (#11323)David Robertson2021-11-121-8/+14
| | | | | | | | | | * Annotate HomeserverTestCase.servlets * Correct annotation of federation_auth_origin * Use AnyStr custom_headers instead of a Union This allows (str, str) and (bytes, bytes). This disallows (str, bytes) and (bytes, str) * DomainSpecificString.SIGIL is a ClassVar
* Add knock information in admin exported data (#11171)Rafael Gonçalves2021-10-281-0/+29
| | | Signed-off-by: Rafael Goncalves <rafaelgoncalves@riseup.net>
* Make is_public Optional[bool] for create_room_as test util (#10951) (#10963)AndrewFerr2021-10-041-6/+7
| | | Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
* Add reactor to `SynapseRequest` and fix up types. (#10868)Erik Johnston2021-09-241-1/+1
|
* Allow sending a membership event to unban a user (#10807)Aaron Raimist2021-09-211-0/+11
| | | | | * Allow membership event to unban user Signed-off-by: Aaron Raimist <aaron@raim.ist>
* Flatten tests/rest/client/{v1,v2_alpha} too (#10667)David Robertson2021-08-201-0/+654