summary refs log tree commit diff
path: root/tests/rest/client/v2_alpha (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix some spelling mistakes / typos. (#7811)Patrick Cloke2020-07-091-1/+1
|
* Fix inconsistent handling of upper and lower cases of email addresses. (#7021)Dirk Klimpel2020-07-031-30/+145
| | | fixes #7016
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-5/+4
|
* Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-051-6/+3
| | | | | | | | | | 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.
* 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-141-1/+35
|
* 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.
* Revert "Revert "Merge pull request #7315 from ↵Brendan Abolivier2020-04-232-1/+62
| | | | | | matrix-org/babolivier/request_token"" This reverts commit 1adf6a55870aa08de272591ff49db9dc49738076.
* 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.
* | 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
|/
* 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.
* 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
|
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-13/+15
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* 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.
* Port handlers.account_validity to async/await.Erik Johnston2019-12-101-2/+1
|
* Merge branch 'develop' into babolivier/context_filtersBrendan Abolivier2019-12-041-0/+1
|\
| * Remove assertion and provide a clear warning on startup for missing ↵Andrew Morgan2019-11-261-0/+1
| | | | | | | | public_baseurl (#6379)
* | Update copyrightsBrendan Abolivier2019-11-051-1/+2
|/
* Incorporate reviewBrendan Abolivier2019-11-011-4/+4
|
* Incorporate reviewBrendan Abolivier2019-11-011-5/+5
|
* LintBrendan Abolivier2019-10-301-6/+6
|
* Add more integration testingBrendan Abolivier2019-10-301-6/+39
|
* Add integration tests for syncBrendan Abolivier2019-10-301-2/+110
|
* 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.
* 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
|
* 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.
* 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.
* 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
* Run Black. (#5482)Amber Brown2019-06-204-50/+40
|
* 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-112-6/+241
|\
| * Bump bleach version so that tests can run on old deps.Erik Johnston2019-06-111-6/+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
| |
* | 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.
* | 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 #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-132-23/+34
|/ | | | items off HomeserverConfig (#5171)
* Run Black on the tests again (#5170)Amber Brown2019-05-101-45/+37
|
* Add admin api for sending server_notices (#5121)Richard van der Hoff2019-05-024-5/+5
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-014-10/+12
| | | | It doesn't really belong under rest/client/v1 any more.
* Merge branch 'develop' of github.com:matrix-org/synapse into ↵Erik Johnston2019-04-171-2/+2
|\ | | | | | | 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
| * | | 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
|/
* 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 login (#4821)Brendan Abolivier2019-03-151-2/+4
| | | Add two ratelimiters on login (per-IP address and per-userID).
* Add rate-limiting on registration (#4735)Brendan Abolivier2019-03-051-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
|
* Fix fallback auth on Python 3 (#4197)Amber Brown2018-11-191-0/+104
|
* Remove some boilerplate in tests (#4156)Amber Brown2018-11-072-95/+52
|
* Fix typing being reset causing infinite syncs (#4127)Amber Brown2018-11-031-0/+123
|
* Port tests/ to Python 3 (#3808)Amber Brown2018-09-071-7/+1
|
* Integrate presence from hotfixes (#3694)Amber Brown2018-08-181-46/+33
|
* Fix the testsAmber Brown2018-08-153-35/+19
|
* Run tests under PostgreSQL (#3423)Amber Brown2018-08-133-3/+3
|
* Run black.black2018-08-101-13/+4
|
* Test fixes for Python 3 (#3647)Amber Brown2018-08-093-20/+20
|
* Move v1-only APIs into their own module & isolate deprecated ones (#3460)Amber Brown2018-07-192-4/+12
|
* Refactor REST API tests to use explicit reactors (#3351)Amber Brown2018-07-174-208/+276
|
* run isortAmber Brown2018-07-093-15/+14
|
* mock registrations_require_3pidMatthew Hodgson2018-01-191-0/+1
|
* 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
|
* 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>
* 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.
* 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
| |
* | 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>
* / storage/appservice: make appservice methods only relying on the cache ↵Patrik Oldsberg2016-10-061-1/+1
|/ | | | synchronous
* 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
|
* Fix testsDavid Baker2016-03-161-4/+5
|
* Flake8 fixblide2016-03-101-6/+6
|
* Register endpoint returns refresh_tokenblide2016-03-101-12/+18
| | | | Guest registration still doesn't return refresh_token
* Fix testsDavid Baker2016-03-071-2/+2
|
* Fix flake8 warnings for testsMark Haines2016-02-193-14/+11
|
* Rename config field to reflect yaml nameDaniel Wagner-Hall2016-02-031-2/+2
|
* copyrightsMatthew Hodgson2016-01-072-2/+2
|
* Allow guests to register and call /events?room_id=Daniel Wagner-Hall2015-11-041-1/+2
| | | | | | | 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.
* s/user_id/user/g for consistencyDaniel Wagner-Hall2015-09-011-1/+1
|
* Attempt to validate macaroonsDaniel Wagner-Hall2015-08-261-2/+2
| | | | | | | | | | | | | 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-251-1/+0
|
* Remove completely unused concepts from codebaseDaniel Wagner-Hall2015-08-251-1/+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.
* Merge branch 'develop' into refreshDaniel Wagner-Hall2015-08-201-1/+2
|\ | | | | | | | | Conflicts: synapse/rest/client/v1/login.py
| * Fix testsDavid Baker2015-08-041-1/+2
| |
* | s/by_token/by_access_token/gDaniel Wagner-Hall2015-08-201-2/+2
|/ | | | We're about to have two kinds of token, access and refresh
* Use the same reg paths as register v1 for ASes.Kegan Dougal2015-07-291-1/+3
| | | | Namely this means using registration_handler.appservice_register.
* Fix v2_alpha registration. Add unit tests.Kegan Dougal2015-07-281-0/+132
| | | | | | | | V2 Registration forced everyone (including ASes) to create a password for a user, when ASes should be able to omit passwords. Also unbreak AS registration in general which checked too early if the given username was claimed by an AS; it was checked before knowing if the AS was the one doing the registration! Add unit tests for AS reg, user reg and disabled_registration flag.
* Merge branch 'develop' into application-servicesKegan Dougal2015-02-111-8/+5
|\
| * Factor out some of the common homeserver setup code into aMark Haines2015-02-111-8/+5
| | | | | | | | setup_test_homeserver function in utils.
* | Modify auth.get_user_by_req for authing appservices directly.Kegan Dougal2015-02-091-1/+3
|/ | | | | | Add logic to map the appservice token to the autogenned appservice user ID. Add unit tests for all forms of get_user_by_req (user/appservice, valid/bad/missing tokens)
* Merge in auth changes from developMark Haines2015-01-291-0/+1
|
* More unit-testing of REST errorsPaul "LeoNerd" Evans2015-01-271-1/+35
|
* Move storage of user filters into real datastore layer; now have to mock it ↵Paul "LeoNerd" Evans2015-01-272-3/+27
| | | | out in the REST-level tests
* Use new V2AlphaRestTestCasePaul "LeoNerd" Evans2015-01-271-38/+2
|
* Merge branch 'develop' into client_v2_filterPaul "LeoNerd" Evans2015-01-271-0/+45
|\
| * Initial cut of a shared base class for REST unit testsPaul "LeoNerd" Evans2015-01-271-0/+45
| |
* | Minor changes to v2_alpha filter REST test to allow the setUp method to be ↵Paul "LeoNerd" Evans2015-01-271-5/+7
| | | | | | | | shareable
* | Initial trivial REST test of v2_alpha filter APIPaul "LeoNerd" Evans2015-01-261-0/+74
|/
* Create (empty) v2_alpha REST tests directoryPaul "LeoNerd" Evans2015-01-261-0/+15