summary refs log tree commit diff
path: root/tests/rest (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '3f58fc848' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+84
|\
| * Merge pull request #9150 from Yoric/develop-contextDavid Teller2021-02-081-0/+84
| |\ | | | | | | New API /_synapse/admin/rooms/{roomId}/context/{eventId}
| | * FIXUP: linterDavid Teller2021-01-281-1/+3
| | |
| | * FIXUP: Now testing that the user is admin!David Teller2021-01-281-1/+35
| | |
| | * New API /_synapse/admin/rooms/{roomId}/context/{eventId}David Teller2021-01-281-0/+48
| | | | | | | | | | | | Signed-off-by: David Teller <davidt@element.io>
| * | Merge branch 'erikj/media_spam_checker' into developErik Johnston2021-02-041-0/+94
| |\ \
* | \ \ Merge commit '7e8083eb4' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+94
|\ \ \ \ | | |/ / | |/| |
| * | | Add check_media_file_for_spam spam checker hookErik Johnston2021-02-041-0/+94
| | | |
* | | | Merge commit 'e288499c6' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-4/+12
|\ \ \ \ | | |/ / | |/| |
| * | | Social login UI polish (#9301)Richard van der Hoff2021-02-031-4/+12
| |/ /
* | | Merge commit '261093072' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+15
|\| |
| * | Add an admin API to get the current room state (#9168)Travis Ralston2021-02-021-0/+15
| | | | | | | | | | | | | | | This could arguably replace the existing admin API for `/members`, however that is out of scope of this change. This sort of endpoint is ideal for moderation use cases as well as other applications, such as needing to retrieve various bits of information about a room to perform a task (like syncing power levels between two places). This endpoint exposes nothing more than an admin would be able to access with a `select *` query on their database.
* | | Merge commit '18ab35284' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-222-3/+37
|\| |
| * | Merge branch 'social_login' into developRichard van der Hoff2021-02-012-18/+18
| |\ \
| | * | Replace username picker with a template (#9275)Richard van der Hoff2021-02-011-3/+2
| | | | | | | | | | | | | | | | | | | | There's some prelimiary work here to pull out the construction of a jinja environment to a separate function. I wanted to load the template at display time rather than load time, so that it's easy to update on the fly. Honestly, I think we should do this with all our templates: the risk of ending up with malformed templates is far outweighed by the improved turnaround time for an admin trying to update them.
| * | | Ratelimit invites by room and target user (#9258)Erik Johnston2021-01-291-0/+35
| | | |
* | | | Merge commit '9c715a5f1' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-222-15/+16
|\ \ \ \ | | |/ / | |/| |
| * | | Fix SSO on workers (#9271)Richard van der Hoff2021-02-012-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #8966. * Factor out build_synapse_client_resource_tree Start a function which will mount resources common to all workers. * Move sso init into build_synapse_client_resource_tree ... so that we don't have to do it for each worker * Fix SSO-login-via-a-worker Expose the SSO login endpoints on workers, like the documentation says. * Update workers config for new endpoints Add documentation for endpoints recently added (#8942, #9017, #9262) * remove submit_token from workers endpoints list this *doesn't* work on workers (yet). * changelog * Add a comment about the odd path for SAML2Resource
| * | | Split out a separate endpoint to complete SSO registration (#9262)Richard van der Hoff2021-02-011-1/+13
| | | | | | | | | | | | There are going to be a couple of paths to get to the final step of SSO reg, and I want the URL in the browser to consistent. So, let's move the final step onto a separate path, which we redirect to.
* | | | Merge commit 'e19396d62' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-6/+84
|\ \ \ \ | | |/ / | |/| |
| * | | Ratelimit 3PID /requestToken API (#9238)Erik Johnston2021-01-281-6/+84
| | |/ | |/|
* | | Merge commit '2e537a028' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+92
|\| |
| * | Merge branch 'social_login' into developRichard van der Hoff2021-01-271-0/+92
| |\|
| | * Implement MSC2858 support (#9183)Richard van der Hoff2021-01-271-0/+92
| | | | | | | | | Fixes #8928.
* | | Merge commit 'cee4010f9' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-222-6/+66
|\| |
| * | Add an admin API for shadow-banning users. (#9209)Patrick Cloke2021-01-252-6/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This expands the current shadow-banning feature to be usable via the admin API and adds documentation for it. A shadow-banned users receives successful responses to their client-server API requests, but the events are not propagated into rooms. Shadow-banning a user should be used as a tool of last resort and may lead to confusing or broken behaviour for the client.
* | | Merge commit 'fdf834694' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-1/+24
|\| |
| * | Return a 404 if no valid thumbnail is found. (#9163)Patrick Cloke2021-01-211-1/+24
| | | | | | | | | | | | | | | | | | If no thumbnail of the requested type exists, return a 404 instead of erroring. This doesn't quite match the spec (which does not define what happens if no thumbnail can be found), but is consistent with what Synapse already does.
* | | Merge commit '939ef657c' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-27/+196
|\| |
| * | Add tests for List Users Admin API (#9045)Dirk Klimpel2021-01-211-27/+196
| |/
* | Merge commit '42a8e8137' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-1/+1
|\|
| * Prefix idp_id with "oidc-" (#9189)Richard van der Hoff2021-01-211-1/+1
| | | | | | ... to avoid clashes with other SSO mechanisms
* | Merge commit 'fa50e4bf4' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-9/+0
|\|
| * Give `public_baseurl` a default value (#9159)Richard van der Hoff2021-01-201-9/+0
| |
* | Merge commit '2b467d0b6' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-223-82/+130
|\|
| * Fix bugs in handling clientRedirectUrl, and improve OIDC tests (#9127, #9128)Richard van der Hoff2021-01-182-81/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Factor out a common TestHtmlParser Looks like I'm doing this in a few different places. * Improve OIDC login test Complete the OIDC login flow, rather than giving up halfway through. * Ensure that OIDC login works with multiple OIDC providers * Fix bugs in handling clientRedirectUrl - don't drop duplicate query-params, or params with no value - allow utf-8 in query-params
| * Fix test failure due to bad mergeRichard van der Hoff2021-01-151-1/+3
| | | | | | | | | | | | | | 0dd2649c1 (#9112) changed the signature of `auth_via_oidc`. Meanwhile, 26d10331e (#9091) introduced a new test which relied on the old signature of `auth_via_oidc`. The two branches were never tested together until they landed in develop.
* | Merge commit '9de6b9411' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-1/+1
|\|
* | Merge commit '3e4cdfe5d' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-3/+5
|\|
| * Add an admin API endpoint to protect media. (#9086)Patrick Cloke2021-01-151-3/+5
| | | | | | | | | | | | Protecting media stops it from being quarantined when e.g. all media in a room is quarantined. This is useful for sticker packs and other media that is uploaded by server administrators, but used by many people.
* | Merge commit 'd34c6e127' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-223-7/+111
|\|
| * Improve UsernamePickerTestCase (#9112)Richard van der Hoff2021-01-153-7/+111
| | | | | | | | | | * make the OIDC bits of the test work at a higher level - via the REST api instead of poking the OIDCHandler directly. * Move it to test_login.py, where I think it fits better.
* | Merge commit '20af31088' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+27
|\|
| * Add a test for wrong user returned by SSORichard van der Hoff2021-01-131-0/+27
| |
* | Merge commit '233c8b9fc' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-222-37/+199
|\|
| * Add a test for UI-Auth-via-SSO (#9082)Richard van der Hoff2021-01-132-37/+199
| | | | | | | | | | * Add complete test for UI-Auth-via-SSO. * review comments
* | Merge commit '98a64b7f7' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-228-26/+295
|\|
| * Remove user's avatar URL and displayname when deactivated. (#8932)Dirk Klimpel2021-01-123-3/+228
| | | | | | This only applies if the user's data is to be erased.
| * Also support remote users on the joined_rooms admin API. (#8948)David Teller2021-01-111-6/+52
| | | | | | | | For remote users, only the rooms which the server knows about are returned. Local users have all of their joined rooms returned.
| * Removes unnecessary declarations in the tests for the admin API. (#9063)Dirk Klimpel2021-01-116-17/+0
| |
* | Merge commit 'a03d71dc9' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-212-36/+249
|\|
| * Add some tests for the IDP picker flowRichard van der Hoff2021-01-072-3/+191
| |
| * Fix type hints in test_login.pyRichard van der Hoff2021-01-071-24/+54
| |
| * black-format tests/rest/client/v1/test_login.pyRichard van der Hoff2021-01-071-11/+6
| | | | | | | | | | black seems to want to reformat this, despite `black --check` being happy with it :/
* | Merge commit '23d701864' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-213-11/+33
|\|
| * Skip unit tests which require optional dependencies (#9031)Richard van der Hoff2021-01-073-11/+33
| | | | | | If we are lacking an optional dependency, skip the tests that rely on it.
* | Merge commit '0312266ee' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-211-1/+1
|\|
| * Combine the SSO Redirect Servlets (#9015)Richard van der Hoff2021-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement CasHandler.handle_redirect_request ... to make it match OidcHandler and SamlHandler * Clean up interface for OidcHandler.handle_redirect_request Make it accept `client_redirect_url=None`. * Clean up interface for `SamlHandler.handle_redirect_request` ... bring it into line with CAS and OIDC by making it take a Request parameter, move the magic for `client_redirect_url` for UIA into the handler, and fix the return type to be a `str` rather than a `bytes`. * Define a common protocol for SSO auth provider impls * Give SsoIdentityProvider an ID and register them * Combine the SSO Redirect servlets Now that the SsoHandler knows about the identity providers, we can combine the various *RedirectServlets into a single implementation which delegates to the right IdP. * changelog
* | Merge commit '9999eb2d0' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-211-1/+0
|\|
| * Drop the unused local_invites table. (#8979)Patrick Cloke2020-12-291-1/+0
| | | | | | This table has been unused since Synapse v1.17.0.
| * Support PyJWT v2.0.0. (#8986)Patrick Cloke2020-12-221-4/+12
| | | | | | | | Tests were broken due to an API changing. The code used in Synapse proper should be compatible with both versions already.
* | Merge commit '4218473f9' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-211-0/+138
|\|
| * Allow server admin to get admin bit in rooms where local user is an admin ↵Erik Johnston2020-12-181-0/+138
| | | | | | | | | | | | | | (#8756) This adds an admin API that allows a server admin to get power in a room if a local user has power in a room. Will also invite the user if they're not in the room and its a private room. Can specify another user (rather than the admin user) to be granted power. Co-authored-by: Matthew Hodgson <matthew@matrix.org>
* | Merge commit '28877fade' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-211-31/+63
|\|
| * Allow re-using a UI auth validation for a period of time (#8970)Patrick Cloke2020-12-181-31/+63
| |
* | Merge commit 'c9c1c9d82' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-202-4/+152
|\|
| * Fix `UsersListTestCase` (#8964)Richard van der Hoff2020-12-171-6/+4
| |
| * Fix a bug that deactivated users appear in the directory (#8933)Dirk Klimpel2020-12-171-1/+49
| | | | | | | | | | | | | | | | | | | | Fixes a bug that deactivated users appear in the directory when their profile information was updated. To change profile information of deactivated users is neccesary for example you will remove displayname or avatar. But they should not appear in directory. They are deactivated. Co-authored-by: Erik Johnston <erikj@jki.re>
| * Make search statement in List Room and User Admin API case-insensitive (#8931)Dirk Klimpel2020-12-172-3/+105
| |
* | Fix old-style uses of self.make_request in dinum test codeAndrew Morgan2021-04-164-51/+31
| |
* | Merge commit 'bd30cfe86' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-1636-888/+679
|\|
| * Convert internal pusher dicts to attrs classes. (#8940)Patrick Cloke2020-12-161-1/+1
| | | | | | This improves type hinting and should use less memory.
| * Merge pull request #8951 from matrix-org/rav/username_picker_2Richard van der Hoff2020-12-161-1/+1
| |\ | | | | | | More preparatory refactoring of the OidcHandler tests
| * | lintRichard van der Hoff2020-12-152-2/+1
| | |
| * | Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-1536-861/+660
| | | | | | | | | | | | This was never used, so let's get rid of it.
| * | Remove redundant reading of SynapseRequest.argsRichard van der Hoff2020-12-151-9/+1
| | | | | | | | | | | | this didn't seem to be doing a lot, so remove it.
| * | remove 'response' result from `_get_shared_rooms`Richard van der Hoff2020-12-151-8/+9
| | |
| * | Replace `request.code` with `channel.code`Richard van der Hoff2020-12-155-11/+11
| | | | | | | | | | | | | | | | | | The two are equivalent, but really we want to check the HTTP result that got returned to the channel, not the code that the Request object *intended* to return to the channel.
* | | Merge commit '8388a7fb3' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-161-1/+1
|\ \ \ | | |/ | |/|
| * | Test `get_extra_attributes` fallbackRichard van der Hoff2020-12-151-1/+1
| |/ | | | | | | | | despite the warnings saying "don't implement get_extra_attributes", we had implemented it, so the tests weren't doing what we thought they were.
* | Merge commit 'f14428b25' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-162-0/+50
|\|
| * Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-0/+34
| |
| * Don't ratelimit autojoining of rooms (#8921)Erik Johnston2020-12-111-0/+16
| | | | | | Fixes #8866
* | Merge commit 'cf7d3c90d' into dinsicAndrew Morgan2021-04-166-46/+213
|\|
| * Add X-Robots-Tag header to stop crawlers from indexing media (#8887)Aaron Raimist2020-12-081-0/+13
| | | | | | | | | | | | | | Fixes / related to: https://github.com/matrix-org/synapse/issues/6533 This should do essentially the same thing as a robots.txt file telling robots to not index the media repo. https://developers.google.com/search/reference/robots_meta_tag Signed-off-by: Aaron Raimist <aaron@raim.ist>
| * Call set_avatar_url with target_user, not user_id (#8872)Will Hunt2020-12-071-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Call set_avatar_url with target_user, not user_id Fixes https://github.com/matrix-org/synapse/issues/8871 * Create 8872.bugfix * Update synapse/rest/admin/users.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Testing * Update changelog.d/8872.bugfix Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
| * Add additional validation to pusher URLs. (#8865)Patrick Cloke2020-12-041-1/+1
| | | | | | | | Pusher URLs now must end in `/_matrix/push/v1/notify` per the specification.
| * Fix errorcode for disabled registration (#8867)Richard van der Hoff2020-12-031-0/+1
| | | | | | | | The spec says we should return `M_FORBIDDEN` when someone tries to register and registration is disabled.
| * Merge pull request #8858 from matrix-org/rav/sso_uiaRichard van der Hoff2020-12-022-18/+192
| |\ | | | | | | UIA: offer only available auth flows
| | * UIA: offer only available auth flowsRichard van der Hoff2020-12-022-18/+192
| | | | | | | | | | | | | | | | | | | | | During user-interactive auth, do not offer password auth to users with no password, nor SSO auth to users with no SSO. Fixes #7559.
| * | remove unused FakeResponse (#8864)Richard van der Hoff2020-12-021-26/+0
| | |
| * | Apply an IP range blacklist to push and key revocation requests. (#8821)Patrick Cloke2020-12-027-8/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | Replaces the `federation_ip_range_blacklist` configuration setting with an `ip_range_blacklist` setting with wider scope. It now applies to: * Federation * Identity servers * Push notifications * Checking key validitity for third-party invite events The old `federation_ip_range_blacklist` setting is still honored if present, but with reduced scope (it only applies to federation and identity servers).
* | Stabilise all knock-related unstable identifiers that would be in state (#96)Andrew Morgan2021-03-231-3/+8
| |
* | Port "Add support for no_proxy and case insensitive env variables" from ↵Andrew Morgan2021-03-227-8/+8
| | | | | | | | | | | | | | mainline to dinsic (#93) This PR is simply porting https://github.com/matrix-org/synapse/pull/9372 to dinsic. I also had to bring in https://github.com/matrix-org/synapse/pull/8821 and https://github.com/matrix-org/synapse/pull/9084 for this code to work properly - a sign that we should merge mainline into dinsic again soon.
* | Change knock room version to v7 (#88)Andrew Morgan2021-03-181-1/+2
| |
* | Add knocking support (#81)Andrew Morgan2021-02-091-2/+89
| | | | | | | | | | | | | | | | | | Implement knocking as defined by https://github.com/matrix-org/matrix-doc/pull/2403 This is the base knocking stuff, taken from https://github.com/matrix-org/synapse/pull/6739 and does not include any public room directory changes. While knocking hasn't merged yet on mainline due to waiting on getting Complement into Synapse's CI, the code has been well-tested.
* | Add a parameter to enable/disable freeze feature (#78)Mathieu Velten2021-01-211-0/+1
| |
* | Ensure we read account validity templates from custom template dir if ↵Andrew Morgan2021-01-191-0/+51
| | | | | | | | provided (#77)
* | Merge commit 'd3ed93504' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-312-10/+50
|\|
| * Allow specifying room version in 'RestHelper.create_room_as' and add typing ↵Andrew Morgan2020-12-021-2/+25
| | | | | | | | | | (#8854) This PR adds a `room_version` argument to the `RestHelper`'s `create_room_as` function for tests. I plan to use this for testing knocking, which currently uses an unstable room version.
| * Support "identifier" dicts in UIA (#8848)Richard van der Hoff2020-12-011-8/+25
| | | | | | | | | | | | | | | | | | | | The spec requires synapse to support `identifier` dicts for `m.login.password` user-interactive auth, which it did not (instead, it required an undocumented `user` parameter.) To fix this properly, we need to pull the code that interprets `identifier` into `AuthHandler.validate_login` so that it can be called from the UIA code. Fixes #5665.
* | Merge commit '09ac0569f' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-313-10/+12
|\|
| * Fix broken testcase (#8851)Richard van der Hoff2020-12-011-1/+0
| | | | | | | | This test was broken by #8565. It doesn't need to set set `self.clock` here anyway - that is done by `setUp`.
| * Simplify the way the `HomeServer` object caches its internal attributes. ↵Jonathan de Jong2020-11-302-9/+12
| | | | | | | | | | (#8565) Changes `@cache_in_self` to use underscore-prefixed attributes.
* | Merge commit '7c4344747' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-314-10/+118
|\|
| * Remove deprecated `/_matrix/client/*/admin` endpoints (#8785)Dirk Klimpel2020-11-254-7/+115
| | | | | | These are now only available via `/_synapse/admin/v1`.
| * Fix tests on develop (#8777)Erik Johnston2020-11-181-16/+0
| | | | | | This was broken due to #8617 and #8761.
| * Merge pull request #8761 from matrix-org/rav/test_request_renderingRichard van der Hoff2020-11-1736-678/+57
| |\ | | | | | | Make `make_request` actually render the request
| * | Add admin API for logging in as a user (#8617)Erik Johnston2020-11-171-2/+243
| | |
* | | Merged commit 'deff8f628' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-313-27/+232
| | |
* | | Merge commit 'acfe3b306' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-3135-630/+20
|\ \ \ | | |/ | |/|
| * | Remove redundant `HomeserverTestCase.render`Richard van der Hoff2020-11-1632-587/+0
| | |
| * | Remove redundant calls to `render()`Richard van der Hoff2020-11-163-20/+8
| | |
* | | Merge commit '129ae841e' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-317-90/+120
|\| |
| * | Make `make_request` actually render the requestRichard van der Hoff2020-11-166-59/+34
| | | | | | | | | | | | | | | | | | remove the stubbing out of `request.process`, so that `requestReceived` also renders the request via the appropriate resource. Replace render() with a stub for now.
| * | Fix the URL in the URL preview testsRichard van der Hoff2020-11-161-19/+22
| |/ | | | | | | the preview resource is mointed at preview_url, not url_preview
| * Merge pull request #8757 from matrix-org/rav/pass_site_to_make_requestRichard van der Hoff2020-11-166-29/+97
| |\ | | | | | | Pass a Site into `make_request`
| | * Merge branch 'develop' into rav/pass_site_to_make_requestRichard van der Hoff2020-11-165-13/+7
| | |\
| | * | use global make_request() directly where we have a custom ResourceRichard van der Hoff2020-11-155-19/+71
| | | | | | | | | | | | | | | | | | | | | | | | Where we want to render a request against a specific Resource, call the global make_request() function rather than the one in HomeserverTestCase, allowing us to pass in an appropriate `Site`.
* | | | Merge commit 'f12589547' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-315-16/+10
|\| | |
| * | | Move `wait_until_result` into `FakeChannel` (#8758)Richard van der Hoff2020-11-161-3/+3
| | |/ | |/| | | | | | | FakeChannel has everything we need, and this more accurately models the real flow.
| * | Rename `create_test_json_resource` to `create_test_resource` (#8759)Richard van der Hoff2020-11-164-10/+6
| | | | | | | | | | | | | | | The root resource isn't necessarily a JsonResource, so rename this method accordingly, and update a couple of test classes to use the method rather than directly manipulating self.resource.
| * | Add a `custom_headers` param to `make_request` (#8760)Richard van der Hoff2020-11-161-4/+6
| | | | | | | | | | | | Some tests want to set some custom HTTP request headers, so provide a way to do that before calling requestReceived().
* | | Merge commit '9debe657a' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-11/+31
|\ \ \ | | |/ | |/|
| * | pass a Site into make_requestRichard van der Hoff2020-11-151-6/+25
| | |
| * | pass a Site into RestHelperRichard van der Hoff2020-11-151-5/+6
| |/
* | Merge commit 'c3119d153' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-313-69/+642
|\|
| * Add an admin API for users' media statistics (#8700)Dirk Klimpel2020-11-051-0/+485
| | | | | | | | | | | | | | | | Add `GET /_synapse/admin/v1/statistics/users/media` to get statisics about local media usage by users. Related to #6094 It is the first API for statistics. Goal is to avoid/reduce usage of sql queries like [Wiki analyzing Synapse](https://github.com/matrix-org/synapse/wiki/SQL-for-analyzing-Synapse-PostgreSQL-database-stats) Signed-off-by: Dirk Klimpel dirk@klimpel.org
| * Add `displayname` to Shared-Secret Registration for admins (#8722)Dirk Klimpel2020-11-051-2/+119
| | | | | | Add `displayname` to Shared-Secret Registration for admins to `POST /_synapse/admin/v1/register`
| * Consolidate purge table lists to prevent desyncronisation (#8713)Andrew Morgan2020-11-041-67/+38
| | | | | | I idly noticed that these lists were out of sync with each other, causing us to miss a table in a test case (`local_invites`). Let's consolidate this list instead to prevent this from happening in the future.
* | Merge commit 'ef2d62701' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-312-1/+2
|\|
| * Fix unit tests (#8689)Erik Johnston2020-10-291-1/+1
| | | | | | | | | | * Fix unit tests * Newsfile
| * Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | another user. (#8616) We do it this way round so that only the "owner" can delete the access token (i.e. `/logout/all` by the "owner" also deletes that token, but `/logout/all` by the "target user" doesn't). A future PR will add an API for creating such a token. When the target user and authenticated entity are different the `Processed request` log line will be logged with a: `{@admin:server as @bob:server} ...`. I'm not convinced by that format (especially since it adds spaces in there, making it harder to use `cut -d ' '` to chop off the start of log lines). Suggestions welcome.
* | Merge commit 'c97da1e45' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-0/+124
|\|
| * Add an admin APIs to allow server admins to list users' pushers (#8610)Dirk Klimpel2020-10-281-0/+124
| | | | | | Add an admin API `GET /_synapse/admin/v1/users/<user_id>/pushers` like https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushers
* | Merge commit '88e1d0c52' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-0/+282
|\|
| * Add admin API to list users' local media (#8647)Dirk Klimpel2020-10-271-0/+282
| | | | | | Add admin API `GET /_synapse/admin/v1/users/<user_id>/media` to get information of users' uploaded files.
* | Merge commit '24229fac0' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-314-14/+783
|\|
| * Split admin API for reported events into a detail and a list view (#8539)Dirk Klimpel2020-10-261-13/+183
| | | | | | | | | | | | | | | | | | | | | | | | Split admin API for reported events in detail und list view. API was introduced with #8217 in synapse v.1.21.0. It makes the list (`GET /_synapse/admin/v1/event_reports`) less complex and provides a better overview. The details can be queried with: `GET /_synapse/admin/v1/event_reports/<report_id>`. It is similar to room and users API. It is a kind of regression in `GET /_synapse/admin/v1/event_reports`. `event_json` was removed. But the api was introduced one version before and it is an admin API (not under spec). Signed-off-by: Dirk Klimpel dirk@klimpel.org
| * Add an admin api to delete local media. (#8519)Dirk Klimpel2020-10-261-0/+568
| | | | | | | | | | | | Related to: #6459, #3479 Add `DELETE /_synapse/admin/v1/media/<server_name>/<media_id>` to delete a single file from server.
| * Fix a bug in the joined_rooms admin API (#8643)Dirk Klimpel2020-10-261-1/+15
| | | | | | | | If the user was not in any rooms then the API returned the same error as if the user did not exist.
| * Add field `total` to device list in admin API (#8644)Dirk Klimpel2020-10-261-0/+17
| |
* | Merge commit 'de5cafe98' into dinsicAndrew Morgan2020-12-313-43/+13
|\|
| * Remove some extraneous @unittest.INFOs on unit tests (#8592)Andrew Morgan2020-10-202-2/+0
| |
* | Merge commit '3ee17585c' into dinsicAndrew Morgan2020-12-311-4/+24
|\|
| * guard against accidental modificationRichard van der Hoff2020-10-131-0/+20
| |
| * Allow ThirdPartyRules modules to replace event contentRichard van der Hoff2020-10-131-4/+4
| | | | | | | | Support returning a new event dict from `check_event_allowed`.
* | Merge commit '74976a8e4' into dinsicAndrew Morgan2020-12-319-96/+191
|\|
| * Fix message duplication if something goes wrong after persisting the event ↵Erik Johnston2020-10-131-1/+1
| | | | | | | | | | (#8476) Should fix #3365.
| * Allow modules to create and send events into rooms (#8479)Andrew Morgan2020-10-091-1/+27
| | | | | | | | | | This PR allows Synapse modules making use of the `ModuleApi` to create and send non-membership events into a room. This can useful to have modules send messages, or change power levels in a room etc. Note that they must send event through a user that's already in the room. The non-membership event limitation is currently arbitrary, as it's another chunk of work and not necessary at the moment.
| * Remove the deprecated Handlers object (#8494)Patrick Cloke2020-10-094-4/+8
| | | | | | All handlers now available via get_*_handler() methods on the HomeServer.
| * Additional tests for third-party event rules (#8468)Richard van der Hoff2020-10-061-13/+71
| | | | | | | | | | | | | | | | | | * Optimise and test state fetching for 3p event rules Getting all the events at once is much more efficient than getting them individually * Test that 3p event rules can modify events
| * Merge pull request #8467 from matrix-org/rav/fix_3pevent_rulesRichard van der Hoff2020-10-061-1/+1
| |\ | | | | | | Fix third-party event modules for `check_visibility_can_be_modified` check
| | * Fix third-party event modules for `check_visibility_can_be_modified` checkRichard van der Hoff2020-10-051-1/+1
| | | | | | | | | | | | | | | | | | PR #8292 tried to maintain backwards compat with modules which don't provide a `check_visibility_can_be_modified` method, but the tests weren't being run, and the check didn't work.
| * | Update default room version to 6 (#8461)Richard van der Hoff2020-10-051-1/+10
| |/ | | | | | | Per https://github.com/matrix-org/matrix-doc/pull/2788
| * Allow ThirdPartyEventRules modules to manipulate public room state (#8292)Andrew Morgan2020-10-051-12/+19
| | | | | | | | | | This PR allows `ThirdPartyEventRules` modules to view, manipulate and block changes to the state of whether a room is published in the public rooms directory. While the idea of whether a room is in the public rooms list is not kept within an event in the room, `ThirdPartyEventRules` generally deal with controlling which modifications can happen to a room. Public rooms fits within that idea, even if its toggle state isn't controlled through a state event.
* | Allow users to click account renewal links multiple times without hitting an ↵Andrew Morgan2020-12-301-17/+36
| | | | | | | | 'Invalid Token' page (#74)
* | Support PyJWT v2.0.0. (#8986)Patrick Cloke2020-12-291-4/+12
| | | | | | | | Tests were broken due to an API changing. The code used in Synapse proper should be compatible with both versions already.
* | Override any missing default power level keys with DINUM's defaults when ↵Andrew Morgan2020-10-291-0/+47
| | | | | | | | | | | | | | creating a room (#68) The createRoom flow in DINUM's Synapse (through the AccessRules module which has hooks for all of this) already rejects a power levels content dict if it doesn't have high enough power levels to satisfy DINUM's [requirements](https://github.com/matrix-org/synapse-dinsic/blob/ac50ed353b5fdbdf9f853be0d94b6fccaf33973e/synapse/third_party_rules/access_rules.py#L233-L252). This PR ensures that any keys that aren't provided are replaced with the defaults, instead of just assuming the whole dict was correct (and thus those keys were set to mainline Synapse's default instead).
* | Merge commit 'cc40a59b4' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-211-4/+18
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'cc40a59b4': 1.21.0 Add prometheus metrics to track federation delays (#8430) Make token serializing/deserializing async (#8427) Allow additional SSO properties to be passed to the client (#8413) changelog Add an improved "forward extremities" metric Rewrite BucketCollector Fix _exposition.py to stop stripping samples Drop support for ancient prometheus_client (#8426) Various clean ups to room stream tokens. (#8423) changelog Report state res metrics to Prometheus and log Move Measure calls into `resolve_events_with_store` Expose a `get_resource_usage` method in `Measure` Move `resolve_events_with_store` into StateResolutionHandler
| * Make token serializing/deserializing async (#8427)Erik Johnston2020-09-301-8/+22
| | | | | | The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
| * Various clean ups to room stream tokens. (#8423)Erik Johnston2020-09-291-4/+4
| |
* | Merge commit 'f43c66d23' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-211-0/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f43c66d23': Add support for running Complement against the local checkout (#8317) Filter out appservices from mau count (#8404) Only assert valid next_link params when provided (#8417) Add metrics to track success/otherwise of replication requests (#8406) Fix handling of connection timeouts in outgoing http requests (#8400) Changelog Don't check whether a 3pid is allowed to register during password reset Add checks for postgres sequence consistency (#8402) Create a mechanism for marking tests "logcontext clean" (#8399) Add `ui_auth_sessions_ips` table to `synapse_port_db` ignore list (#8410) A pair of tiny cleanups in the federation request code. (#8401) typo
| * Only assert valid next_link params when provided (#8417)Andrew Morgan2020-09-291-0/+6
| | | | | | | | | | | | | | Broken in https://github.com/matrix-org/synapse/pull/8275 and has yet to be put in a release. Fixes https://github.com/matrix-org/synapse/issues/8418. `next_link` is an optional parameter. However, we were checking whether the `next_link` param was valid, even if it wasn't provided. In that case, `next_link` was `None`, which would clearly not be a valid URL. This would prevent password reset and other operations if `next_link` was not provided, and the `next_link_domain_whitelist` config option was set.
* | Merge commit '4325be1a5' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-215-5/+625
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4325be1a5': Fix missing null character check on guest_access room state Fixed a bug with reactivating users with the admin API (#8362) Admin API for reported events (#8217) Fix wording of deprecation notice in changelog Deprecation warning for synapse admin api being accessible under /_matrix Create function to check for long names in devices (#8364) Add a comment re #1691 Fix a bad merge from release-v1.20.0. (#8354) Admin API for querying rooms where a user is a member (#8306) Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup (#8322) Simplify super() calls to Python 3 syntax. (#8344) Allow appservice users to /login (#8320) Update test logging to be able to accept braces (#8335) Move lint dependencies to extras_require (#8330)
| * Fixed a bug with reactivating users with the admin API (#8362)Dirk Klimpel2020-09-221-0/+14
| | | | | | | | | | | | | | Fixes: #8359 Trying to reactivate a user with the admin API (`PUT /_synapse/admin/v2/users/<user_name>`) causes an internal server error. Seems to be a regression in #8033.
| * Admin API for reported events (#8217)Dirk Klimpel2020-09-221-0/+382
| | | | | | Add an admin API to read entries of table `event_reports`. API: `GET /_synapse/admin/v1/event_reports`
| * Create function to check for long names in devices (#8364)Dionysis Grigoropoulos2020-09-221-1/+1
| | | | | | | | | | | | | | | | | | * Create a new function to verify that the length of a device name is under a certain threshold. * Refactor old code and tests to use said function. * Verify device name length during registration of device * Add a test for the above Signed-off-by: Dionysis Grigoropoulos <dgrig@erethon.com>
| * Admin API for querying rooms where a user is a member (#8306)Dirk Klimpel2020-09-181-2/+94
| | | | | | | | Add a new admin API `GET /_synapse/admin/v1/users/<user_id>/joined_rooms` to list all rooms where a user is a member.
| * Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | | | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
| * Allow appservice users to /login (#8320)Will Hunt2020-09-181-1/+133
| | | | | | | | | | Add ability for ASes to /login using the `uk.half-shot.msc2778.login.application_service` login `type`. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* | Merge commit '837293c31' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '837293c31': Remove obsolete __future__ imports (#8337) Use admin_patterns for all admin APIs. (#8331) Fix a potential bug of UnboundLocalError (#8329) Switch metaclass initialization to python 3-compatible syntax (#8326) Catch-up after Federation Outage (split, 4): catch-up loop (#8272) Use slots in attrs classes where possible (#8296) Fix typos in comments. Add the topic and avatar to the room details admin API (#8305) Improve SAML error messages (#8248) Add experimental support for sharding event persister. Again. (#8294) Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281) Use TLSv1.2 for fake servers in tests (#8208) Add /_synapse/client to the reverse proxy docs (#8227) Clean up `Notifier.on_new_room_event` code path (#8288)
| * Add the topic and avatar to the room details admin API (#8305)Tulir Asokan2020-09-141-0/+2
| |
* | Merge commit 'a3a90ee03' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-202-11/+57
|\| | | | | | | | | | | | | | | | | | | * commit 'a3a90ee03': Show a confirmation page during user password reset (#8004) Do not error when thumbnailing invalid files (#8236) Remove some unused distributor signals (#8216) Fixup pusher pool notifications (#8287) Revert "Fixup pusher pool notifications" Fixup pusher pool notifications
| * Show a confirmation page during user password reset (#8004)Andrew Morgan2020-09-101-1/+28
| | | | | | | | | | This PR adds a confirmation step to resetting your user password between clicking the link in your email and your password actually being reset. This is to better align our password reset flow with the industry standard of requiring a confirmation from the user after email validation.
| * Do not error when thumbnailing invalid files (#8236)Patrick Cloke2020-09-091-10/+29
| | | | | | | | If a file cannot be thumbnailed for some reason (e.g. the file is empty), then catch the exception and convert it to a reasonable error message for the client.
* | Merge commit '453dfe210' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-0/+448
|\| | | | | | | | | | | * commit '453dfe210': blacklist MSC2753 sytests until it's implemented in synapse (#8285) Don't remember `enabled` of deleted push rules and properly return 404 for missing push rules in `.../actions` and `.../enabled` (#7796)
| * Don't remember `enabled` of deleted push rules and properly return 404 for ↵reivilibre2020-09-091-0/+448
| | | | | | | | | | | | | | missing push rules in `.../actions` and `.../enabled` (#7796) Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
| * Add a config option for validating 'next_link' parameters against a domain ↵Andrew Morgan2020-09-081-7/+96
| | | | | | | | | | | | | | | | | | | | | | whitelist (#8275) This is a config option ported over from DINUM's Sydent: https://github.com/matrix-org/sydent/pull/285 They've switched to validating 3PIDs via Synapse rather than Sydent, and would like to retain this functionality. This original purpose for this change is phishing prevention. This solution could also potentially be replaced by a similar one to https://github.com/matrix-org/synapse/pull/8004, but across all `*/submit_token` endpoint. This option may still be useful to enterprise even with that safeguard in place though, if they want to be absolutely sure that their employees don't follow links to other domains.
* | Merge commit 'cca03dbec' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-3/+3
|\| | | | | | | | | | | | | | | | | * commit 'cca03dbec': fix typo s/fixes/fix/ Directly import json from the standard library. (#8259) Allow for make_awaitable's return value to be re-used. (#8261) Rename 'populate_stats_process_rooms_2' background job back to 'populate_stats_process_rooms' again (#8243)
| * Allow for make_awaitable's return value to be re-used. (#8261)Patrick Cloke2020-09-081-3/+3
| |
* | Merge commit '17fa4c7ca' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-204-174/+90
|\| | | | | | | | | | | | | | | * commit '17fa4c7ca': Catch up after Federation Outage (split, 2): Track last successful stream ordering after transmission (#8247) Catch-up after Federation Outage (split, 1) (#8230) Fix type signature in simple_select_one_onecol and friends (#8241) Stop sub-classing object (#8249)
| * Stop sub-classing object (#8249)Patrick Cloke2020-09-043-5/+5
| |
* | Merge commit '112266eaf' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-2/+155
|\| | | | | | | | | | | * commit '112266eaf': Add StreamStore to mypy (#8232) Re-implement unread counts (again) (#8059)
| * Re-implement unread counts (again) (#8059)Brendan Abolivier2020-09-021-2/+155
| |
* | Merge commit '0d4f614fd' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-0/+138
|\| | | | | | | | | | | | | | | | | * commit '0d4f614fd': Refactor `_get_e2e_device_keys_for_federation_query_txn` (#8225) Add experimental support for sharding event persister. (#8170) Add /user/{user_id}/shared_rooms/ api (#7785) Do not try to store invalid data in the stats table (#8226) Convert the main methods run by the reactor to async. (#8213)
| * Add /user/{user_id}/shared_rooms/ api (#7785)Will Hunt2020-09-021-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add shared_rooms api * Add changelog * Add . * Wrap response in {"rooms": } * linting * Add unstable_features key * Remove options from isort that aren't part of 5.x `-y` and `-rc` are now default behaviour and no longer exist. `dont-skip` is no longer required https://timothycrosley.github.io/isort/CHANGELOG/#500-penny-july-4-2020 * Update imports to make isort happy * Add changelog * Update tox.ini file with correct invocation * fix linting again for isort * Vendor prefix unstable API * Fix to match spec * import Codes * import Codes * Use FORBIDDEN * Update changelog.d/7785.feature Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Implement get_shared_rooms_for_users * a comma * trailing whitespace * Handle the easy feedback * Switch to using runInteraction * Add tests * Feedback * Seperate unstable endpoint from v2 * Add upgrade node * a line * Fix style by adding a blank line at EOF. * Update synapse/storage/databases/main/user_directory.py Co-authored-by: Tulir Asokan <tulir@maunium.net> * Update synapse/storage/databases/main/user_directory.py Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Update UPGRADE.rst Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Fix UPGRADE/CHANGELOG unstable paths unstable unstable unstable Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Tulir Asokan <tulir@maunium.net> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Tulir Asokan <tulir@maunium.net>
* | Merge commit 'e00816ad9' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-2/+6
|\| | | | | | | | | * commit 'e00816ad9': Do not yield on awaitables in tests. (#8193)
| * Do not yield on awaitables in tests. (#8193)Patrick Cloke2020-08-271-2/+6
| |
* | Merge commit 'b49a5b930' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-5/+4
|\| | | | | | | | | * commit 'b49a5b930': Convert stats and related calls to async/await (#8192)
| * Convert stats and related calls to async/await (#8192)Patrick Cloke2020-08-271-5/+4
| |
* | Merge commit 'a466b6797' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-203-158/+315
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a466b6797': Reduce run-times of tests by advancing the reactor less (#7757) Update debian systemd service to use Type=notify (#8169) Remove remaining is_guest argument uses from get_room_data calls (#8181) Do not propagate typing notifications from shadow-banned users. (#8176) Remove unused parameter from, and add safeguard in, get_room_data (#8174) Add required Debian dependencies to allow docker builds on the arm platform (#8144) Allow running mypy directly. (#8175) Update the test federation client to handle streaming responses (#8130) Do not propagate profile changes of shadow-banned users into rooms. (#8157) Make SlavedIdTracker.advance have same interface as MultiWriterIDGenerator (#8171) Convert simple_select_one and simple_select_one_onecol to async (#8162)
| * Remove remaining is_guest argument uses from get_room_data calls (#8181)Andrew Morgan2020-08-261-10/+2
| | | | | | | | | | | | | | #8174 removed the `is_guest` parameter from `get_room_data`, at the same time that #8157 was merged using it, colliding together to break unit tests on develop. This PR removes the `is_guest` parameter from the call in the broken test. Uses the same changelog as #8174.
| * Do not propagate typing notifications from shadow-banned users. (#8176)Patrick Cloke2020-08-261-0/+48
| |
| * Remove unused parameter from, and add safeguard in, get_room_data (#8174)Andrew Morgan2020-08-261-1/+1
| | | | | | | | | | | | Small cleanup PR. * Removed the unused `is_guest` argument * Added a safeguard to a (currently) impossible code path, fixing static checking at the same time.
| * Do not propagate profile changes of shadow-banned users into rooms. (#8157)Patrick Cloke2020-08-262-157/+274
| |
* | Merge commit '56efa9ec7' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-202-43/+237
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '56efa9ec7': (22 commits) Fix rate limiting unit tests. (#8167) Add functions to `MultiWriterIdGen` used by events stream (#8164) Do not allow send_nonmember_event to be called with shadow-banned users. (#8158) Changelog fixes Make StreamIdGen `get_next` and `get_next_mult` async (#8161) Wording fixes to 'name' user admin api filter (#8163) Fix missing double-backtick in RST document Search in columns 'name' and 'displayname' in the admin users endpoint (#7377) Add type hints for state. (#8140) Stop shadow-banned users from sending non-member events. (#8142) Allow capping a room's retention policy (#8104) Add healthcheck for default localhost 8008 port on /health endpoint. (#8147) Fix flaky shadow-ban tests. (#8152) Don't fail /submit_token requests on incorrect session ID if request_token_inhibit_3pid_errors is turned on (#7991) Do not apply ratelimiting on joins to appservices (#8139) Micro-optimisations to get_auth_chain_ids (#8132) Allow denying or shadow banning registrations via the spam checker (#8034) Stop shadow-banned users from sending invites. (#8095) Be more tolerant of membership events in unknown rooms (#8110) Improve the error code when trying to register using a name reserved for guests. (#8135) ...
| * Fix rate limiting unit tests. (#8167)Patrick Cloke2020-08-261-13/+14
| | | | | | | | These were passing on the release-v1.19.1 branch but started failing once merged to develop.
| * Merge tag 'v1.19.1rc1' into developBrendan Abolivier2020-08-252-4/+93
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.19.1rc1 (2020-08-25) ============================== Bugfixes -------- - Fix a bug introduced in v1.19.0 where appservices with ratelimiting disabled would still be ratelimited when joining rooms. ([\#8139](https://github.com/matrix-org/synapse/issues/8139)) - Fix a bug introduced in v1.19.0 that would cause e.g. profile updates to fail due to incorrect application of rate limits on join requests. ([\#8153](https://github.com/matrix-org/synapse/issues/8153))
| * | Stop shadow-banned users from sending non-member events. (#8142)Patrick Cloke2020-08-241-1/+54
| | |
| * | Allow capping a room's retention policy (#8104)Brendan Abolivier2020-08-241-28/+66
| | |
| * | Fix flaky shadow-ban tests. (#8152)Patrick Cloke2020-08-241-1/+3
| | |
| * | Stop shadow-banned users from sending invites. (#8095)Patrick Cloke2020-08-201-0/+100
| | |
* | | Merge commit 'b79d69796' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-202-4/+93
|\ \ \ | | |/ | |/| | | | | | | | | | * commit 'b79d69796': 1.19.1rc1 Fix join ratelimiter breaking profile updates and idempotency (#8153)
| * | Fix join ratelimiter breaking profile updates and idempotency (#8153)Brendan Abolivier2020-08-242-4/+93
| | |
* | | Merge commit 'c9c544cda' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-192-13/+7
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c9c544cda': Remove `ChainedIdGenerator`. (#8123) Switch the JSON byte producer from a pull to a push producer. (#8116) Updated docs: Added note about missing 308 redirect support. (#8120) Be stricter about JSON that is accepted by Synapse (#8106) Convert runWithConnection to async. (#8121) Remove the unused inlineCallbacks code-paths in the caching code (#8119) Separate `get_current_token` into two. (#8113) Convert events worker database to async/await. (#8071) Add a link to the matrix-synapse-rest-password-provider. (#8111)
| * | Switch the JSON byte producer from a pull to a push producer. (#8116)Patrick Cloke2020-08-192-13/+7
| |/
* | Merge commit '5dd73d029' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-1/+3
|\| | | | | | | | | * commit '5dd73d029': Add type hints to handlers.message and events.builder (#8067)
| * Add type hints to handlers.message and events.builder (#8067)Erik Johnston2020-08-121-1/+3
| |
* | Merge commit '7620912d8' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-0/+34
|\| | | | | | | | | * commit '7620912d8': Add health check endpoint (#8048)
| * Add health check endpoint (#8048)Erik Johnston2020-08-071-0/+34
| |
* | Merge commit '2ffd6783c' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-192-175/+2
|\| | | | | | | | | * commit '2ffd6783c': Revert #7736 (#8039)
| * Revert #7736 (#8039)Brendan Abolivier2020-08-062-175/+2
| |
* | Merge commit 'd4a7829b1' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-194-12/+14
|\| | | | | | | | | * commit 'd4a7829b1': Convert synapse.api to async/await (#8031)
| * Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-064-12/+14
| |
* | Merge commit '66f24449d' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-1/+1
|\| | | | | | | | | * commit '66f24449d': Improve performance of the register endpoint (#8009)
| * Improve performance of the register endpoint (#8009)Patrick Cloke2020-08-061-1/+1
| |
* | Merge commit 'a7bdf98d0' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-2/+2
|\| | | | | | | | | * commit 'a7bdf98d0': Rename database classes to make some sense (#8033)
| * Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-2/+2
| |
* | Merge commit '5d92a1428' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-161-1/+23
|\| | | | | | | | | * commit '5d92a1428': Prevent join->join membership transitions changing member count (#7977)
| * Prevent join->join membership transitions changing member count (#7977)Andrew Morgan2020-08-031-1/+23
| | | | | | | | | | | | | | | | | | | | | | `StatsHandler` handles updates to the `current_state_delta_stream`, and updates room stats such as the amount of state events, joined users, etc. However, it counts every new join membership as a new user entering a room (and that user being in another room), whereas it's possible for a user's membership status to go from join -> join, for instance when they change their per-room profile information. This PR adds a check for join->join membership transitions, and bails out early, as none of the further checks are necessary at that point. Due to this bug, membership stats in many rooms have ended up being wildly larger than their true values. I am not sure if we also want to include a migration step which recalculates these statistics (possibly using the `_populate_stats_process_rooms` bg update). Bug introduced in the initial implementation https://github.com/matrix-org/synapse/pull/4338.
* | Merge commit 'c978f6c45' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-162-4/+4
|\| | | | | | | | | * commit 'c978f6c45': Convert federation client to async/await. (#7975)
| * Convert federation client to async/await. (#7975)Patrick Cloke2020-07-302-4/+4
| |
* | Merge commit '3950ae51e' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-163-4/+230
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3950ae51e': Ensure that remove_pusher is always async (#7981) Ensure the msg property of HttpResponseException is a string. (#7979) Remove from the event_relations table when purging historical events. (#7978) Add additional logging for SAML sessions. (#7971) Add MSC reference to changelog for #7736 Re-implement unread counts (#7736) Various improvements to the docs (#7899) Convert storage layer to async/await. (#7963) Add an option to disable purge in delete room admin API (#7964) Move some log lines from default logger to sql/transaction loggers (#7952) Use the JSON module from the std library instead of simplejson. (#7936) Fix exit code for `check_line_terminators.sh` (#7970) Option to allow server admins to join complex rooms (#7902) Fix typo in metrics docs (#7966) Add script for finding files with unix line terminators (#7965) Convert the remaining media repo code to async / await. (#7947) Convert a synapse.events to async/await. (#7949) Convert groups and visibility code to async / await. (#7951) Convert push to async/await. (#7948)
| * Re-implement unread counts (#7736)Brendan Abolivier2020-07-292-2/+175
| |
| * Add an option to disable purge in delete room admin API (#7964)Dirk Klimpel2020-07-281-2/+55
| | | | | | | | | | | | Add option ```purge``` to ```POST /_synapse/admin/v1/rooms/<room_id>/delete``` Fixes: #3761 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* | "Freeze" a room when the last admin of that room leaves (#59)Andrew Morgan2020-10-131-1/+130
| | | | | | | | | | | | | | | | If the last admin of a room departs, and thus the room no longer has any admins within it, we "freeze" the room. Freezing a room means that the power level required to do anything in the room (sending messages, inviting others etc) will require power level 100. At the moment, an admin can come back and unfreeze the room manually. The plan is to eventually make unfreezing of the room automatic on admin rejoin, though that will be in a separate PR. This *could* work in mainline, however if the admin who leaves is on a homeserver without this functionality, then the room isn't frozen. I imagine this would probably be pretty confusing to people. Part of this feature was allowing Synapse modules to send events, which has been implemented in mainline at https://github.com/matrix-org/synapse/pull/8479, and cherry-picked to the `dinsic` fork in 62c7b10. The actual freezing logic has been implemented here in the RoomAccessRules module.
* | Allow modules to create and send events into rooms (#8479)Andrew Morgan2020-10-122-86/+170
| | | | | | | | | | | | | | | | This PR allows Synapse modules making use of the `ModuleApi` to create and send non-membership events into a room. This can useful to have modules send messages, or change power levels in a room etc. Note that they must send event through a user that's already in the room. The non-membership event limitation is currently arbitrary, as it's another chunk of work and not necessary at the moment. This commit has been cherry-picked from mainline.
* | Swap method calls in RoomAccessTestCase.test_change_rules (#64)Andrew Morgan2020-09-181-5/+6
| | | | | | | | | | Swap these calls around, as the check for changing `restricted` to `unrestricted` will actually change `self.restricted_room` to an unrestricted room. Do that last, instead of first. Additionally add a comment with a warning.
* | Make AccessRules use the public rooms directory instead of checking a room's ↵Andrew Morgan2020-09-182-54/+230
| | | | | | | | | | | | | | join rules on rule change (#63) This PR switches several conditions regarding room access rules to check against the status of the room's inclusion in the public room list instead of its join rules. The code includes a snapshot of https://github.com/matrix-org/synapse/pull/8292, which will likely change in time and need merging in again.
* | Override the power levels defaults, enforce mod requirement for invites, ↵Andrew Morgan2020-09-111-5/+52
| | | | | | | | | | | | | | | | | | | | admin requirements for unknown state events (#61) This PR modifies the `RoomAccessRules` module, an implementation of `ThirdPartyEventRules`, to both: * Modify the default power levels when creating a room to set: - `invite` to be minimum PL50 - `state_default` to be minimum PL100 * Enforce this when creating the room.
* | RoomAccessRules cleanup (#62)Andrew Morgan2020-09-101-34/+27
| | | | | | | | | | | | | | Various cleanups of the DINUM-specific `RoomAccessRules` module, including: * Type hints * Docstring cleanups * Some code cleanups
* | Add a config option for validating 'next_link' parameters against a domain ↵Andrew Morgan2020-09-091-7/+96
| | | | | | | | | | | | | | | | | | | | | | | | whitelist (#8275) This is a config option ported over from DINUM's Sydent: https://github.com/matrix-org/sydent/pull/285 They've switched to validating 3PIDs via Synapse rather than Sydent, and would like to retain this functionality. This original purpose for this change is phishing prevention. This solution could also potentially be replaced by a similar one to https://github.com/matrix-org/synapse/pull/8004, but across all `*/submit_token` endpoint. This option may still be useful to enterprise even with that safeguard in place though, if they want to be absolutely sure that their employees don't follow links to other domains.
* | Merge commit 'f88c48f3b' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-033-1456/+1585
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f88c48f3b': 1.18.0rc1 Fix error reporting when using `opentracing.trace` (#7961) Fix typing replication not being handled on master (#7959) Remove hacky error handling for inlineDeferreds. (#7950) Convert tests/rest/admin/test_room.py to unix file endings (#7953) Support oEmbed for media previews. (#7920) Convert state resolution to async/await (#7942) Fix up types and comments that refer to Deferreds. (#7945) Do not convert async functions to Deferreds in the interactive_auth_handler (#7944) Convert more of the media code to async/await (#7873) Return an empty body for OPTIONS requests. (#7886) Downgrade warning on client disconnect to INFO (#7928) Convert presence handler helpers to async/await. (#7939) Update the auth providers to be async. (#7935) Put a cache on `/state_ids` (#7931)
| * Convert tests/rest/admin/test_room.py to unix file endings (#7953)Andrew Morgan2020-07-271-1447/+1447
| | | | | | | | | | Converts tests/rest/admin/test_room.py to have unix file endings after they were accidentally changed in #7613. Keeping the same changelog as #7613 as it hasn't gone out in a release yet.
| * Support oEmbed for media previews. (#7920)Patrick Cloke2020-07-271-8/+134
| | | | | | Fixes previews of Twitter URLs by using their oEmbed endpoint to grab content.
| * Convert more of the media code to async/await (#7873)Patrick Cloke2020-07-241-1/+4
| |
* | Merge commit 'de119063f' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-0/+46
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'de119063f': (31 commits) Convert room list handler to async/await. (#7912) Element CSS and logo in email templates (#7919) Lint the contrib/ directory in CI and linting scripts, add synctl to linting script (#7914) Remove unused code from synapse.logging.utils. (#7897) Fix a typo in the sample config. (#7890) Fix deprecation warning: import ABC from collections.abc (#7892) Change sample config's postgres user to synapse_user (#7889) Fix deprecation warning due to invalid escape sequences (#7895) Remove Ubuntu Eoan that is now EOL (#7888) Fix the trace function for async functions. (#7872) Add help for creating a user via docker (#7885) Switch to Debian:Slim from Alpine for the docker image (#7839) Stop using 'device_max_stream_id' (#7882) Fix TypeError in synapse.notifier (#7880) Add a default limit (of 100) to get/sync operations. (#7858) Change "unknown room ver" logging to warning. (#7881) Convert device handler to async/await (#7871) Convert synapse.app to async/await. (#7868) Convert _base, profile, and _receipts handlers to async/await (#7860) Add admin endpoint to get members in a room. (#7842) ...
| * Add admin endpoint to get members in a room. (#7842)Michael Albert2020-07-161-0/+46
| |
* | Merge commit 'a973bcb8a' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-032-21/+69
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'a973bcb8a': Add some tiny type annotations (#7870) Remove obsolete comment. Ensure that calls to `json.dumps` are compatible with the standard library json. (#7836) Avoid brand new rooms in `delete_old_current_state_events` (#7854) Allow accounts to be re-activated from the admin APIs. (#7847) Fix tests Fix typo Newsfile Use get_users_in_room rather than state handler in typing for speed Fix client reader sharding tests (#7853) Convert E2E key and room key handlers to async/await. (#7851) Return the proper 403 Forbidden error during errors with JWT logins. (#7844) remove `retry_on_integrity_error` wrapper for persist_events (#7848)
| * Allow accounts to be re-activated from the admin APIs. (#7847)Patrick Cloke2020-07-151-0/+47
| |
| * Return the proper 403 Forbidden error during errors with JWT logins. (#7844)Patrick Cloke2020-07-151-21/+22
| |
* | Merge commit '491f0dab1' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-0/+395
|\| | | | | | | | | * commit '491f0dab1': Add delete room admin endpoint (#7613)
| * Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-141-0/+395
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Delete Room admin API allows server admins to remove rooms from server and block these rooms. `DELETE /_synapse/admin/v1/rooms/<room_id>` It is a combination and improvement of "[Shutdown room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/shutdown_room.md)" and "[Purge room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/purge_room.md)" API. Fixes: #6425 It also fixes a bug in [synapse/storage/data_stores/main/room.py](synapse/storage/data_stores/main/room.py) in ` get_room_with_stats`. It should return `None` if the room is unknown. But it returns an `IndexError`. https://github.com/matrix-org/synapse/blob/901b1fa561e3cc661d78aa96d59802cf2078cb0d/synapse/storage/data_stores/main/room.py#L99-L105 Related to: - #5575 - https://github.com/Awesome-Technologies/synapse-admin/issues/17 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* | Merge commit '77d2c0541' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-6/+100
|\| | | | | | | | | * commit '77d2c0541': Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)
| * Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)Patrick Cloke2020-07-141-6/+100
| |
* | Merge commit '66a4af8d9' into anoa/dinsic_release_1_18_xAndrew Morgan2020-08-031-1/+1
|\| | | | | | | | | * commit '66a4af8d9': Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)
| * Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)Patrick Cloke2020-07-101-1/+1
| |
* | Merge commit '43726783e' into dinsicAndrew Morgan2020-08-035-7/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '43726783e': (22 commits) 1.17.0rc1 Fix some spelling mistakes / typos. (#7811) `update_membership` declaration: now always returns an event id. (#7809) Improve stacktraces from exceptions in background processes (#7808) Fix `can only concatenate list (not "tuple") to list` exception (#7810) Pass original request headers from workers to the main process. (#7797) Generate real events when we reject invites (#7804) Add `HomeServer.signing_key` property (#7805) Revert "Update the installation docs on apt-transport-https (#7801)" Do not use simplejson in Synapse. (#7800) Stop passing bytes when dumping JSON (#7799) Update the installation docs on apt-transport-https (#7801) shuffle changelog slightly Change Caddy links (old is deprecated) (#7789) Stop populating unused table `local_invites`. (#7793) Refactor getting replication updates from database v2. (#7740) Add libwebp dependency to Dockerfile (#7791) Add documentation for JWT login type and improve sample config. (#7776) Convert the appservice handler to async/await. (#7775) Don't ignore `set_tweak` actions with no explicit `value`. (#7766) ...
| * Fix some spelling mistakes / typos. (#7811)Patrick Cloke2020-07-093-3/+3
| |