summary refs log tree commit diff
path: root/tests/rest/client/v1 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Flatten tests/rest/client/{v1,v2_alpha} too (#10667)David Robertson2021-08-2010-5353/+0
|
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-178-11/+9
|
* Fix type hints in space summary tests. (#10575)Patrick Cloke2021-08-111-3/+3
| | | And ensure that the file is checked via mypy.
* Fix exceptions in logs when failing to get remote room list (#10541)Erik Johnston2021-08-061-1/+91
|
* Add a new version of the R30 phone-home metric, which removes a false ↵reivilibre2021-07-191-3/+27
| | | | | impression of retention given by the old R30 metric (#10332) Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
* Use inline type hints in `tests/` (#10350)Jonathan de Jong2021-07-131-8/+6
| | | | | | | | This PR is tantamount to running: python3.8 -m com2ann -v 6 tests/ (com2ann requires python 3.8 to run)
* [pyupgrade] `tests/` (#10347)Jonathan de Jong2021-07-131-7/+7
|
* Do not recurse into non-spaces in the spaces summary. (#10256)Patrick Cloke2021-06-291-1/+2
| | | | | Previously m.child.room events in non-space rooms would be treated as part of the room graph, but this is no longer supported.
* update black to 21.6b0 (#10197)Marcus2021-06-174-11/+11
| | | | | Reformat all files with the new version. Signed-off-by: Marcus Hoffmann <bubu@bubu1.eu>
* r0.6.1 support: /rooms/:roomId/aliases endpoint (#9224)Travis Ralston2021-06-031-2/+1
| | | | | | [MSC2432](https://github.com/matrix-org/matrix-doc/pull/2432) added this endpoint originally but it has since been included in the spec for nearly a year. This is progress towards https://github.com/matrix-org/synapse/issues/8334
* Correctly ratelimit invites when creating a room (#9968)Brendan Abolivier2021-05-121-0/+37
| | | | | * Correctly ratelimit invites when creating a room Also allow ratelimiting for more than one action at a time.
* Split presence out of master (#9820)Erik Johnston2021-04-231-2/+3
|
* Fix (final) Bugbear violations (#9838)Jonathan de Jong2021-04-201-3/+3
|
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-1410-10/+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-096-9/+6
|
* Bugbear: Add Mutable Parameter fixes (#9682)Jonathan de Jong2021-04-082-5/+14
| | | | | | | Part of #9366 Adds in fixes for B006 and B008, both relating to mutable parameter lint errors. Signed-off-by: Jonathan de Jong <jonathan@automatia.nl>
* Add support for stable MSC2858 API (#9617)Richard van der Hoff2021-03-161-16/+27
| | | | | The stable format uses different brand identifiers, so we need to support two identifiers for each IdP.
* Fix additional type hints from Twisted upgrade. (#9518)Patrick Cloke2021-03-031-11/+24
|
* SSO: redirect to public URL before setting cookies (#9436)Richard van der Hoff2021-02-262-25/+55
| | | ... otherwise, we don't get the cookie back.
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-165-22/+56
| | | | | | | - 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
* Convert additional test-cases to homeserver test case. (#9396)Patrick Cloke2021-02-161-158/+91
| | | And convert some inlineDeferreds to async-friendly functions.
* Merge tag 'v1.27.0rc2' into developPatrick Cloke2021-02-111-1/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.27.0rc2 (2021-02-11) ============================== Features -------- - Further improvements to the user experience of registration via single sign-on. ([\#9297](https://github.com/matrix-org/synapse/issues/9297)) Bugfixes -------- - Fix ratelimiting introduced in v1.27.0rc1 for invites to respect the `ratelimit` flag on application services. ([\#9302](https://github.com/matrix-org/synapse/issues/9302)) - Do not automatically calculate `public_baseurl` since it can be wrong in some situations. Reverts behaviour introduced in v1.26.0. ([\#9313](https://github.com/matrix-org/synapse/issues/9313)) Improved Documentation ---------------------- - Clarify the sample configuration for changes made to the template loading code. ([\#9310](https://github.com/matrix-org/synapse/issues/9310))
| * Backout changes for automatically calculating the public baseurl. (#9313)Patrick Cloke2021-02-111-1/+3
| | | | | | | | This breaks some people's configurations (if their Client-Server API is not accessed via port 443).
* | Convert some test cases to use HomeserverTestCase. (#9377)Patrick Cloke2021-02-111-28/+0
| | | | | | | | This has the side-effect of being able to remove use of `inlineCallbacks` in the test-cases for cleaner tracebacks.
* | Social login UI polish (#9301)Richard van der Hoff2021-02-031-4/+12
|/
* Merge branch 'social_login' into developRichard van der Hoff2021-02-011-14/+16
|\
| * 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.
| * Fix SSO on workers (#9271)Richard van der Hoff2021-02-011-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Ratelimit invites by room and target user (#9258)Erik Johnston2021-01-291-0/+35
|/
* Implement MSC2858 support (#9183)Richard van der Hoff2021-01-271-0/+92
| | | Fixes #8928.
* Prefix idp_id with "oidc-" (#9189)Richard van der Hoff2021-01-211-1/+1
| | | ... to avoid clashes with other SSO mechanisms
* 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
* Improve UsernamePickerTestCase (#9112)Richard van der Hoff2021-01-152-6/+110
| | | | | * 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.
* Add a test for UI-Auth-via-SSO (#9082)Richard van der Hoff2021-01-131-36/+160
| | | | | * Add complete test for UI-Auth-via-SSO. * review comments
* Remove user's avatar URL and displayname when deactivated. (#8932)Dirk Klimpel2021-01-122-3/+8
| | | This only applies if the user's data is to be erased.
* 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 :/
* Skip unit tests which require optional dependencies (#9031)Richard van der Hoff2021-01-071-1/+10
| | | If we are lacking an optional dependency, skip the tests that rely on it.
* 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
* 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 pull request #8951 from matrix-org/rav/username_picker_2Richard van der Hoff2020-12-161-1/+1
|\ | | | | More preparatory refactoring of the OidcHandler tests
| * 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.
* | lintRichard van der Hoff2020-12-151-1/+1
| |
* | Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-159-235/+201
|/ | | | This was never used, so let's get rid of it.
* Don't ratelimit autojoining of rooms (#8921)Erik Johnston2020-12-111-0/+16
| | | Fixes #8866
* Merge pull request #8858 from matrix-org/rav/sso_uiaRichard van der Hoff2020-12-021-1/+115
|\ | | | | UIA: offer only available auth flows
| * UIA: offer only available auth flowsRichard van der Hoff2020-12-021-1/+115
| | | | | | | | | | | | | | During user-interactive auth, do not offer password auth to users with no password, nor SSO auth to users with no SSO. Fixes #7559.
* | Apply an IP range blacklist to push and key revocation requests. (#8821)Patrick Cloke2020-12-024-4/+4
|/ | | | | | | | | | | | 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).
* 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.
* Simplify the way the `HomeServer` object caches its internal attributes. ↵Jonathan de Jong2020-11-301-6/+9
| | | | | (#8565) Changes `@cache_in_self` to use underscore-prefixed attributes.
* Remove redundant `HomeserverTestCase.render`Richard van der Hoff2020-11-168-193/+0
|
* Remove redundant calls to `render()`Richard van der Hoff2020-11-161-11/+5
|
* Make `make_request` actually render the requestRichard van der Hoff2020-11-161-3/+1
| | | | | | 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.
* Merge branch 'develop' into rav/pass_site_to_make_requestRichard van der Hoff2020-11-161-3/+1
|\
| * 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().
* | 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
|/
* Remove the deprecated Handlers object (#8494)Patrick Cloke2020-10-093-3/+7
| | | All handlers now available via get_*_handler() methods on the HomeServer.
* 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
* 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
|
* 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>
* 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>
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Do not propagate profile changes of shadow-banned users into rooms. (#8157)Patrick Cloke2020-08-261-157/+2
|
* 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))
| * Fix join ratelimiter breaking profile updates and idempotency (#8153)Brendan Abolivier2020-08-242-4/+93
| |
* | Stop shadow-banned users from sending non-member events. (#8142)Patrick Cloke2020-08-241-1/+54
| |
* | 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
| |
* | Switch the JSON byte producer from a pull to a push producer. (#8116)Patrick Cloke2020-08-191-11/+5
|/
* Revert #7736 (#8039)Brendan Abolivier2020-08-061-20/+0
|
* Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-063-9/+7
|
* 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.
* Re-implement unread counts (#7736)Brendan Abolivier2020-07-291-0/+20
|
* Return the proper 403 Forbidden error during errors with JWT logins. (#7844)Patrick Cloke2020-07-151-21/+22
|
* Add the option to validate the `iss` and `aud` claims for JWT logins. (#7827)Patrick Cloke2020-07-141-6/+100
|
* Do not use canonicaljson to magically handle decoding bytes from JSON. (#7802)Patrick Cloke2020-07-101-1/+1
|
* Fix some spelling mistakes / typos. (#7811)Patrick Cloke2020-07-091-1/+1
|
* add org.matrix.login.jwt so that m.login.jwt can be deprecated (#7675)Sorunome2020-06-241-3/+7
|
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-1/+1
|
* Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-054-31/+45
| | | | | | | | | | While working on https://github.com/matrix-org/synapse/issues/5665 I found myself digging into the `Ratelimiter` class and seeing that it was both: * Rather undocumented, and * causing a *lot* of config checks This PR attempts to refactor and comment the `Ratelimiter` class, as well as encourage config file accesses to only be done at instantiation. Best to be reviewed commit-by-commit.
* Fix a bug in automatic user creation with m.login.jwt. (#7585)Olof Johansson2020-06-011-0/+153
|
* Allow expired accounts to logout (#7443)Andrew Morgan2020-05-141-1/+68
|
* Fix limit logic for EventsStream (#7358)Richard van der Hoff2020-04-291-1/+1
| | | | | | | | | | | | | | | | | | | * Factor out functions for injecting events into database I want to add some more flexibility to the tools for injecting events into the database, and I don't want to clutter up HomeserverTestCase with them, so let's factor them out to a new file. * Rework TestReplicationDataHandler This wasn't very easy to work with: the mock wrapping was largely superfluous, and it's useful to be able to inspect the received rows, and clear out the received list. * Fix AssertionErrors being thrown by EventsStream Part of the problem was that there was an off-by-one error in the assertion, but also the limit logic was too simple. Fix it all up and add some tests.
* Fix the parameters of a test fixture (#7243)Zay11Zay2020-04-141-1/+1
|
* Default PL100 to enable encryption in a room (#7230)Andrew Morgan2020-04-091-4/+92
|
* Do not allow a deactivated user to login via SSO. (#7240)Patrick Cloke2020-04-091-3/+39
|
* Always whitelist the login fallback for SSO (#7153)Richard van der Hoff2020-03-271-1/+8
| | | | | | | That fallback sets the redirect URL to itself (so it can process the login token then return gracefully to the client). This would make it pointless to ask the user for confirmation, since the URL the confirmation page would be showing wouldn't be the client's.
* Remove special casing of `m.room.aliases` events (#7034)Patrick Cloke2020-03-171-15/+26
|
* Merge branch 'master' into developBrendan Abolivier2020-03-031-0/+111
|\
| * Add a whitelist for the SSO confirmation step.Richard van der Hoff2020-03-021-3/+29
| |
| * Add a confirmation step to the SSO login flowBrendan Abolivier2020-03-021-0/+85
| |
* | Validate the alt_aliases property of canonical alias events (#6971)Patrick Cloke2020-03-031-0/+160
|/
* Merge pull request #6949 from matrix-org/rav/list_room_aliases_peekableRichard van der Hoff2020-02-191-0/+17
|\ | | | | Make room alias lists peekable
| * Make room alias lists peekableRichard van der Hoff2020-02-191-0/+17
| | | | | | | | | | | | As per https://github.com/matrix-org/matrix-doc/pull/2432#pullrequestreview-360566830, make room alias lists accessible to users outside world_readable rooms.
* | Move MSC2432 stuff onto unstable prefix (#6948)Richard van der Hoff2020-02-191-3/+13
|/ | | it's not in the spec yet, so needs to be unstable. Also add a feature flag for it. Also add a test for admin users.
* Implement GET /_matrix/client/r0/rooms/{roomId}/aliases (#6939)Richard van der Hoff2020-02-181-1/+69
| | | | | per matrix-org/matrix-doc#2432
* Raise the default power levels for invites, tombstones and server acls (#6834)Andrew Morgan2020-02-171-1/+3
|
* MSC2260: Block direct sends of m.room.aliases events (#6794)Richard van der Hoff2020-01-301-26/+15
| | | | | as per MSC2260
* Fix `/events/:event_id` deprecated API. (#6731)Erik Johnston2020-01-201-0/+27
|
* Quarantine media by ID or user ID (#6681)Andrew Morgan2020-01-131-0/+37
|
* Merge release-v1.7.1 into developRichard van der Hoff2019-12-181-0/+127
|\
| * Incorporate reviewBrendan Abolivier2019-12-161-5/+0
| |
| * LintBrendan Abolivier2019-12-161-2/+1
| |
| * Add test caseBrendan Abolivier2019-12-161-0/+133
| |
* | Add option to allow profile queries without sharing a room (#6523)Will Hunt2019-12-161-0/+2
|/
* Fixup functions to consistently return deferredsErik Johnston2019-12-061-1/+3
|
* Fixup testsErik Johnston2019-12-052-1/+12
|
* Un-remove room purge testBrendan Abolivier2019-12-041-0/+72
|
* Merge branch 'babolivier/context_filters' of github.com:matrix-org/synapse ↵Brendan Abolivier2019-12-041-1/+1
|\ | | | | | | into babolivier/context_filters
| * Merge branch 'develop' into babolivier/context_filtersBrendan Abolivier2019-11-261-0/+173
| |\
* | \ Merge branch 'develop' into babolivier/context_filtersBrendan Abolivier2019-12-041-2/+143
|\ \ \ | |/ / |/| |
| * | Add testsErik Johnston2019-11-281-0/+140
| |/
| * LintBrendan Abolivier2019-11-201-6/+8
| |
| * Test if a purge can make /messages return 500 responsesBrendan Abolivier2019-11-201-0/+72
| |
* | LintBrendan Abolivier2019-11-051-30/+41
| |
* | Update copyrightsBrendan Abolivier2019-11-052-0/+5
| |
* | Add tests for /searchBrendan Abolivier2019-11-051-44/+143
| |
* | Merge labels tests for /context and /messagesBrendan Abolivier2019-11-051-146/+130
| |
* | Add test caseBrendan Abolivier2019-11-051-0/+182
|/
* Incorporate reviewBrendan Abolivier2019-11-011-4/+4
|
* Incorporate reviewBrendan Abolivier2019-11-011-5/+5
|
* LintBrendan Abolivier2019-10-301-25/+24
|
* Add integration tests for /messagesBrendan Abolivier2019-10-301-1/+101
|
* Add integration tests for syncBrendan Abolivier2019-10-301-3/+12
|
* Add domain validation when creating room with list of invitees (#6121)werner2912019-10-101-0/+9
|
* Fix and refactor room and user stats (#5971)Erik Johnston2019-09-041-2/+6
| | | Previously the stats were not being correctly populated.
* Implement access token expiry (#5660)Richard van der Hoff2019-07-121-0/+108
| | | | Record how long an access token is valid for, and raise a soft-logout once it expires.
* LintBrendan Abolivier2019-07-081-2/+2
|
* Add test caseBrendan Abolivier2019-07-081-0/+47
|
* Split public rooms directory auth config in twoBrendan Abolivier2019-06-241-1/+1
|
* Run Black. (#5482)Amber Brown2019-06-203-34/+27
|
* Unify v1 and v2 REST client APIs (#5226)Amber Brown2019-06-031-1/+1
|
* Merge pull request #5309 from matrix-org/rav/limit_displayname_lengthRichard van der Hoff2019-06-011-2/+60
|\ | | | | Limit displaynames and avatar URLs
| * add some testsRichard van der Hoff2019-06-011-2/+60
| |
* | Room Statistics (#4338)Amber Brown2019-05-211-0/+17
|/
* LintBrendan Abolivier2019-05-161-1/+0
|
* LintBrendan Abolivier2019-05-161-1/+3
|
* Forgot copyrightBrendan Abolivier2019-05-161-0/+1
|
* Add test caseBrendan Abolivier2019-05-161-1/+67
|
* Migrate all tests to use the dict-based config format instead of hanging ↵Amber Brown2019-05-134-6/+6
| | | | items off HomeserverConfig (#5171)
* Run Black on the tests again (#5170)Amber Brown2019-05-103-84/+32
|
* Fix bogus imports in tests (#5154)Brendan Abolivier2019-05-083-5/+6
|
* add options to require an access_token to GET /profile and /publicRooms on ↵Matthew Hodgson2019-05-082-1/+123
| | | | | | | | | | | | | | | | | CS API (#5083) This commit adds two config options: * `restrict_public_rooms_to_local_users` Requires auth to fetch the public rooms directory through the CS API and disables fetching it through the federation API. * `require_auth_for_profile_requests` When set to `true`, requires that requests to `/profile` over the CS API are authenticated, and only returns the user's profile if the requester shares a room with the profile's owner, as per MSC1301. MSC1301 also specifies a behaviour for federation (only returning the profile if the server asking for it shares a room with the profile's owner), but that's currently really non-trivial to do in a not too expensive way. Next step is writing down a MSC that allows a HS to specify which user sent the profile query. In this implementation, Synapse won't send a profile query over federation if it doesn't believe it already shares a room with the profile's owner, though. Groups have been intentionally omitted from this commit.
* Do checks on aliases for incoming m.room.aliases events (#5128)Brendan Abolivier2019-05-081-0/+169
| | | | | Follow-up to #5124 Also added a bunch of checks to make sure everything (both the stuff added on #5124 and this PR) works as intended.
* Add admin api for sending server_notices (#5121)Richard van der Hoff2019-05-023-3/+3
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-014-622/+9
| | | | It doesn't really belong under rest/client/v1 any more.
* Add unit test for deleting groupsErik Johnston2019-04-031-0/+124
|
* Some more porting to HomeserverTestCase and remove old RESTHelper (#4913)Amber Brown2019-03-221-125/+0
|
* Merge pull request #4908 from matrix-org/erikj/block_peek_on_blocked_roomsErik Johnston2019-03-211-1/+65
|\ | | | | Deny peeking into rooms that have been blocked
| * isortErik Johnston2019-03-211-1/+1
| |
| * Deny peeking into rooms that have been blockedErik Johnston2019-03-211-1/+65
| |
* | Fix typo and add descriptionErik Johnston2019-03-211-1/+5
|/
* Rejig testcase to make it more extensibleErik Johnston2019-03-211-17/+22
|
* Remove debugErik Johnston2019-03-211-1/+0
|
* Add testsErik Johnston2019-03-211-1/+66
|
* Add ratelimiting on failed login attempts (#4865)Brendan Abolivier2019-03-181-0/+45
|
* Add ratelimiting on login (#4821)Brendan Abolivier2019-03-151-0/+118
| | | Add two ratelimiters on login (per-IP address and per-userID).
* Merge pull request #4772 from jbweston/jbweston/server-version-apiErik Johnston2019-03-051-2/+36
|\ | | | | Add 'server_version' endpoint to admin API
| * Add 'server_version' endpoint to admin APIJoseph Weston2019-03-011-1/+35
| | | | | | | | | | This is required because the 'Server' HTTP header is not always passed through proxies.
| * Import 'admin' module rather than 'register_servlets' directlyJoseph Weston2019-03-011-2/+2
| | | | | | | | | | | | We will later need also to import 'register_servlets' from the 'login' module, so we un-pollute the namespace now to keep the logical changes separate.
* | Add rate-limiting on registration (#4735)Brendan Abolivier2019-03-053-7/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rate-limiting for registration * Add unit test for registration rate limiting * Add config parameters for rate limiting on auth endpoints * Doc * Fix doc of rate limiting function Co-Authored-By: babolivier <contact@brendanabolivier.com> * Incorporate review * Fix config parsing * Fix linting errors * Set default config for auth rate limiting * Fix tests * Add changelog * Advance reactor instead of mocked clock * Move parameters to registration specific config and give them more sensible default values * Remove unused config options * Don't mock the rate limiter un MAU tests * Rename _register_with_store into register_with_store * Make CI happy * Remove unused import * Update sample config * Fix ratelimiting test for py2 * Add non-guest test
* Remove v1 only REST APIs now we don't ship matrix console (#4334)Amber Brown2018-12-292-145/+44
|
* create support user (#4141)Neil Johnson2018-12-141-5/+28
| | | | | | Allow for the creation of a support user. A support user can access the server, join rooms, interact with other users, but does not appear in the user directory nor does it contribute to monthly active user limits.
* Remove some boilerplate in tests (#4156)Amber Brown2018-11-073-83/+65
|
* Fix search 500ing (#4122)Amber Brown2018-10-311-1/+105
|
* Port tests/ to Python 3 (#3808)Amber Brown2018-09-071-304/+257
|
* Port storage/ to Python 3 (#3725)Amber Brown2018-08-311-4/+10
|
* Integrate presence from hotfixes (#3694)Amber Brown2018-08-181-0/+72
|
* Fix the testsAmber Brown2018-08-152-10/+5
|
* Implement a new test baseclass to cut down on boilerplate (#3684)Amber Brown2018-08-141-37/+29
|
* Run tests under PostgreSQL (#3423)Amber Brown2018-08-136-2/+6
|
* Run black.black2018-08-106-92/+106
|
* Test fixes for Python 3 (#3647)Amber Brown2018-08-093-14/+14
|
* Admin API for creating new users (#3415)Amber Brown2018-07-201-0/+305
|
* Move v1-only APIs into their own module & isolate deprecated ones (#3460)Amber Brown2018-07-193-82/+15
|
* Refactor REST API tests to use explicit reactors (#3351)Amber Brown2018-07-173-713/+626
|
* run isortAmber Brown2018-07-096-23/+26
|
* Burminate v1authAdrian Tschira2018-04-304-13/+18
| | | | | | | | | | | | | | | | | | This closes #2602 v1auth was created to account for the differences in status code between the v1 and v2_alpha revisions of the protocol (401 vs 403 for invalid tokens). However since those protocols were merged, this makes the r0 version/endpoint internally inconsistent, and violates the specification for the r0 endpoint. This might break clients that rely on this inconsistency with the specification. This is said to affect the legacy angular reference client. However, I feel that restoring parity with the spec is more important. Either way, it is critical to inform developers about this change, in case they rely on the illegal behaviour. Signed-off-by: Adrian Tschira <nota@notafile.com>
* Use six.moves.urlparseAdrian Tschira2018-04-151-7/+7
| | | | | | The imports were shuffled around a bunch in py3 Signed-off-by: Adrian Tschira <nota@notafile.com>
* move handling of auto_join_rooms to RegisterHandlerKrombel2018-03-141-0/+1
| | | | | | | | | | | | | Currently the handling of auto_join_rooms only works when a user registers itself via public register api. Registrations via registration_shared_secret and ModuleApi do not work This auto_joins the users in the registration handler which enables the auto join feature for all 3 registration paths. This is related to issue #2725 Signed-Off-by: Matthias Kesler <krombel@krombel.de>
* s/replication_client/federation_client/Erik Johnston2018-03-134-11/+11
|
* Fix testsErik Johnston2018-03-134-11/+11
|
* Move RoomMemberHandler out of HandlersErik Johnston2018-03-011-1/+1
|
* Remove dead codeRichard van der Hoff2018-01-091-3/+0
| | | | pointless function is pointless
* Split out profile handler to fix testsErik Johnston2017-08-251-2/+1
|
* Add groups to sync streamErik Johnston2017-07-201-2/+2
|
* Add basic implementation of local device list changesErik Johnston2017-01-251-2/+2
|
* Linearize updates to membership via PUT /state/Erik Johnston2017-01-092-3/+6
|
* Merge pull request #1098 from matrix-org/markjh/bearer_tokenMark Haines2016-10-251-0/+2
|\ | | | | Allow clients to supply access_tokens as headers
| * Fix unit testsMark Haines2016-09-121-0/+2
| |
* | rest/client/v1/register: use the correct requester in createUserPatrik Oldsberg2016-10-061-21/+9
| | | | | | | | Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
* | Time out typing over federationErik Johnston2016-09-231-4/+1
|/
* More 0_0 in testsMark Haines2016-08-251-2/+2
|
* Add `create_requester` functionRichard van der Hoff2016-07-261-8/+5
| | | | | Wrap the `Requester` constructor with a function which provides sensible defaults, and use it throughout
* Move typing handler out of the Handlers objectMark Haines2016-05-171-1/+1
|
* Create user with expiryNegi Fazeli2016-05-131-0/+88
| | | | | | - Add unittests for client, api and handler Signed-off-by: Negar Fazeli <negar.fazeli@ericsson.com>
* Do checks for memberships before creating eventsErik Johnston2016-04-011-2/+2
|
* Use parse_json_object_from_request to parse JSON out of request bodiesMark Haines2016-03-111-2/+4
|
* Fix testsDavid Baker2016-03-072-18/+18
|
* Fix unit testsMark Haines2016-03-041-2/+2
|
* Pass whole requester to ratelimitingDaniel Wagner-Hall2016-03-031-2/+2
| | | | This will enable more detailed decisions
* Fix flake8 warnings for testsMark Haines2016-02-195-156/+170
|
* Remove old tests.Erik Johnston2016-02-182-418/+0
|
* Rename config field to reflect yaml nameDaniel Wagner-Hall2016-02-031-1/+1
|
* Allow paginating backwards from stream tokenErik Johnston2016-01-281-8/+1
|
* Merge pull request #535 from matrix-org/rav/paginate_from_stream_tokenRichard van der Hoff2016-01-281-2/+14
|\ | | | | Make it possible to paginate forwards from stream tokens
| * Make it possible to paginate forwards from stream tokensRichard van der Hoff2016-01-271-2/+14
| | | | | | | | | | In order that we can fill the gap after a /sync, make it possible to paginate forwards from a stream token.
* | Remove redundated BaseHomeServerErik Johnston2016-01-261-8/+10
|/
* Introduce a Requester objectDaniel Wagner-Hall2016-01-112-7/+5
| | | | | | | | | This tracks data about the entity which made the request. This is instead of passing around a tuple, which requires call-site modifications every time a new piece of optional context is passed around. I tried to introduce a User object. I gave up.
* copyrightsMatthew Hodgson2016-01-077-7/+7
|
* Return non-room events from guest /events callsDaniel Wagner-Hall2015-11-121-0/+3
|
* Add a couple of unit tests for room/<x>/messagesRichard van der Hoff2015-11-091-0/+56
| | | | ... merely because I was trying to figure out how it worked, and couldn't.
* Open up /events to anonymous users for room events onlyDaniel Wagner-Hall2015-11-052-2/+12
| | | | Squash-merge of PR #345 from daniel/anonymousevents
* Allow guests to register and call /events?room_id=Daniel Wagner-Hall2015-11-044-14/+24
| | | | | | | This follows the same flows-based flow as regular registration, but as the only implemented flow has no requirements, it auto-succeeds. In the future, other flows (e.g. captcha) may be required, so clients should treat this like the regular registration flow choices.
* Support clients supplying older tokens, fix short poll testMark Haines2015-10-301-2/+2
|
* Allow rejecting invitesDaniel Wagner-Hall2015-10-201-2/+2
| | | | | This is done by using the same /leave flow as you would use if you had already accepted the invite and wanted to leave.
* Move NullSource out of synapse and into tests since it is only used by the testsMark Haines2015-09-221-1/+17
|
* Merge pull request #276 from ↵Mark Haines2015-09-211-7/+7
|\ | | | | | | | | matrix-org/markjh/history_for_rooms_that_have_been_left SPEC-216: Allow users to view the history of rooms that they have left.
| * Allow users to GET individual state events for rooms that they have leftMark Haines2015-09-101-5/+5
| |
| * Allow users that have left the room to view the member list from the point ↵Mark Haines2015-09-091-2/+2
| | | | | | | | they left
* | s/user_id/user/g for consistencyDaniel Wagner-Hall2015-09-013-10/+10
| |
* | Attempt to validate macaroonsDaniel Wagner-Hall2015-08-264-23/+20
|/ | | | | | | | | | | | | A couple of weird caveats: * If we can't validate your macaroon, we fall back to checking that your access token is in the DB, and ignoring the failure * Even if we can validate your macaroon, we still have to hit the DB to get the access token ID, which we pretend is a device ID all over the codebase. This mostly adds the interesting code, and points out the two pieces we need to delete (and necessary conditions) in order to fix the above caveats.
* Stop looking up "admin", which we never readDaniel Wagner-Hall2015-08-253-10/+0
|
* Remove completely unused concepts from codebaseDaniel Wagner-Hall2015-08-253-10/+0
| | | | | | | | | | Removes device_id and ClientInfo device_id is never actually written, and the matrix.org DB has no non-null entries for it. Right now, it's just cluttering up code. This doesn't remove the columns from the database, because that's fiddly.
* s/by_token/by_access_token/gDaniel Wagner-Hall2015-08-204-21/+21
| | | | We're about to have two kinds of token, access and refresh
* Fix test.Erik Johnston2015-07-071-1/+11
|
* Add receipts_key to StreamTokenErik Johnston2015-07-021-2/+2
|
* Fix the presence testsMark Haines2015-05-221-2/+2
|
* Merge pull request #157 from matrix-org/markjh/presence_performanceMark Haines2015-05-221-0/+3
|\ | | | | Improve presence performance in loadtest
| * Fix the presence testsMark Haines2015-05-201-0/+3
| |
* | Oops, get_rooms_for_user returns a namedtuple, not a room_idMark Haines2015-05-211-1/+6
|/
* Discard unused NotifierUserStreamsMark Haines2015-05-131-0/+1
|
* Don't bother checking for updates if the stream token hasn't advanced for a userMark Haines2015-05-131-5/+10
|
* Merge branch 'develop' of github.com:matrix-org/synapse into postgresErik Johnston2015-04-284-13/+13
|\
| * Merge branch 'develop' into csauthDavid Baker2015-04-171-2/+5
| |\
| * | Fix testsDavid Baker2015-03-244-13/+13
| | |
* | | Merge branch 'develop' of github.com:matrix-org/synapse into postgresErik Johnston2015-04-171-2/+5
|\ \ \ | | |/ | |/|
| * | Various minor fixes to unit-test structure around typing notificationsPaul "LeoNerd" Evans2015-04-151-2/+4
| | |
| * | Have TypingNotificationEventSource.get_new_events_for_user() return a ↵Paul "LeoNerd" Evans2015-04-151-1/+2
| |/ | | | | | | deferred, for consistency and extensibility
* / Make work in both Maria and SQLite. Fix testsErik Johnston2015-04-011-9/+0
|/
* Fix testsErik Johnston2015-03-091-4/+4
|
* Fix unit testsKegan Dougal2015-02-271-0/+3
|
* Update testsErik Johnston2015-02-191-0/+1
|
* Merge branch 'develop' into application-servicesKegan Dougal2015-02-115-133/+29
|\
| * Factor out some of the common homeserver setup code into aMark Haines2015-02-115-133/+29
| | | | | | | | setup_test_homeserver function in utils.