summary refs log tree commit diff
path: root/tests/rest/client (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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-292-2/+175
|
* 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-093-3/+3
|
* Fix inconsistent handling of upper and lower cases of email addresses. (#7021)Dirk Klimpel2020-07-031-30/+145
| | | fixes #7016
* 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-162-6/+5
|
* Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-055-37/+48
| | | | | | | | | | 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
|
* Convert sending mail to async/await. (#7557)Erik Johnston2020-05-221-2/+2
| | | | Mainly because sometimes the email push code raises exceptions where the stack traces have gotten lost, which is hopefully fixed by this.
* Allow expired accounts to logout (#7443)Andrew Morgan2020-05-142-2/+103
|
* Do not validate that the client dict is stable during UI Auth. (#7483)Patrick Cloke2020-05-131-45/+10
| | | | This backs out some of the validation for the client dictionary and logs if this changes during a user interactive authentication session instead.
* Rework UI Auth session validation for registration (#7455)Patrick Cloke2020-05-081-88/+216
| | | | Be less strict about validation of UI authentication sessions during registration to match client expecations.
* Persist user interactive authentication sessions (#7302)Patrick Cloke2020-04-301-0/+40
| | | | | By persisting the user interactive authentication sessions to the database, this fixes situations where a user hits different works throughout their auth session and also allows sessions to persist through restarts of Synapse.
* 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.
* Revert "Revert "Merge pull request #7315 from ↵Brendan Abolivier2020-04-232-1/+62
| | | | | | matrix-org/babolivier/request_token"" This reverts commit 1adf6a55870aa08de272591ff49db9dc49738076.
* 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-092-4/+297
|
* Do not allow a deactivated user to login via SSO. (#7240)Patrick Cloke2020-04-091-3/+39
|
* Merge pull request #7157 from matrix-org/rev.outbound_device_pokes_testsRichard van der Hoff2020-03-301-2/+2
|\ | | | | Add tests for outbound device pokes
| * Remove spurious "name" parameter to `default_config`Richard van der Hoff2020-03-241-2/+2
| | | | | | | | | | this is never set to anything other than "test", and is a source of unnecessary boilerplate.
* | 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.
* | Add options to prevent users from changing their profile. (#7096)Dirk Klimpel2020-03-271-0/+302
| |
* | Allow server admins to define and enforce a password policy (MSC2000). (#7118)Dirk Klimpel2020-03-261-0/+179
| |
* | Validate that the session is not modified during UI-Auth (#7068)Patrick Cloke2020-03-261-1/+67
| |
* | Clean up some LoggingContext stuff (#7120)Richard van der Hoff2020-03-241-8/+8
|/ | | | | | | | | | | | | | | | | | | | | | | * Pull Sentinel out of LoggingContext ... and drop a few unnecessary references to it * Factor out LoggingContext.current_context move `current_context` and `set_context` out to top-level functions. Mostly this means that I can more easily trace what's actually referring to LoggingContext, but I think it's generally neater. * move copy-to-parent into `stop` this really just makes `start` and `stop` more symetric. It also means that it behaves correctly if you manually `set_log_context` rather than using the context manager. * Replace `LoggingContext.alive` with `finished` Turn `alive` into `finished` and make it a bit better defined.
* Remove special casing of `m.room.aliases` events (#7034)Patrick Cloke2020-03-171-15/+26
|
* Revert "Add options to disable setting profile info for prevent changes. ↵Richard van der Hoff2020-03-171-303/+0
| | | | | | | (#7053)" This reverts commit 54dd28621b070ca67de9f773fe9a89e1f4dc19da, reversing changes made to 6640460d054e8f4444046a34bdf638921b31c01e.
* Add options to disable setting profile info for prevent changes. (#7053)Brendan Abolivier2020-03-101-0/+303
|\
| * lint, fix testsdklimpel2020-03-091-2/+2
| |
| * updates after reviewdklimpel2020-03-091-10/+7
| |
| * lintdklimpel2020-03-091-10/+8
| |
| * add testsdklimpel2020-03-091-0/+308
| |
* | 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
| |/ |/|
* | Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-13/+15
|/ | | | Ensure good comprehension hygiene using flake8-comprehensions.
* 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
|
* Add `local_current_membership` table (#6655)Erik Johnston2020-01-152-12/+9
| | | | | | | Currently we rely on `current_state_events` to figure out what rooms a user was in and their last membership event in there. However, if the server leaves the room then the table may be cleaned up and that information is lost. So lets add a table that separately holds that information.
* 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
| |
* | Port handlers.account_validity to async/await.Erik Johnston2019-12-101-2/+1
|/
* Fixup functions to consistently return deferredsErik Johnston2019-12-061-1/+3
|
* Fixup testsErik Johnston2019-12-052-1/+12
|
* Merge pull request #6329 from matrix-org/babolivier/context_filtersBrendan Abolivier2019-12-043-100/+381
|\ | | | | Filter state, events_before and events_after in /context requests
| * 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-043-2/+437
| |\ \ \ | | |/ / | |/| |
| * | | LintBrendan Abolivier2019-11-051-30/+41
| | | |
| * | | Update copyrightsBrendan Abolivier2019-11-053-1/+7
| | | |
| * | | 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
| | | |
* | | | Add ephemeral messages support (MSC2228) (#6409)Brendan Abolivier2019-12-031-0/+101
| |/ / |/| | | | | | | | | | | | | | | | | | | | Implement part [MSC2228](https://github.com/matrix-org/matrix-doc/pull/2228). The parts that differ are: * the feature is hidden behind a configuration flag (`enable_ephemeral_messages`) * self-destruction doesn't happen for state events * only implement support for the `m.self_destruct_after` field (not the `m.self_destruct` one) * doesn't send synthetic redactions to clients because for this specific case we consider the clients to be able to destroy an event themselves, instead we just censor it (by pruning its JSON) in the database
* | | Add testsErik Johnston2019-11-281-0/+140
| | |
* | | Merge pull request #6358 from matrix-org/babolivier/message_retentionBrendan Abolivier2019-11-271-0/+293
|\ \ \ | | | | | | | | Implement message retention policies (MSC1763)
| * \ \ Merge branch 'develop' into babolivier/message_retentionBrendan Abolivier2019-11-261-0/+74
| |\ \ \ | | | |/ | | |/|
| * | | Don't restrict the tests to v1 roomsBrendan Abolivier2019-11-261-2/+0
| | | |
| * | | Lint againBrendan Abolivier2019-11-191-10/+2
| | | |
| * | | LintBrendan Abolivier2019-11-191-50/+23
| | | |
| * | | Don't apply retention policy based filtering on state eventsBrendan Abolivier2019-11-061-0/+10
| | | | | | | | | | | | | | | | As per MSC1763, 'Retention is only considered for non-state events.', so don't filter out state events based on the room's retention policy.
| * | | Implement per-room message retention policiesBrendan Abolivier2019-11-041-0/+320
| | |/ | |/|
* | | Remove assertion and provide a clear warning on startup for missing ↵Andrew Morgan2019-11-261-0/+1
| |/ |/| | | | | public_baseurl (#6379)
* | LintBrendan Abolivier2019-11-201-6/+8
| |
* | Test if a purge can make /messages return 500 responsesBrendan Abolivier2019-11-201-0/+72
|/
* Incorporate reviewBrendan Abolivier2019-11-012-8/+8
|
* Incorporate reviewBrendan Abolivier2019-11-012-10/+10
|
* LintBrendan Abolivier2019-10-302-31/+30
|
* Add integration tests for /messagesBrendan Abolivier2019-10-301-1/+101
|
* Add more integration testingBrendan Abolivier2019-10-301-6/+39
|
* Add integration tests for syncBrendan Abolivier2019-10-302-5/+122
|
* Add domain validation when creating room with list of invitees (#6121)werner2912019-10-101-0/+9
|
* send 404 as http-status when filter-id is unknown to the server (#2380)krombel2019-10-101-1/+1
| | | | | | | This fixed the weirdness of 400 vs 404 as http status code in the case the filter id is not known by the server. As e.g. matrix-js-sdk expects 404 to catch this situation this leads to unwanted behaviour.
* okBrendan Abolivier2019-09-271-1/+3
|
* LintBrendan Abolivier2019-09-271-7/+1
|
* Add test to validate the changeBrendan Abolivier2019-09-271-13/+57
|
* Stop advertising unsupported flows for registration (#6107)Richard van der Hoff2019-09-251-12/+17
| | | | | | | If email or msisdn verification aren't supported, let's stop advertising them for registration. Fixes #6100.
* Refactor the user-interactive auth handling (#6105)Richard van der Hoff2019-09-251-10/+16
| | | | | | | Pull the checkers out to their own classes, rather than having them lost in a massive 1000-line class which does everything. This is also preparation for some more intelligent advertising of flows, as per #6100
* Refactor code for calculating registration flows (#6106)Richard van der Hoff2019-09-251-12/+67
| | | | | | | | | because, frankly, it looked like it was written by an axe-murderer. This should be a non-functional change, except that where `m.login.dummy` was previously advertised *before* `m.login.terms`, it will now be advertised afterwards. AFAICT that should have no effect, and will be more consistent with the flows that involve passing a 3pid.
* Fix commentsErik Johnston2019-09-111-2/+2
| | | Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Add test for admin redaction ratelimiting.Erik Johnston2019-09-111-0/+25
|
* Fix and refactor room and user stats (#5971)Erik Johnston2019-09-041-2/+6
| | | Previously the stats were not being correctly populated.
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-1/+1
| | | | | Python will return a tuple whether there are parentheses around the returned values or not. I'm just sick of my editor complaining about this all over the place :)
* Add testsBrendan Abolivier2019-08-011-0/+37
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-1/+1
|
* Remove the ability to query relations when the original event was redacted. ↵Andrew Morgan2019-07-181-3/+113
| | | | | | | (#5629) Fixes #5594 Forbid viewing relations on an event once it has been redacted.
* Ignore redactions of m.room.create events (#5701)Richard van der Hoff2019-07-171-0/+20
|
* More refactoring in `get_events_as_list` (#5707)Richard van der Hoff2019-07-171-0/+159
| | | | | | | | We can now use `_get_events_from_cache_or_db` rather than going right back to the database, which means that (a) we can benefit from caching, and (b) it opens the way forward to more extensive checks on the original event. We now always require the original event to exist before we will serve up a redaction.
* 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.
* Include the original event in /relations (#5626)Andrew Morgan2019-07-091-0/+5
| | | When asking for the relations of an event, include the original event in the response. This will mostly be used for efficiently showing edit history, but could be useful in other circumstances.
* LintBrendan Abolivier2019-07-081-2/+2
|
* Add test caseBrendan Abolivier2019-07-081-0/+47
|
* Add origin_server_ts and sender fields to m.replace (#5613)Andrew Morgan2019-07-051-6/+18
| | | | | Riot team would like some extra fields as part of m.replace, so here you go. Fixes: #5598
* Move logging utilities out of the side drawer of util/ and into logging/ (#5606)Amber Brown2019-07-041-1/+1
|
* Split public rooms directory auth config in twoBrendan Abolivier2019-06-241-1/+1
|
* Run Black. (#5482)Amber Brown2019-06-209-90/+73
|
* Merge pull request #5440 from matrix-org/babolivier/third_party_event_rulesBrendan Abolivier2019-06-141-0/+79
|\ | | | | Allow server admins to define implementations of extra rules for allowing or denying incoming events
| * Add plugin APIs for implementations of custom event rules.Brendan Abolivier2019-06-141-0/+79
| |
* | Don't send renewal emails to deactivated usersBrendan Abolivier2019-06-141-25/+42
| |
* | Track deactivated accounts in the database (#5378)Brendan Abolivier2019-06-141-0/+45
| |
* | Merge branch 'master' of github.com:matrix-org/synapse into developErik Johnston2019-06-113-12/+241
|\ \
| * | Bump bleach version so that tests can run on old deps.Erik Johnston2019-06-112-12/+0
| | |
| * | Change password reset links to /_matrix.Erik Johnston2019-06-111-0/+241
| |/
* | Merge pull request #5363 from ↵Brendan Abolivier2019-06-101-0/+35
|\ \ | |/ |/| | | | | matrix-org/babolivier/account_validity_send_mail_auth Don't check whether the user's account is expired on /send_mail requests
| * Don't check whether the user's account is expired on /send_mail requestsBrendan Abolivier2019-06-051-0/+35
| |
* | 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
| | |
* | | Merge pull request #5276 from matrix-org/babolivier/account_validity_job_deltaErik Johnston2019-05-311-5/+10
|\ \ \ | | | | | | | | Allow configuring a range for the account validity startup job
| * | | Move delta from +10% to -10%Brendan Abolivier2019-05-311-2/+2
| | | |
| * | | Make max_delta equal to period * 10%Brendan Abolivier2019-05-311-17/+1
| | | |
| * | | TypoBrendan Abolivier2019-05-281-1/+1
| | | |
| * | | Allow configuring a range for the account validity startup jobBrendan Abolivier2019-05-281-0/+21
| | |/ | |/| | | | | | | | | | When enabling the account validity feature, Synapse will look at startup for registered account without an expiration date, and will set one equals to 'now + validity_period' for them. On large servers, it can mean that a large number of users will have the same expiration date, which means that they will all be sent a renewal email at the same time, which isn't ideal. In order to mitigate this, this PR allows server admins to define a 'max_delta' so that the expiration date is a random value in the [now + validity_period ; now + validity_period + max_delta] range. This allows renewal emails to be progressively sent over a configured period instead of being sent all in one big batch.
* | | Add config option for setting homeserver's default room version (#5223)Andrew Morgan2019-05-231-2/+5
| | | | | | | | | | | | | | | Replaces DEFAULT_ROOM_VERSION constant with a method that first checks the config, then returns a hardcoded value if the option is not present. That hardcoded value is now located in the server.py config file.
* | | Room Statistics (#4338)Amber Brown2019-05-211-0/+17
| |/ |/|
* | Merge pull request #5212 from matrix-org/erikj/deny_multiple_reactionsErik Johnston2019-05-211-1/+26
|\ \ | | | | | | Block attempts to annotate the same event twice
| * | Block attempts to annotate the same event twiceErik Johnston2019-05-201-1/+26
| | |
* | | Merge pull request #5204 from ↵Brendan Abolivier2019-05-211-0/+55
|\ \ \ | |/ / |/| / | |/ | | matrix-org/babolivier/account_validity_expiration_date Add startup background job for account validity
| * Add startup background job for account validityBrendan Abolivier2019-05-171-0/+55
| | | | | | | | If account validity is enabled in the server's configuration, this job will run at startup as a background job and will stick an expiration date to any registered account missing one.
* | Rename relation types to match MSCErik Johnston2019-05-201-11/+11
| |
* | Merge pull request #5209 from matrix-org/erikj/reactions_baseErik Johnston2019-05-201-0/+539
|\ \ | | | | | | Land basic reaction and edit support.
| * | Fixup commentsErik Johnston2019-05-201-2/+2
| | |
| * | Correctly update aggregation counts after redactionErik Johnston2019-05-201-0/+37
| | |
| * | Make tests use different user for each reaction it sendsErik Johnston2019-05-171-12/+68
| | | | | | | | | | | | As users aren't allowed to react with the same emoji more than once.
| * | Add basic editing supportErik Johnston2019-05-161-9/+82
| | |
| * | Check that event is visible in new APIsErik Johnston2019-05-161-1/+1
| | |
| * | Add aggregations APIErik Johnston2019-05-161-3/+248
| | |
| * | Add simple pagination APIErik Johnston2019-05-151-0/+30
| | |
| * | Add simple send_relation API and track in DBErik Johnston2019-05-151-0/+98
| | |
* | | Merge pull request #5196 from matrix-org/babolivier/per_room_profilesBrendan Abolivier2019-05-171-1/+69
|\ \ \ | | |/ | |/| Add an option to disable per-room profiles
| * | 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
| |/
* | Merge pull request #5174 from matrix-org/dbkr/add_dummy_flow_to_recaptcha_onlyDavid Baker2019-05-161-1/+8
|\ \ | |/ |/| Re-order registration stages to do msisdn & email auth last
| * And now I realise why the test is failing...David Baker2019-05-131-1/+8
| |
* | Migrate all tests to use the dict-based config format instead of hanging ↵Amber Brown2019-05-138-34/+48
|/ | | | items off HomeserverConfig (#5171)
* Run Black on the tests again (#5170)Amber Brown2019-05-105-134/+72
|
* 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-029-10/+10
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-0110-636/+27
| | | | It doesn't really belong under rest/client/v1 any more.
* Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-04-173-2/+191
|\ | | | | | | babolivier/account_expiration
| * Merge pull request #5047 from matrix-org/babolivier/account_expirationBrendan Abolivier2019-04-171-1/+99
| |\ | | | | | | Send out emails with links to extend an account's validity period
| * \ Merge pull request #5027 from matrix-org/babolivier/account_expirationBrendan Abolivier2019-04-091-2/+49
| |\ \ | | | | | | | | Add time-based account expiration
| * | | Add config option to block users from looking up 3PIDs (#5010)Brendan Abolivier2019-04-041-0/+65
| | | |
| * | | Add unit test for deleting groupsErik Johnston2019-04-031-0/+124
| | | |
| * | | Collect room-version variations into one place (#4969)Richard van der Hoff2019-04-011-2/+2
| | | | | | | | | | | | | | | | Collect all the things that make room-versions different to one another into one place, so that it's easier to define new room versions.
* | | | Add management endpoints for account validityBrendan Abolivier2019-04-171-8/+87
| |_|/ |/| |
* | | Send out emails with links to extend an account's validity periodBrendan Abolivier2019-04-171-1/+99
| |/ |/|
* | Add account expiration featureBrendan Abolivier2019-04-091-2/+49
|/
* 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
|
* Fix registration testRichard van der Hoff2019-03-191-1/+2
| | | | | * Set allow_guest_access = True, since we rely on it * config doesn't have a `hostname` attribute; it is `server_name`
* Add ratelimiting on failed login attempts (#4865)Brendan Abolivier2019-03-181-0/+45
|
* Add ratelimiting on login (#4821)Brendan Abolivier2019-03-152-2/+122
| | | 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-054-7/+55
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Move register_device into handlerErik Johnston2019-02-181-70/+23
|
* Fix unit testsErik Johnston2019-02-181-6/+15
|
* rework format of change password capabilityNeil Johnson2019-01-291-2/+2
|
* support change_password in capabilities end-pointNeil Johnson2019-01-291-0/+23
|
* isortNeil Johnson2019-01-291-1/+2
|
* enforce auth for capabilities endpointNeil Johnson2019-01-291-4/+19
|
* Support room version capabilities in CS API (MSC1804)Neil Johnson2019-01-251-0/+39
|
* 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.
* Fix fallback auth on Python 3 (#4197)Amber Brown2018-11-191-0/+104
|
* Add a test for the public T&Cs formRichard van der Hoff2018-11-141-0/+7
|
* Remove some boilerplate in tests (#4156)Amber Brown2018-11-075-178/+117
|
* Tests for user consent resource (#4140)Amber Brown2018-11-061-0/+111
|
* Fix typing being reset causing infinite syncs (#4127)Amber Brown2018-11-031-0/+123
|
* Fix search 500ing (#4122)Amber Brown2018-10-311-1/+105
|
* Port tests/ to Python 3 (#3808)Amber Brown2018-09-072-311/+258
|
* Port storage/ to Python 3 (#3725)Amber Brown2018-08-311-4/+10
|
* Integrate presence from hotfixes (#3694)Amber Brown2018-08-182-46/+105
|
* Fix the testsAmber Brown2018-08-155-45/+24
|
* 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-139-5/+9
|
* Run black.black2018-08-108-128/+117
|
* Test fixes for Python 3 (#3647)Amber Brown2018-08-097-36/+36
|
* 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-195-86/+27
|
* Refactor REST API tests to use explicit reactors (#3351)Amber Brown2018-07-177-921/+902
|
* Make auth & transactions more testable (#3499)Amber Brown2018-07-141-1/+4
|
* run isortAmber Brown2018-07-0910-41/+44
|
* Pass around the reactor explicitly (#3385)Amber Brown2018-06-221-3/+3
|
* Fix logcontext leak in HttpTransactionCacheRichard van der Hoff2018-05-211-0/+21
| | | | ONE DAY I WILL PURGE THE WORLD OF THIS EVIL
* Stop the transaction cache caching failuresRichard van der Hoff2018-05-211-0/+54
| | | | | | The transaction cache has some code which tries to stop it caching failures, but if the callback function failed straight away, then things would happen backwards and we'd end up with the failure stuck in the cache.
* 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
|
* mock registrations_require_3pidMatthew Hodgson2018-01-191-0/+1
|
* Remove dead codeRichard van der Hoff2018-01-091-3/+0
| | | | pointless function is pointless
* Refactor UI auth implementationRichard van der Hoff2017-12-051-4/+7
| | | | | Instead of returning False when auth is incomplete, throw an exception which can be caught with a wrapper.
* Fix testDavid Baker2017-10-171-0/+1
|
* Split out profile handler to fix testsErik Johnston2017-08-251-2/+1
|
* Add groups to sync streamErik Johnston2017-07-201-2/+2
|
* use jsonschema.FormatChecker for RoomID and UserID stringspik2017-03-231-2/+2
| | | | | | * use a valid filter in rest/client/v2_alpha test Signed-off-by: pik <alexander.maznev@gmail.com>
* 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
|
* Stop generating refresh tokensRichard van der Hoff2016-11-281-8/+4
| | | | | | | Since we're not doing refresh tokens any more, we should start killing off the dead code paths. /tokenrefresh itself is a bit of a thornier subject, since there might be apps out there using it, but we can at least not generate refresh tokens on new logins.
* Clean transactions based on time. Add HttpTransactionCache tests.Kegan Dougal2016-11-141-0/+69
|
* Merge pull request #1098 from matrix-org/markjh/bearer_tokenMark Haines2016-10-252-0/+4
|\ | | | | Allow clients to supply access_tokens as headers
| * Fix unit testsMark Haines2016-09-122-0/+4
| |
* | Merge pull request #1164 from pik/error-codesErik Johnston2016-10-191-40/+87
|\ \ | | | | | | Clarify Error codes for GET /filter/
| * | Refactor test_filter to use real DataStorepik2016-10-181-43/+81
| | | | | | | | | | | | * add tests for filter api errors
| * | Error codes for filtersAlexander Maznev2016-10-141-3/+12
| | | | | | | | | | | | | | | | | | * add tests Signed-off-by: Alexander Maznev <alexander.maznev@gmail.com>
* | | rest/client/v1/register: use the correct requester in createUserPatrik Oldsberg2016-10-061-21/+9
| | | | | | | | | | | | Signed-off-by: Patrik Oldsberg <patrik.oldsberg@ericsson.com>
* | | storage/appservice: make appservice methods only relying on the cache ↵Patrik Oldsberg2016-10-061-1/+1
|/ / | | | | | | synchronous
* / 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
* Implement deleting devicesRichard van der Hoff2016-07-261-4/+10
|
* Register a device_id in the /v2/register flow.Richard van der Hoff2016-07-201-3/+10
| | | | | | | | | | This doesn't cover *all* of the registration flows, but it does cover the most common ones: in particular: shared_secret registration, appservice registration, and normal user/pass registration. Pull device_id from the registration parameters. Register the device in the devices table. Associate the device with the returned access and refresh tokens. Profit.
* Further registration refactoringRichard van der Hoff2016-07-191-1/+5
| | | | | | | | | | | | | | * `RegistrationHandler.appservice_register` no longer issues an access token: instead it is left for the caller to do it. (There are two of these, one in `synapse/rest/client/v1/register.py`, which now simply calls `AuthHandler.issue_access_token`, and the other in `synapse/rest/client/v2_alpha/register.py`, which is covered below). * In `synapse/rest/client/v2_alpha/register.py`, move the generation of access_tokens into `_create_registration_details`. This means that the normal flow no longer needs to call `AuthHandler.issue_access_token`; the shared-secret flow can tell `RegistrationHandler.register` not to generate a token; and the appservice flow continues to work despite the above change.
* rest/client/v2_alpha/register.py: Refactor flow somewhat.Richard van der Hoff2016-07-191-1/+2
| | | | | | | | | | | This is meant to be an *almost* non-functional change, with the exception that it fixes what looks a lot like a bug in that it only calls `auth_handler.add_threepid` and `add_pusher` once instead of three times. The idea is to move the generation of the `access_token` out of `registration_handler.register`, because `access_token`s now require a device_id, and we only want to generate a device_id once registration has been successful.
* Split out the auth handlerDavid Baker2016-06-021-1/+1
|
* 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
|
* Fix testsDavid Baker2016-03-161-4/+5
|
* Use parse_json_object_from_request to parse JSON out of request bodiesMark Haines2016-03-111-2/+4
|
* Flake8 fixblide2016-03-101-6/+6
|