summary refs log tree commit diff
path: root/synapse/rest/client/v2_alpha/register.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'v1.38.0' into babolivier/dinsic_1.41.0Brendan Abolivier2021-09-011-21/+77
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.38.0 (2021-07-13) =========================== This release includes a database schema update which could result in elevated disk usage. See the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#upgrading-to-v1380) for more information. No significant changes since 1.38.0rc3. Synapse 1.38.0rc3 (2021-07-13) ============================== Internal Changes ---------------- - Build the Debian packages in CI. ([\#10247](https://github.com/matrix-org/synapse/issues/10247), [\#10379](https://github.com/matrix-org/synapse/issues/10379)) Synapse 1.38.0rc2 (2021-07-09) ============================== Bugfixes -------- - Fix bug where inbound federation in a room could be delayed due to not correctly dropping a lock. Introduced in v1.37.1. ([\#10336](https://github.com/matrix-org/synapse/issues/10336)) Improved Documentation ---------------------- - Update links to documentation in the sample config. Contributed by @dklimpel. ([\#10287](https://github.com/matrix-org/synapse/issues/10287)) - Fix broken links in [INSTALL.md](INSTALL.md). Contributed by @dklimpel. ([\#10331](https://github.com/matrix-org/synapse/issues/10331)) Synapse 1.38.0rc1 (2021-07-06) ============================== Features -------- - Implement refresh tokens as specified by [MSC2918](https://github.com/matrix-org/matrix-doc/pull/2918). ([\#9450](https://github.com/matrix-org/synapse/issues/9450)) - Add support for evicting cache entries based on last access time. ([\#10205](https://github.com/matrix-org/synapse/issues/10205)) - Omit empty fields from the `/sync` response. Contributed by @deepbluev7. ([\#10214](https://github.com/matrix-org/synapse/issues/10214)) - Improve validation on federation `send_{join,leave,knock}` endpoints. ([\#10225](https://github.com/matrix-org/synapse/issues/10225), [\#10243](https://github.com/matrix-org/synapse/issues/10243)) - Add SSO `external_ids` to the Query User Account admin API. ([\#10261](https://github.com/matrix-org/synapse/issues/10261)) - Mark events received over federation which fail a spam check as "soft-failed". ([\#10263](https://github.com/matrix-org/synapse/issues/10263)) - Add metrics for new inbound federation staging area. ([\#10284](https://github.com/matrix-org/synapse/issues/10284)) - Add script to print information about recently registered users. ([\#10290](https://github.com/matrix-org/synapse/issues/10290)) Bugfixes -------- - Fix a long-standing bug which meant that invite rejections and knocks were not sent out over federation in a timely manner. ([\#10223](https://github.com/matrix-org/synapse/issues/10223)) - Fix a bug introduced in v1.26.0 where only users who have set profile information could be deactivated with erasure enabled. ([\#10252](https://github.com/matrix-org/synapse/issues/10252)) - Fix a long-standing bug where Synapse would return errors after 2<sup>31</sup> events were handled by the server. ([\#10264](https://github.com/matrix-org/synapse/issues/10264), [\#10267](https://github.com/matrix-org/synapse/issues/10267), [\#10282](https://github.com/matrix-org/synapse/issues/10282), [\#10286](https://github.com/matrix-org/synapse/issues/10286), [\#10291](https://github.com/matrix-org/synapse/issues/10291), [\#10314](https://github.com/matrix-org/synapse/issues/10314), [\#10326](https://github.com/matrix-org/synapse/issues/10326)) - Fix the prometheus `synapse_federation_server_pdu_process_time` metric. Broke in v1.37.1. ([\#10279](https://github.com/matrix-org/synapse/issues/10279)) - Ensure that inbound events from federation that were being processed when Synapse was restarted get promptly processed on start up. ([\#10303](https://github.com/matrix-org/synapse/issues/10303)) Improved Documentation ---------------------- - Move the upgrade notes to [docs/upgrade.md](https://github.com/matrix-org/synapse/blob/develop/docs/upgrade.md) and convert them to markdown. ([\#10166](https://github.com/matrix-org/synapse/issues/10166)) - Choose Welcome & Overview as the default page for synapse documentation website. ([\#10242](https://github.com/matrix-org/synapse/issues/10242)) - Adjust the URL in the README.rst file to point to irc.libera.chat. ([\#10258](https://github.com/matrix-org/synapse/issues/10258)) - Fix homeserver config option name in presence router documentation. ([\#10288](https://github.com/matrix-org/synapse/issues/10288)) - Fix link pointing at the wrong section in the modules documentation page. ([\#10302](https://github.com/matrix-org/synapse/issues/10302)) Internal Changes ---------------- - Drop `Origin` and `Accept` from the value of the `Access-Control-Allow-Headers` response header. ([\#10114](https://github.com/matrix-org/synapse/issues/10114)) - Add type hints to the federation servlets. ([\#10213](https://github.com/matrix-org/synapse/issues/10213)) - Improve the reliability of auto-joining remote rooms. ([\#10237](https://github.com/matrix-org/synapse/issues/10237)) - Update the release script to use the semver terminology and determine the release branch based on the next version. ([\#10239](https://github.com/matrix-org/synapse/issues/10239)) - Fix type hints for computing auth events. ([\#10253](https://github.com/matrix-org/synapse/issues/10253)) - Improve the performance of the spaces summary endpoint by only recursing into spaces (and not rooms in general). ([\#10256](https://github.com/matrix-org/synapse/issues/10256)) - Move event authentication methods from `Auth` to `EventAuthHandler`. ([\#10268](https://github.com/matrix-org/synapse/issues/10268)) - Re-enable a SyTest after it has been fixed. ([\#10292](https://github.com/matrix-org/synapse/issues/10292))
| * MSC2918 Refresh tokens implementation (#9450)Quentin Gliech2021-06-241-18/+70
| | | | | | | | | | | | | | | | | | | | This implements refresh tokens, as defined by MSC2918 This MSC has been implemented client side in Hydrogen Web: vector-im/hydrogen-web#235 The basics of the MSC works: requesting refresh tokens on login, having the access tokens expire, and using the refresh token to get a new one. Signed-off-by: Quentin Gliech <quentingliech@gmail.com>
* | Merge tag 'v1.33.0' into babolivier/dinsic_1.41.0Brendan Abolivier2021-08-311-6/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.33.0 (2021-05-05) =========================== Features -------- - Build Debian packages for Ubuntu 21.04 (Hirsute Hippo). ([\#9909](https://github.com/matrix-org/synapse/issues/9909)) Synapse 1.33.0rc2 (2021-04-29) ============================== Bugfixes -------- - Fix tight loop when handling presence replication when using workers. Introduced in v1.33.0rc1. ([\#9900](https://github.com/matrix-org/synapse/issues/9900)) Synapse 1.33.0rc1 (2021-04-28) ============================== Features -------- - Update experimental support for [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083): restricting room access via group membership. ([\#9800](https://github.com/matrix-org/synapse/issues/9800), [\#9814](https://github.com/matrix-org/synapse/issues/9814)) - Add experimental support for handling presence on a worker. ([\#9819](https://github.com/matrix-org/synapse/issues/9819), [\#9820](https://github.com/matrix-org/synapse/issues/9820), [\#9828](https://github.com/matrix-org/synapse/issues/9828), [\#9850](https://github.com/matrix-org/synapse/issues/9850)) - Return a new template when an user attempts to renew their account multiple times with the same token, stating that their account is set to expire. This replaces the invalid token template that would previously be shown in this case. This change concerns the optional account validity feature. ([\#9832](https://github.com/matrix-org/synapse/issues/9832)) Bugfixes -------- - Fixes the OIDC SSO flow when using a `public_baseurl` value including a non-root URL path. ([\#9726](https://github.com/matrix-org/synapse/issues/9726)) - Fix thumbnail generation for some sites with non-standard content types. Contributed by @rkfg. ([\#9788](https://github.com/matrix-org/synapse/issues/9788)) - Add some sanity checks to identity server passed to 3PID bind/unbind endpoints. ([\#9802](https://github.com/matrix-org/synapse/issues/9802)) - Limit the size of HTTP responses read over federation. ([\#9833](https://github.com/matrix-org/synapse/issues/9833)) - Fix a bug which could cause Synapse to get stuck in a loop of resyncing device lists. ([\#9867](https://github.com/matrix-org/synapse/issues/9867)) - Fix a long-standing bug where errors from federation did not propagate to the client. ([\#9868](https://github.com/matrix-org/synapse/issues/9868)) Improved Documentation ---------------------- - Add a note to the docker docs mentioning that we mirror upstream's supported Docker platforms. ([\#9801](https://github.com/matrix-org/synapse/issues/9801)) Internal Changes ---------------- - Add a dockerfile for running Synapse in worker-mode under Complement. ([\#9162](https://github.com/matrix-org/synapse/issues/9162)) - Apply `pyupgrade` across the codebase. ([\#9786](https://github.com/matrix-org/synapse/issues/9786)) - Move some replication processing out of `generic_worker`. ([\#9796](https://github.com/matrix-org/synapse/issues/9796)) - Replace `HomeServer.get_config()` with inline references. ([\#9815](https://github.com/matrix-org/synapse/issues/9815)) - Rename some handlers and config modules to not duplicate the top-level module. ([\#9816](https://github.com/matrix-org/synapse/issues/9816)) - Fix a long-standing bug which caused `max_upload_size` to not be correctly enforced. ([\#9817](https://github.com/matrix-org/synapse/issues/9817)) - Reduce CPU usage of the user directory by reusing existing calculated room membership. ([\#9821](https://github.com/matrix-org/synapse/issues/9821)) - Small speed up for joining large remote rooms. ([\#9825](https://github.com/matrix-org/synapse/issues/9825)) - Introduce flake8-bugbear to the test suite and fix some of its lint violations. ([\#9838](https://github.com/matrix-org/synapse/issues/9838)) - Only store the raw data in the in-memory caches, rather than objects that include references to e.g. the data stores. ([\#9845](https://github.com/matrix-org/synapse/issues/9845)) - Limit length of accepted email addresses. ([\#9855](https://github.com/matrix-org/synapse/issues/9855)) - Remove redundant `synapse.types.Collection` type definition. ([\#9856](https://github.com/matrix-org/synapse/issues/9856)) - Handle recently added rate limits correctly when using `--no-rate-limit` with the demo scripts. ([\#9858](https://github.com/matrix-org/synapse/issues/9858)) - Disable invite rate-limiting by default when running the unit tests. ([\#9871](https://github.com/matrix-org/synapse/issues/9871)) - Pass a reactor into `SynapseSite` to make testing easier. ([\#9874](https://github.com/matrix-org/synapse/issues/9874)) - Make `DomainSpecificString` an `attrs` class. ([\#9875](https://github.com/matrix-org/synapse/issues/9875)) - Add type hints to `synapse.api.auth` and `synapse.api.auth_blocking` modules. ([\#9876](https://github.com/matrix-org/synapse/issues/9876)) - Remove redundant `_PushHTTPChannel` test class. ([\#9878](https://github.com/matrix-org/synapse/issues/9878)) - Remove backwards-compatibility code for Python versions < 3.6. ([\#9879](https://github.com/matrix-org/synapse/issues/9879)) - Small performance improvement around handling new local presence updates. ([\#9887](https://github.com/matrix-org/synapse/issues/9887))
| * Limit length of accepted email addresses (#9855)Erik Johnston2021-04-221-2/+6
| |
| * Rename handler and config modules which end in handler/config. (#9816)Patrick Cloke2021-04-201-1/+1
| |
| * Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-141-1/+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>`
* | Merge tag 'v1.32.0' into babolivier/dinsic_1.41.0Brendan Abolivier2021-08-311-6/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synapse 1.32.0 (2021-04-20) =========================== **Note:** This release requires Python 3.6+ and Postgres 9.6+ or SQLite 3.22+. This release removes the deprecated `GET /_synapse/admin/v1/users/<user_id>` admin API. Please use the [v2 API](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/user_admin_api.rst#query-user-account) instead, which has improved capabilities. This release requires Application Services to use type `m.login.application_service` when registering users via the `/_matrix/client/r0/register` endpoint to comply with the spec. Please ensure your Application Services are up to date. Bugfixes -------- - Fix the log lines of nested logging contexts. Broke in 1.32.0rc1. ([\#9829](https://github.com/matrix-org/synapse/issues/9829)) Synapse 1.32.0rc1 (2021-04-13) ============================== Features -------- - Add a Synapse module for routing presence updates between users. ([\#9491](https://github.com/matrix-org/synapse/issues/9491)) - Add an admin API to manage ratelimit for a specific user. ([\#9648](https://github.com/matrix-org/synapse/issues/9648)) - Include request information in structured logging output. ([\#9654](https://github.com/matrix-org/synapse/issues/9654)) - Add `order_by` to the admin API `GET /_synapse/admin/v2/users`. Contributed by @dklimpel. ([\#9691](https://github.com/matrix-org/synapse/issues/9691)) - Replace the `room_invite_state_types` configuration setting with `room_prejoin_state`. ([\#9700](https://github.com/matrix-org/synapse/issues/9700)) - Add experimental support for [MSC3083](https://github.com/matrix-org/matrix-doc/pull/3083): restricting room access via group membership. ([\#9717](https://github.com/matrix-org/synapse/issues/9717), [\#9735](https://github.com/matrix-org/synapse/issues/9735)) - Update experimental support for Spaces: include `m.room.create` in the room state sent with room-invites. ([\#9710](https://github.com/matrix-org/synapse/issues/9710)) - Synapse now requires Python 3.6 or later. It also requires Postgres 9.6 or later or SQLite 3.22 or later. ([\#9766](https://github.com/matrix-org/synapse/issues/9766)) Bugfixes -------- - Prevent `synapse_forward_extremities` and `synapse_excess_extremity_events` Prometheus metrics from initially reporting zero-values after startup. ([\#8926](https://github.com/matrix-org/synapse/issues/8926)) - Fix recently added ratelimits to correctly honour the application service `rate_limited` flag. ([\#9711](https://github.com/matrix-org/synapse/issues/9711)) - Fix longstanding bug which caused `duplicate key value violates unique constraint "remote_media_cache_thumbnails_media_origin_media_id_thumbna_key"` errors. ([\#9725](https://github.com/matrix-org/synapse/issues/9725)) - Fix bug where sharded federation senders could get stuck repeatedly querying the DB in a loop, using lots of CPU. ([\#9770](https://github.com/matrix-org/synapse/issues/9770)) - Fix duplicate logging of exceptions thrown during federation transaction processing. ([\#9780](https://github.com/matrix-org/synapse/issues/9780)) Updates to the Docker image --------------------------- - Move opencontainers labels to the final Docker image such that users can inspect them. ([\#9765](https://github.com/matrix-org/synapse/issues/9765)) Improved Documentation ---------------------- - Make the `allowed_local_3pids` regex example in the sample config stricter. ([\#9719](https://github.com/matrix-org/synapse/issues/9719)) Deprecations and Removals ------------------------- - Remove old admin API `GET /_synapse/admin/v1/users/<user_id>`. ([\#9401](https://github.com/matrix-org/synapse/issues/9401)) - Make `/_matrix/client/r0/register` expect a type of `m.login.application_service` when an Application Service registers a user, to align with [the relevant spec](https://spec.matrix.org/unstable/application-service-api/#server-admin-style-permissions). ([\#9548](https://github.com/matrix-org/synapse/issues/9548)) Internal Changes ---------------- - Replace deprecated `imp` module with successor `importlib`. Contributed by Cristina Muñoz. ([\#9718](https://github.com/matrix-org/synapse/issues/9718)) - Experiment with GitHub Actions for CI. ([\#9661](https://github.com/matrix-org/synapse/issues/9661)) - Introduce flake8-bugbear to the test suite and fix some of its lint violations. ([\#9682](https://github.com/matrix-org/synapse/issues/9682)) - Update `scripts-dev/complement.sh` to use a local checkout of Complement, allow running a subset of tests and have it use Synapse's Complement test blacklist. ([\#9685](https://github.com/matrix-org/synapse/issues/9685)) - Improve Jaeger tracing for `to_device` messages. ([\#9686](https://github.com/matrix-org/synapse/issues/9686)) - Add release helper script for automating part of the Synapse release process. ([\#9713](https://github.com/matrix-org/synapse/issues/9713)) - Add type hints to expiring cache. ([\#9730](https://github.com/matrix-org/synapse/issues/9730)) - Convert various testcases to `HomeserverTestCase`. ([\#9736](https://github.com/matrix-org/synapse/issues/9736)) - Start linting mypy with `no_implicit_optional`. ([\#9742](https://github.com/matrix-org/synapse/issues/9742)) - Add missing type hints to federation handler and server. ([\#9743](https://github.com/matrix-org/synapse/issues/9743)) - Check that a `ConfigError` is raised, rather than simply `Exception`, when appropriate in homeserver config file generation tests. ([\#9753](https://github.com/matrix-org/synapse/issues/9753)) - Fix incompatibility with `tox` 2.5. ([\#9769](https://github.com/matrix-org/synapse/issues/9769)) - Enable Complement tests for [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946): Spaces Summary API. ([\#9771](https://github.com/matrix-org/synapse/issues/9771)) - Use mock from the standard library instead of a separate package. ([\#9772](https://github.com/matrix-org/synapse/issues/9772)) - Update Black configuration to target Python 3.6. ([\#9781](https://github.com/matrix-org/synapse/issues/9781)) - Add option to skip unit tests when building Debian packages. ([\#9793](https://github.com/matrix-org/synapse/issues/9793))
| * Require AppserviceRegistrationType (#9548)Will Hunt2021-04-121-7/+16
| | | | | | This change ensures that the appservice registration behaviour follows the spec. We decided to do this for Dendrite, so it made sense to also make a PR for synapse to correct the behaviour.
| * Make RateLimiter class check for ratelimit overrides (#9711)Erik Johnston2021-03-301-3/+5
| | | | | | | | | | | | | | This should fix a class of bug where we forget to check if e.g. the appservice shouldn't be ratelimited. We also check the `ratelimit_override` table to check if the user has ratelimiting disabled. That table is really only meant to override the event sender ratelimiting, so we don't use any values from it (as they might not make sense for different rate limits), but we do infer that if ratelimiting is disabled for the user we should disabled all ratelimits. Fixes #9663
* | Merge commit 'd2f0ec12d' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-231-2/+7
|\|
| * Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-2/+7
| | | | | | | | | | | | | | - 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
* | Merge commit '3f58fc848' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+2
|\|
| * Type hints and validation improvements. (#9321)Patrick Cloke2021-02-081-0/+2
| | | | | | | | | | * Adds type hints to the groups servlet and stringutils code. * Assert the maximum length of some input values for spec compliance.
* | Merge commit 'e19396d62' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-0/+6
|\|
| * Ratelimit 3PID /requestToken API (#9238)Erik Johnston2021-01-281-0/+6
| |
* | Merge commit '98a64b7f7' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-221-9/+10
|\|
| * UI Auth via SSO: redirect the user to an appropriate SSO. (#9081)Richard van der Hoff2021-01-121-4/+9
| | | | | | | | | | | | | | If we have integrations with multiple identity providers, when the user does a UI Auth, we need to redirect them to the right one. There are a few steps to this. First of all we actually need to store the userid of the user we are trying to validate in the UIA session, since the /auth/sso/fallback/web request is unauthenticated. Then, once we get the /auth/sso/fallback/web request, we can fish the user id out of the session, and use it to look up the external id mappings, and hence pick an SSO provider for them.
| * Kill off `HomeServer.get_ip_from_request()` (#9080)Richard van der Hoff2021-01-121-6/+2
| | | | | | Homeserver.get_ip_from_request() used to be a bit more complicated, but now it is totally redundant. Let's get rid of it.
* | Merge commit 'a7a913918' into anoa/dinsic_release_1_31_0Andrew Morgan2021-04-201-3/+11
|\|
| * Merge remote-tracking branch 'origin/erikj/as_mau_block' into developErik Johnston2020-12-181-3/+11
| |\
| | * Correctly handle AS registerations and add testErik Johnston2020-12-171-3/+11
| | |
* | | Merge commit 'cf7d3c90d' into dinsicAndrew Morgan2021-04-161-1/+1
|\| |
| * | Fix errorcode for disabled registration (#8867)Richard van der Hoff2020-12-031-1/+1
| |/ | | | | | | The spec says we should return `M_FORBIDDEN` when someone tries to register and registration is disabled.
* | Remove extraneous print (#94)Andrew Morgan2021-03-191-1/+0
| |
* | Merge commit '09ac0569f' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-2/+2
|\|
| * Simplify the way the `HomeServer` object caches its internal attributes. ↵Jonathan de Jong2020-11-301-2/+2
| | | | | | | | | | (#8565) Changes `@cache_in_self` to use underscore-prefixed attributes.
* | Merged commit 'deff8f628' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-0/+1
| |
* | Merge commit '4a54b821b' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-0/+9
|\|
| * Add metrics for tracking 3PID /requestToken requests. (#8712)Erik Johnston2020-11-131-0/+9
| | | | | | | | | | | | The main use case is to see how many requests are being made, and how many are second/third/etc attempts. If there are large number of retries then that likely indicates a delivery problem.
* | Merge commit '054a6b953' into anoa/dinsic_release_1_23_1Andrew Morgan2020-12-311-4/+0
|\|
| * Remove unused OPTIONS handlers. (#8621)Patrick Cloke2020-10-221-3/+0
| | | | | | | | The handling of OPTIONS requests was consolidated in #7534, but the endpoint specific handlers were not removed.
* | Merge commit '74976a8e4' into dinsicAndrew Morgan2020-12-311-3/+3
|\|
| * Remove the deprecated Handlers object (#8494)Patrick Cloke2020-10-091-3/+3
| | | | | | All handlers now available via get_*_handler() methods on the HomeServer.
* | Merge commit '4325be1a5' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-211-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '4325be1a5': Fix missing null character check on guest_access room state Fixed a bug with reactivating users with the admin API (#8362) Admin API for reported events (#8217) Fix wording of deprecation notice in changelog Deprecation warning for synapse admin api being accessible under /_matrix Create function to check for long names in devices (#8364) Add a comment re #1691 Fix a bad merge from release-v1.20.0. (#8354) Admin API for querying rooms where a user is a member (#8306) Catch-up after Federation Outage (bonus): Catch-up on Synapse Startup (#8322) Simplify super() calls to Python 3 syntax. (#8344) Allow appservice users to /login (#8320) Update test logging to be able to accept braces (#8335) Move lint dependencies to extras_require (#8330)
| * Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-5/+5
| | | | | | | | | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* | Merge commit '837293c31' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-5/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '837293c31': Remove obsolete __future__ imports (#8337) Use admin_patterns for all admin APIs. (#8331) Fix a potential bug of UnboundLocalError (#8329) Switch metaclass initialization to python 3-compatible syntax (#8326) Catch-up after Federation Outage (split, 4): catch-up loop (#8272) Use slots in attrs classes where possible (#8296) Fix typos in comments. Add the topic and avatar to the room details admin API (#8305) Improve SAML error messages (#8248) Add experimental support for sharding event persister. Again. (#8294) Make `StreamToken.room_key` be a `RoomStreamToken` instance. (#8281) Use TLSv1.2 for fake servers in tests (#8208) Add /_synapse/client to the reverse proxy docs (#8227) Clean up `Notifier.on_new_room_event` code path (#8288)
| * Fix a potential bug of UnboundLocalError (#8329)Jonathan de Jong2020-09-171-5/+8
| | | | | | Replaced with less buggier control flow
* | Merge commit '17fa4c7ca' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-1/+1
|\| | | | | | | | | | | | | | | * commit '17fa4c7ca': Catch up after Federation Outage (split, 2): Track last successful stream ordering after transmission (#8247) Catch-up after Federation Outage (split, 1) (#8230) Fix type signature in simple_select_one_onecol and friends (#8241) Stop sub-classing object (#8249)
| * Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
| |
* | Merge commit '56efa9ec7' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-201-0/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '56efa9ec7': (22 commits) Fix rate limiting unit tests. (#8167) Add functions to `MultiWriterIdGen` used by events stream (#8164) Do not allow send_nonmember_event to be called with shadow-banned users. (#8158) Changelog fixes Make StreamIdGen `get_next` and `get_next_mult` async (#8161) Wording fixes to 'name' user admin api filter (#8163) Fix missing double-backtick in RST document Search in columns 'name' and 'displayname' in the admin users endpoint (#7377) Add type hints for state. (#8140) Stop shadow-banned users from sending non-member events. (#8142) Allow capping a room's retention policy (#8104) Add healthcheck for default localhost 8008 port on /health endpoint. (#8147) Fix flaky shadow-ban tests. (#8152) Don't fail /submit_token requests on incorrect session ID if request_token_inhibit_3pid_errors is turned on (#7991) Do not apply ratelimiting on joins to appservices (#8139) Micro-optimisations to get_auth_chain_ids (#8132) Allow denying or shadow banning registrations via the spam checker (#8034) Stop shadow-banned users from sending invites. (#8095) Be more tolerant of membership events in unknown rooms (#8110) Improve the error code when trying to register using a name reserved for guests. (#8135) ...
| * Don't fail /submit_token requests on incorrect session ID if ↵Brendan Abolivier2020-08-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | request_token_inhibit_3pid_errors is turned on (#7991) * Don't raise session_id errors on submit_token if request_token_inhibit_3pid_errors is set * Changelog * Also wait some time before responding to /requestToken * Incorporate review * Update synapse/storage/databases/main/registration.py Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Incorporate review Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
| * Allow denying or shadow banning registrations via the spam checker (#8034)Patrick Cloke2020-08-201-0/+5
| |
* | Merge commit 'e04e465b4' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-25/+6
|\| | | | | | | | | | | | | | | | | | | * commit 'e04e465b4': Use the default templates when a custom template file cannot be found (#8037) Changelog changes Convert stream database to async/await. (#8074) Add a shadow-banned flag to users. (#8092) Convert pusher databases to async/await. (#8075) Convert receipts and events databases to async/await. (#8076)
| * Use the default templates when a custom template file cannot be found (#8037)Andrew Morgan2020-08-171-25/+6
| | | | | | Fixes https://github.com/matrix-org/synapse/issues/6583
* | Merge commit '4e874ed59' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-1/+1
|\| | | | | | | | | * commit '4e874ed59': Remove unnecessary maybeDeferred calls (#8044)
| * Remove unnecessary maybeDeferred calls (#8044)Patrick Cloke2020-08-071-1/+1
| |
* | Merge commit 'd4a7829b1' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-1/+1
|\| | | | | | | | | * commit 'd4a7829b1': Convert synapse.api to async/await (#8031)
| * Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-061-1/+1
| |
* | Merge commit '66f24449d' into anoa/dinsic_release_1_21_xAndrew Morgan2020-10-191-39/+71
|\| | | | | | | | | * commit '66f24449d': Improve performance of the register endpoint (#8009)
| * Improve performance of the register endpoint (#8009)Patrick Cloke2020-08-061-39/+69
| |
* | Merge commit '5cdca53aa' into dinsicAndrew Morgan2020-08-031-3/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '5cdca53aa': Merge different Resource implementation classes (#7732) Fix inconsistent handling of upper and lower cases of email addresses. (#7021) Allow YAML config file to contain None (#7779) Fix a typo. Move 1.15.2 after 1.16.0rc2. 1.16.0rc2 Remove an extraneous space. Add links to the fixes. Fix tense in the release notes. Hack to add push priority to push notifications (#7765) Add early returns to `_check_for_soft_fail` (#7769) Use symbolic names for replication stream names (#7768) Type checking for `FederationHandler` (#7770) Fix new metric where we used ms instead of seconds (#7771) Fix incorrect error message when database CTYPE was set incorrectly. (#7760) Pin link in CHANGES.md Fixes to CHANGES.md
| * Fix inconsistent handling of upper and lower cases of email addresses. (#7021)Dirk Klimpel2020-07-031-3/+19
| | | | | | fixes #7016
| * Merge branch 'master' into developPatrick Cloke2020-07-021-6/+4
| |\
* | \ Merge commit 'e8c36e527' into dinsicAndrew Morgan2020-08-031-6/+4
|\ \ \ | | |/ | |/| | | | | | | | | | | | | * commit 'e8c36e527': 1.15.2 Correctly handle outliers as prev events over federation Ensure that HTML pages served from Synapse include headers to avoid embedding.
| * | Ensure that HTML pages served from Synapse include headers to avoid embedding.Patrick Cloke2020-07-021-6/+4
| | |
* | | Merge commit 'a3f11567d' into dinsicAndrew Morgan2020-08-031-4/+2
|\ \ \ | | |/ | |/| | | | | | | * commit 'a3f11567d': Replace all remaining six usage with native Python 3 equivalents (#7704)
| * | Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-8/+3
| |/
* | Merge branch 'release-v1.15.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-241-15/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.15.x * 'release-v1.15.0' of github.com:matrix-org/synapse: (55 commits) 1.15.0 Fix some attributions Update CHANGES.md 1.15.0rc1 Revert "1.15.0rc1" 1.15.0rc1 Fix bug in account data replication stream. (#7656) Convert the registration handler to async/await. (#7649) Accept device information at the login fallback endpoint. (#7629) Convert user directory handler and related classes to async/await. (#7640) Add an option to disable autojoin for guest accounts (#6637) Clarifications to the admin api documentation (#7647) Update to the stable SSO prefix for UI Auth. (#7630) Fix type information on `assert_*_is_admin` methods (#7645) Remove some unused constants. (#7644) Typo fixes. Allow new users to be registered via the admin API even if the monthly active user limit has been reached (#7263) Add device management to admin API (#7481) Attempt to fix PhoneHomeStatsTestCase.test_performance_100 being flaky. (#7634) Support CS API v0.6.0 (#6585) ...
| * Performance improvements and refactor of Ratelimiter (#7595)Andrew Morgan2020-06-051-15/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Prevent M_USER_IN_USE from being raised by registration methods until after ↵Andrew Morgan2020-06-221-33/+12
| | | | | | | | | | | | email has been verified (#48) * Just ignore the `username` parameter on registration as it's not used by DINUM * Have `/register/available` always return `true`
* | Merge branch 'release-v1.14.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-101-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.14.x * 'release-v1.14.0' of github.com:matrix-org/synapse: (108 commits) Fix typo in PR link Update debian changelog 1.14.0 Improve changelog wording 1.14.0rc2 Fix sample config docs error (#7581) Fix up comments Fix specifying cache factors via env vars with * in name. (#7580) Don't apply cache factor to event cache. (#7578) Ensure ReplicationStreamer is always started when replication enabled. (#7579) Remove the changes to the debian changelog Not full release yet, this is rc1 Merge event persistence move changelog entries More changelog fix Changelog fixes 1.14.0 Replace device_27_unique_idx bg update with a fg one (#7562) Fix incorrect exception handling in KeyUploadServlet.on_POST (#7563) Fix recording of federation stream token (#7564) Simplify reap_monthly_active_users (#7558) ...
| * Hash passwords earlier in the password reset process (#7538)Patrick Cloke2020-05-201-2/+2
| | | | | | | | This now matches the logic of the registration process as modified in 56db0b1365965c02ff539193e26c333b7f70d101 / #7523.
* | Merge branch 'release-v1.13.0' of github.com:matrix-org/synapse into ↵Andrew Morgan2020-06-101-20/+36
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dinsic-release-v1.14.x * 'release-v1.13.0' of github.com:matrix-org/synapse: (257 commits) Update changelog based on feedback. Move warnings in the changelog and re-iterate changes to branches. 1.13.0 update dh-virtualenv (#7526) 1.13.0rc3 Hash passwords earlier in the registration process (#7523) 1.13.0rc2 1.13.0rc2 Stop `get_joined_users` corruption from custom statuses (#7376) Do not validate that the client dict is stable during UI Auth. (#7483) Fix new flake8 errors (#7489) Don't UPGRADE database rows RST indenting Put rollback instructions in upgrade notes Fix changelog typo Oh yeah, RST Absolute URL it is then Fix upgrade notes link Provide summary of upgrade issues in changelog. Fix ) Move next version notes from changelog to upgrade notes ...
| * Hash passwords earlier in the registration process (#7523)Patrick Cloke2020-05-181-9/+13
| |
| * Do not validate that the client dict is stable during UI Auth. (#7483)Patrick Cloke2020-05-131-1/+0
| | | | | | | | 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-0/+1
| | | | | | | | 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-2/+2
| | | | | | | | | | 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-231-1/+11
| | | | | | | | | | | | matrix-org/babolivier/request_token"" This reverts commit 1adf6a55870aa08de272591ff49db9dc49738076.
| * Support SAML in the user interactive authentication workflow. (#7102)Patrick Cloke2020-04-011-0/+1
| |
| * Allow server admins to define and enforce a password policy (MSC2000). (#7118)Dirk Klimpel2020-03-261-0/+2
| |
| * Validate that the session is not modified during UI-Auth (#7068)Patrick Cloke2020-03-261-1/+4
| |
* | Simplify auto-bind email to IS hackAndrew Morgan2020-04-241-11/+0
| |
* | Remove bind_email param from dinsic-specific codeAndrew Morgan2020-04-241-2/+2
| |
* | HACK: Bind email to identity server when using it for 3pid delegationAndrew Morgan2020-04-241-0/+11
| |
* | Fix some broken referencesAndrew Morgan2020-04-241-2/+2
| |
* | Fix incorrect call to _map_email_to_display_nameAndrew Morgan2020-04-241-1/+1
| |
* | Validate client_secret parameter (#6767)Andrew Morgan2020-03-231-0/+2
|\| | | | | | | | | * commit '9f7aaf90b': Validate client_secret parameter (#6767)
| * Validate client_secret parameter (#6767)Andrew Morgan2020-01-241-0/+3
| |
* | Fixup synapse.rest to pass mypy (#6732)Andrew Morgan2020-03-231-1/+2
|\| | | | | | | | | * commit 'b0a66ab83': Fixup synapse.rest to pass mypy (#6732)
| * Fixup synapse.rest to pass mypy (#6732)Erik Johnston2020-01-201-1/+2
| |
* | Merge pull request #6483 from matrix-org/erikj/port_rest_v2Andrew Morgan2020-03-191-51/+40
|\| | | | | | | | | | | * commit 'd085a8a0a': Newsfile Port rest.client.v2
| * Port rest.client.v2Erik Johnston2019-12-051-41/+31
| |
* | Update black to 19.10b0 (#6304)Andrew Morgan2020-03-161-2/+2
|\| | | | | | | | | * commit '020add509': Update black to 19.10b0 (#6304)
| * Update black to 19.10b0 (#6304)Amber Brown2019-11-011-2/+2
| | | | | | * update version of black and also fix the mypy config being overridden
* | Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2020-03-161-5/+5
|\|
| * Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2019-10-311-5/+5
| | | | | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
* | Stop advertising unsupported flows for registration (#6107)Andrew Morgan2020-02-251-3/+29
|\|
| * Stop advertising unsupported flows for registration (#6107)Richard van der Hoff2019-09-251-3/+29
| | | | | | | | | | | | | | If email or msisdn verification aren't supported, let's stop advertising them for registration. Fixes #6100.
* | Refactor code for calculating registration flows (#6106)Andrew Morgan2020-02-251-62/+62
|\|
| * Refactor code for calculating registration flows (#6106)Richard van der Hoff2019-09-251-62/+62
| | | | | | | | | | | | | | | | | | 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.
* | Implement MSC2290 (#6043)Andrew Morgan2020-02-251-0/+6
|\|
| * Implement MSC2290 (#6043)Andrew Morgan2019-09-231-0/+6
| | | | | | | | | | | | | | Implements MSC2290. This PR adds two new endpoints, /unstable/account/3pid/add and /unstable/account/3pid/bind. Depending on the progress of that MSC the unstable prefix may go away. This PR also removes the blacklist on some 3PID tests which occurs in #6042, as the corresponding Sytest PR changes them to use the new endpoints. Finally, it also modifies the account deactivation code such that it doesn't just try to deactivate 3PIDs that were bound to the user's account, but any 3PIDs that were bound through the homeserver on that user's account.
* | Disable /register/available if registration is disabled (#6082)Andrew Morgan2020-02-251-0/+5
|\|
| * Disable /register/available if registration is disabled (#6082)Andrew Morgan2019-09-231-0/+5
| | | | | | | | | | | | | | | | | | Fixes #6066 This register endpoint should be disabled if registration is disabled, otherwise we're giving anyone the ability to check if a username exists on a server when we don't need to be. Error code is 403 (Forbidden) as that's the same returned by /register when registration is disabled.
* | Allow HS to send emails when adding an email to the HS (#6042)Andrew Morgan2020-02-251-15/+9
|\|
| * Allow HS to send emails when adding an email to the HS (#6042)Andrew Morgan2019-09-201-15/+9
| |
* | Merge pull request #5994 from matrix-org/anoa/html_template_fixAndrew Morgan2020-02-251-1/+1
|\|
| * Apply suggestions from code reviewAndrew Morgan2019-09-061-1/+1
| | | | | | Co-Authored-By: Erik Johnston <erik@matrix.org>
| * Fix destructuring assumption bugAndrew Morgan2019-09-061-1/+1
| |
* | Allow Synapse to send registration emails + choose Synapse or an external ↵Andrew Morgan2020-02-251-16/+180
|\| | | | | | | server to handle 3pid validation (#5987)
| * Allow Synapse to send registration emails + choose Synapse or an external ↵Andrew Morgan2019-09-061-15/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | server to handle 3pid validation (#5987) This is a combination of a few different PRs, finally all being merged into `develop`: * #5875 * #5876 * #5868 (This one added the `/versions` flag but the flag itself was actually [backed out](https://github.com/matrix-org/synapse/commit/891afb57cbdf9867f2848341b29c75d6f35eef5a#diff-e591d42d30690ffb79f63bb726200891) in #5969. What's left is just giving /versions access to the config file, which could be useful in the future) * #5835 * #5969 * #5940 Clients should not actually use the new registration functionality until https://github.com/matrix-org/synapse/pull/5972 is merged. UPGRADE.rst, changelog entries and config file changes should all be reviewed closely before this PR is merged.
* | Remove bind_email and bind_msisdn (#5964)Andrew Morgan2020-02-251-2/+0
|\|
| * Remove bind_email and bind_msisdn (#5964)Andrew Morgan2019-09-041-2/+0
| | | | | | Removes the `bind_email` and `bind_msisdn` parameters from the `/register` C/S API endpoint as per [MSC2140: Terms of Service for ISes and IMs](https://github.com/matrix-org/matrix-doc/pull/2140/files#diff-c03a26de5ac40fb532de19cb7fc2aaf7R107).
* | Remove double return statements (#5962)Andrew Morgan2020-02-251-2/+0
|\|
| * Remove double return statements (#5962)Andrew Morgan2019-09-031-2/+0
| | | | | | | | | | | | | | | | | | | | Remove all the "double return" statements which were a result of us removing all the instances of ``` defer.returnValue(...) return ``` statements when we switched to python3 fully.
* | Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2020-02-241-5/+5
|\|
| * Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-5/+5
| | | | | | | | | | 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 :)
* | Merge pull request #5877 from ↵Andrew Morgan2020-02-211-51/+4
|\| | | | | | | Awesome-Technologies/remove_shared_secret_registration
| * Remove shared secret registration from client/r0/register endpointManuel Stahl2019-08-221-53/+4
| | | | | | | | | | | | | | | | | | | | This type of registration was probably never used. It only includes the user name in the HMAC but not the password. Shared secret registration is still available via client/r0/admin/register. Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* | Replace returnValue with return (#5736)Andrew Morgan2020-02-191-20/+18
|\|
| * Replace returnValue with return (#5736)Amber Brown2019-07-231-20/+18
| |
* | Remove access-token support from RegistrationHandler.register (#5641)Andrew Morgan2020-02-171-6/+5
|\|
| * Remove access-token support from RegistrationHandler.register (#5641)Richard van der Hoff2019-07-081-6/+5
| | | | | | | | | | | | | | | | Nothing uses this now, so we can remove the dead code, and clean up the API. Since we're changing the shape of the return value anyway, we take the opportunity to give the method a better name.
| * Run Black. (#5482)Amber Brown2019-06-201-69/+63
| |
* | Dinsic Blacking with black==18.6b2Andrew Morgan2020-02-111-95/+86
| |
* | Validate client_secret parameter according to spec (#20)Andrew Morgan2020-01-221-0/+5
| |
* | Capatilise letters after a - in new user displaynames (#14)Andrew Morgan2019-12-021-16/+58
| |
* | Merge branch 'master' into dinsicBrendan Abolivier2019-06-121-5/+5
|\|
| * Unify v1 and v2 REST client APIs (#5226)Amber Brown2019-06-031-5/+5
| |
* | Merge branch 'master' into dinsicBrendan Abolivier2019-06-111-5/+17
|\|
| * Merge pull request #5174 from matrix-org/dbkr/add_dummy_flow_to_recaptcha_onlyDavid Baker2019-05-161-5/+17
| |\ | | | | | | Re-order registration stages to do msisdn & email auth last
| | * Re-order flows so that email auth is done lastDavid Baker2019-05-101-4/+12
| | | | | | | | | | | | | | | | | | It's more natural for the user if the bit that takes them away from the registration flow comes last. Adding the dummy stage allows us to do the stages in this order without the ambiguity.
| | * CommentDavid Baker2019-05-101-0/+4
| | |
| | * Add a DUMMY stage to captcha-only registration flowDavid Baker2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the client to complete the email last which is more natual for the user. Without this stage, if the client would complete the recaptcha (and terms, if enabled) stages and then the registration request would complete because you've now completed a flow, even if you were intending to complete the flow that's the same except has email auth at the end. Adding a dummy auth stage to the recaptcha-only flow means it's always unambiguous which flow the client was trying to complete. Longer term we should think about changing the protocol so the client explicitly says which flow it's trying to complete. vector-im/riot-web#9586
* | | Merge pull request #5214 from matrix-org/babolivier/password-policyBrendan Abolivier2019-05-221-2/+5
|\ \ \ | | | | | | | | Allow server admins to define and enforce a password policy (MSC2000)
| * | | First implementation of MSC2000Brendan Abolivier2019-05-201-2/+5
| |/ /
* | | Merge branch 'babolivier/per_room_profiles' into dinsic dinsic_2019-05-17Brendan Abolivier2019-05-171-17/+35
|\| |
| * | Merge pull request #5187 from ↵David Baker2019-05-161-18/+22
| |\ \ | | | | | | | | | | | | | | | | matrix-org/dbkr/only_check_threepid_not_in_use_if_actually_registering Only check 3pids not in use when registering
| | * | Only check 3pids not in use when registeringDavid Baker2019-05-141-18/+22
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | We checked that 3pids were not already in use before we checked if we were going to return the account previously registered in the same UI auth session, in which case the 3pids will definitely be in use. https://github.com/vector-im/riot-web/issues/9586
| * / Make all the rate limiting options more consistent (#5181)Amber Brown2019-05-151-10/+13
| |/
* | Merge branch 'release-v0.99.4' into dinsic dinsic_2019-05-14Brendan Abolivier2019-05-141-0/+18
|\|
| * Revert 085ae346ace418e0fc043ac5f568f85ebf80038eDavid Baker2019-05-101-1/+1
| | | | | | | | Accidentally went straight to develop
| * Add a DUMMY stage to captcha-only registration flowDavid Baker2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the client to complete the email last which is more natual for the user. Without this stage, if the client would complete the recaptcha (and terms, if enabled) stages and then the registration request would complete because you've now completed a flow, even if you were intending to complete the flow that's the same except has email auth at the end. Adding a dummy auth stage to the recaptcha-only flow means it's always unambiguous which flow the client was trying to complete. Longer term we should think about changing the protocol so the client explicitly says which flow it's trying to complete. https://github.com/vector-im/riot-web/issues/9586
| * Make sure we're not registering the same 3pid twiceBrendan Abolivier2019-04-171-0/+18
| |
* | Fix registration with register_mxid_from_3pid enabled (#5011) dinsic_2019-04-04_1Erik Johnston2019-04-041-1/+1
| |
* | Add config option to use email as display name for new usersErik Johnston2019-04-031-14/+17
| |
* | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/dinsic-mergedErik Johnston2019-03-211-4/+29
|\|
| * Add ratelimiting on login (#4821)Brendan Abolivier2019-03-151-2/+2
| | | | | | Add two ratelimiters on login (per-IP address and per-userID).
| * Make registration ratelimiter separate from the main events oneBrendan Abolivier2019-03-061-1/+1
| |
| * Revert "Split ratelimiters in two (one for events, one for registration)"Brendan Abolivier2019-03-061-1/+1
| | | | | | | | This reverts commit d7dbad3526136cfc9fdbd568635be5016fb637db.
| * Split ratelimiters in two (one for events, one for registration)Brendan Abolivier2019-03-051-1/+1
| |
| * Add rate-limiting on registration (#4735)Brendan Abolivier2019-03-051-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Merge branch 'master' of github.com:matrix-org/synapse into ↵Erik Johnston2019-03-151-172/+41
|\| | | | | | | erikj/dinsic-merged-master
| * Fix registration on workers (#4682)Erik Johnston2019-02-201-134/+11
| | | | | | | | | | | | | | | | | | | | * Move RegistrationHandler init to HomeServer * Move post registration actions to RegistrationHandler * Add post regisration replication endpoint * Newsfile
| * Move register_device into handlerErik Johnston2019-02-181-47/+2
| |
| * Update docsErik Johnston2019-02-181-1/+1
| |
| * Split out registration to workerErik Johnston2019-02-181-27/+46
| | | | | | | | | | | | | | | | This allows registration to be handled by a worker, though the actual write to the database still happens on master. Note: due to the in-memory session map all registration requests must be handled by the same worker.
| * move guard out of is_threepid_reserved and into register.pyNeil Johnson2019-01-221-4/+5
| |
| * Fix None guard in config.server.is_threepid_reservedNeil Johnson2019-01-221-1/+3
| |
| * Config option to disable requesting MSISDN on registrationNeil Johnson2019-01-211-11/+5
| |
| * Neilj/fix autojoin (#4223)Neil Johnson2018-11-281-0/+1
| | | | | | | | | | | | * Fix auto join failures for servers that require user consent * Fix auto join failures for servers that require user consent
| * Add config variables for enabling terms auth and the policy name (#4142)Travis Ralston2018-11-061-1/+1
| | | | | | | | So people can still collect consent the old way if they want to.
| * pep8Travis Ralston2018-10-151-10/+2
| |
| * Auto-consent to the privacy policy if the user registered with termsTravis Ralston2018-10-031-0/+6
| |
| * Make the terms flow requriedTravis Ralston2018-10-031-4/+4
| |
| * Incorporate Dave's work for GDPR login flowsTravis Ralston2018-10-031-0/+15
| | | | | | As per https://github.com/vector-im/riot-web/issues/7168#issuecomment-419996117
* | Use internal-info for identity server. Block reg on fields dinsic_2019-02-19-beta11Andrew Morgan2019-02-191-1/+1
| |
* | Synchronise account metadata onto another server. (#4145) dinsic_2019-01-11Matthew Hodgson2019-01-111-7/+37
| | | | | | | | | | * implement shadow registration via AS (untested) * shadow support for 3pid binding/unbinding (untested)
* | merge master into dinsic, again...Matthew Hodgson2018-11-031-3/+19
|\|
| * improve human readable error messageNeil Johnson2018-09-041-1/+2
| |
| * improve human readable error messagesNeil Johnson2018-09-041-3/+8
| |
| * move threepid checker to config, add missing yieldsNeil Johnson2018-08-311-2/+3
| |
| * ensure post registration auth checks do not fail erroneouslyNeil Johnson2018-08-311-0/+4
| |
| * fix bug where preserved threepid user comes to sign up and server is mau blockedNeil Johnson2018-08-311-0/+5
| |
* | merge in masterMatthew Hodgson2018-10-221-6/+6
|\|
| * Python 3: Convert some unicode/bytes uses (#3569)Amber Brown2018-08-021-6/+6
| |
* | fix missing import and run isort dinsic_2018-07-20Matthew Hodgson2018-07-201-1/+2
| |
* | Merge remote-tracking branch 'origin/master' into dinsicDavid Baker2018-07-191-28/+29
|\|
| * Refactor REST API tests to use explicit reactors (#3351)Amber Brown2018-07-171-1/+1
| |
| * Merge pull request #3534 from krombel/use_parse_and_asserts_from_servletAmber Brown2018-07-141-11/+12
| |\ | | | | | | Use parse and asserts from http.servlet
| | * rename assert_params_in_request to assert_params_in_dictKrombel2018-07-131-5/+5
| | | | | | | | | | | | | | | | | | the method "assert_params_in_request" does handle dicts and not requests. A request body has to be parsed to json before this method can be used
| | * Use parse_{int,str} and assert from http.servletKrombel2018-07-131-8/+9
| | | | | | | | | | | | | | | | | | | | | parse_integer and parse_string can take a request and raise errors in case we have wrong or missing params. This PR tries to use them more to deduplicate some code and make it better readable
| * | Make auth & transactions more testable (#3499)Amber Brown2018-07-141-3/+2
| |/
| * run isortAmber Brown2018-07-091-10/+12
| |
* | Merge remote-tracking branch 'origin/master' into dinsicDavid Baker2018-07-171-3/+0
|\|
| * Remove run_on_reactor (#3395)Amber Brown2018-06-141-3/+0
| |
* | improve domain matchesMatthew Hodgson2018-07-101-2/+2
| |
* | fix bounds errorMatthew Hodgson2018-07-101-1/+1
| |
* | tweak dinsic display namesMatthew Hodgson2018-07-101-2/+10
| |
* | Merge tag 'v0.31.2' into dinsicMichael Kaye2018-06-221-4/+6
|\|
| * Construct HMAC as bytes on py3Adrian Tschira2018-04-291-4/+6
| | | | | | | | Signed-off-by: Adrian Tschira <nota@notafile.com>
* | fix user in user regexpMatthew Hodgson2018-05-041-1/+1
| |
* | fix strip_invalid_mxid_charactersMatrix2018-05-031-2/+2
| |
* | special case msisdns when deriving mxids from 3pidsMatthew Hodgson2018-05-031-7/+11
| |
* | improve mxid & displayname selection for register_mxid_from_3pidMatthew Hodgson2018-05-031-5/+45
| | | | | | | | | | | | | | | | * [x] strip invalid characters from generated mxid * [x] append numbers to disambiguate clashing mxids * [x] generate displayanames from 3pids using a dodgy heuristic * [x] get rid of the create_profile_with_localpart and instead explicitly set displaynames so they propagate correctly
* | Merge branch 'dinsic' into matthew/derive-mxid-from-3pidMatthew Hodgson2018-05-031-3/+3
|\ \
| * | Merge branch 'develop' into dinsicMatthew Hodgson2018-04-121-32/+0
| |\|
| * | Merge branch 'develop' into matthew/dinsic_3pid_checkMatthew Hodgson2018-03-141-1/+1
| |\ \
| * | | add yieldsMatthew Hodgson2018-03-131-3/+3
| | | |
| * | | fix thinko on 3pid whitelistingMatthew Hodgson2018-01-241-2/+2
| | | |
* | | | turn @'s to -'s rather than .'sMatthew Hodgson2018-04-171-1/+1
| | | |
* | | | handle medium checks correctlyMatthew Hodgson2018-04-121-3/+12
| | | |
* | | | add the register_mxid_from_3pid setting (untested)Matthew Hodgson2018-04-121-8/+28
| |_|/ |/| |
* | | move handling of auto_join_rooms to RegisterHandlerKrombel2018-03-141-32/+0
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | 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>
* | Move RoomMemberHandler out of HandlersErik Johnston2018-03-011-1/+1
| |
* | fix thinko on 3pid whitelistingMatthew Hodgson2018-01-241-2/+2
|/
* fix typo (thanks sytest)Matthew Hodgson2018-01-191-1/+1
|
* oops, check all login typesMatthew Hodgson2018-01-191-14/+11
|
* trailing commasMatthew Hodgson2018-01-191-3/+3
|
* rewrite based on PR feedback:Matthew Hodgson2018-01-191-41/+34
| | | | | | | | | * [ ] split config options into allowed_local_3pids and registrations_require_3pid * [ ] simplify and comment logic for picking registration flows * [ ] fix docstring and move check_3pid_allowed into a new util module * [ ] use check_3pid_allowed everywhere @erikjohnston PTAL
* fix up v1, and improve errorsMatthew Hodgson2018-01-191-4/+12
|
* add registrations_require_3pidMatthew Hodgson2018-01-191-12/+61
| | | | | lets homeservers specify a whitelist for 3PIDs that users are allowed to associate with. Typically useful for stopping people from registering with non-work emails
* Refactor UI auth implementationRichard van der Hoff2017-12-051-6/+3
| | | | | Instead of returning False when auth is incomplete, throw an exception which can be caught with a wrapper.
* Add some more comments appservice user registrationRichard van der Hoff2017-11-101-1/+4
| | | | Explain why we don't validate userids registered via app services
* Downcase userids for shared-secret registrationRichard van der Hoff2017-11-101-2/+20
|
* Downcase userid on registrationRichard van der Hoff2017-11-091-1/+7
| | | | | | Force username to lowercase before attempting to register https://github.com/matrix-org/synapse/issues/2660
* support inhibit_login in /registerRichard van der Hoff2017-11-021-12/+16
| | | | Allow things to pass inhibit_login when registering to ... inhibit logins.
* Break dependency of auth_handler on device_handlerRichard van der Hoff2017-11-011-1/+0
| | | | | | | | | I'm going to need to make the device_handler depend on the auth_handler, so I need to break this dependency to avoid a cycle. It turns out that the auth_handler was only using the device_handler in one place which was an edge case which we can more elegantly handle by throwing an error rather than fixing it up.
* Add config option to auto-join new users to roomsDavid Baker2017-10-161-0/+34
| | | | | New users who register on the server will be dumped into all rooms in auto_join_rooms in the config.
* Modify register/available to be GET with query paramLuke Barnard2017-05-101-5/+4
| | | | | | | - GET is now the method for register/available - a query parameter "username" is now used Also, empty usernames are now handled with an error message on registration or via register/available: `User ID cannot be empty`
* Change register/available to POST (from GET)Luke Barnard2017-05-101-1/+1
|
* Appease the flake8 godsLuke Barnard2017-05-031-5/+10
|
* Implement username availability checkerLuke Barnard2017-05-031-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Outlined here: https://github.com/vector-im/riot-web/issues/3605#issuecomment-298679388 ```HTTP GET /_matrix/.../register/available { "username": "desiredlocalpart123" } ``` If available, the response looks like ```HTTP HTTP/1.1 200 OK { "available": true } ``` Otherwise, ```HTTP HTTP/1.1 429 { "errcode": "M_LIMIT_EXCEEDED", "error": "Too Many Requests", "retry_after_ms": 2000 } ``` or ```HTTP HTTP/1.1 400 { "errcode": "M_USER_IN_USE", "error": "User ID already taken." } ``` or ```HTTP HTTP/1.1 400 { "errcode": "M_INVALID_USERNAME", "error": "Some reason for username being invalid" } ```
* Add another missing yield on check_device_registeredRichard van der Hoff2017-03-231-1/+1
|
* Use extend instead of +=David Baker2017-03-141-4/+4
|
* Oops, remove printDavid Baker2017-03-141-1/+0
|
* Fix registration for broken clientsDavid Baker2017-03-131-4/+22
| | | | Only offer msisdn flows if the x_show_msisdn option is given.
* Support registration / login with phone numberDavid Baker2017-03-131-16/+104
| | | | Changes from https://github.com/matrix-org/synapse/pull/1971
* Revert "Support registration & login with phone number"Erik Johnston2017-03-131-104/+16
|
* Comment when our 3pids would be incompleteDavid Baker2017-03-081-0/+2
|
* Better error messageDavid Baker2017-03-081-1/+3
|
* Minor fixes from PR feedbackDavid Baker2017-03-081-4/+2
|
* TyposDavid Baker2017-03-081-2/+2
|
* Refector out assert_params_in_requestDavid Baker2017-03-081-18/+8
| | | | and replace requestEmailToken where we meant requestMsisdnToken
* Factor out msisdn canonicalisationDavid Baker2017-03-081-9/+2
| | | | Plus a couple of other minor fixes
* Fix pep8David Baker2017-03-081-1/+1
|
* Add msisdns as 3pids during registrationDavid Baker2017-03-031-0/+47
| | | | and support binding them with the bind_msisdn param
* WIP support for msisdn 3pid proxy methodsDavid Baker2017-02-141-5/+61
|
* Fix email push in pusher workerErik Johnston2017-02-021-1/+2
| | | | | | This was broken when device list updates were implemented, as Mailer could no longer instantiate an AuthHandler due to a dependency on federation sending.
* Fix doc-stringRichard van der Hoff2016-12-011-2/+1
| | | | Remove refresh_token reference
* Rip out more refresh_token codeRichard van der Hoff2016-11-301-2/+0
| | | | | | | | We might as well treat all refresh_tokens as invalid. Just return a 403 from /tokenrefresh, so that we don't have a load of dead, untestable code hanging around. Still TODO: removing the table from the schema.
* Merge branch 'develop' into rav/no_more_refresh_tokensRichard van der Hoff2016-11-301-4/+15
|\
| * Give guest users a device_idRichard van der Hoff2016-11-251-4/+15
| | | | | | | | | | We need to create devices for guests so that they can use e2e, but we don't have anywhere to store it, so just use a fixed one.
* | Stop generating refresh tokensRichard van der Hoff2016-11-281-3/+2
|/ | | | | | | 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.
* Fix flake8Mark Haines2016-11-181-1/+0
|
* Work around client replacing reg paramsDavid Baker2016-11-181-0/+12
| | | | | Works around https://github.com/vector-im/vector-android/issues/715 and equivalent for iOS
* Add helper function for getting access_tokens from requestsMark Haines2016-09-091-2/+4
| | | | | | Rather than reimplementing the token parsing in the various places. This will make it easier to change the token parsing to allow access_tokens in HTTP headers.
* Preserve some logcontextsErik Johnston2016-08-241-2/+1
|
* Fix adding emails on registrationDavid Baker2016-07-291-9/+7
| | | | Synapse was not adding email addresses to accounts registered with an email address, due to too many different variables called 'result'. Rename both of them. Also remove the defer.returnValue() with no params because that's not a thing.
* Implement deleting devicesRichard van der Hoff2016-07-261-5/+5
|
* Preserve device_id from first call to /registerRichard van der Hoff2016-07-211-11/+10
| | | | | device_id may only be passed in the first call to /register, so make sure we fish it out of the register `params` rather than the body of the final call.
* Register a device_id in the /v2/register flow.Richard van der Hoff2016-07-201-15/+39
| | | | | | | | | | 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.
* Merge pull request #933 from matrix-org/rav/type_annotationsRichard van der Hoff2016-07-201-0/+9
|\ | | | | Type annotations
| * Type annotationsRichard van der Hoff2016-07-191-0/+9
| | | | | | | | | | Add some type annotations to help PyCharm (in particular) to figure out the types of a bunch of things.
* | Further registration refactoringRichard van der Hoff2016-07-191-13/+37
|/ | | | | | | | | | | | | | * `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.
* Don't bind email unless threepid contains expected fieldsRichard van der Hoff2016-07-191-28/+25
|
* rest/client/v2_alpha/register.py: Refactor flow somewhat.Richard van der Hoff2016-07-191-75/+102
| | | | | | | | | | | 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.
* Use body.get to check for 'user'Will Hunt2016-07-161-2/+1
|
* Fall back to 'username' if 'user' is not given for appservice reg.Will Hunt2016-07-161-3/+5
|
* on_OPTIONS isn't neccessaryDavid Baker2016-07-121-3/+0
|