summary refs log tree commit diff
path: root/synapse/storage/databases/main/registration.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add some type hints to datastore (#12423)Dirk Klimpel2022-04-121-54/+79
| | | | | | | | | | | | | | | | | | | * Add some type hints to datastore * newsfile * change `Collection` to `List` * refactor return type of `select_users_txn` * correct type hint in `stream.py` * Remove `Optional` in `select_users_txn` * remove not needed return type in `__init__` * Revert change in `get_stream_id_for_event_txn` * Remove import from `Literal`
* Move `update_client_ip` background job from the main process to the ↵reivilibre2022-04-011-12/+12
| | | | background worker. (#12251)
* Add some type hints to datastore. (#12255)Dirk Klimpel2022-03-281-1/+2
|
* Remove unnecessary pass statements. (#12206)Patrick Cloke2022-03-111-2/+0
|
* Fix slow performance of `/logout` in some cases where refresh tokens are in ↵reivilibre2022-02-221-2/+16
| | | | use. The slowness existed since the initial implementation of refresh tokens. (#12056)
* Document why auth providers aren't validated in the admin API. (#12004)Patrick Cloke2022-02-181-0/+21
| | | | Since it is reasonable to give a future or past auth provider, which might not be in the current configuration.
* Use auto_attribs/native type hints for attrs classes. (#11692)Patrick Cloke2022-01-131-9/+9
|
* Improve type hints in storage classes. (#11652)Dirk Klimpel2021-12-291-7/+10
| | | By using cast and making ignores more specific.
* Remove redundant `COALESCE()`s around `COUNT()`s in database queries (#11570)Sean Quah2021-12-141-2/+2
| | | | | `COUNT()` never returns `NULL`. A `COUNT(*)` over 0 rows is 0 and a `COUNT(NULL)` is also 0.
* Ensure emails are canonicalized before fetching associated user. (#11547)Patrick Cloke2021-12-101-1/+2
| | | | This should fix pushers with an email in non-canonical form is used as the pushkey.
* Support expiry of refresh tokens and expiry of the overall session when ↵reivilibre2021-11-261-2/+26
| | | | refresh tokens are in use. (#11425)
* Add missing type hints to config base classes (#11377)Patrick Cloke2021-11-231-1/+2
|
* Remove code invalidated by deprecated config flag ↵Shay2021-11-231-32/+3
| | | | | | | | | | | | | | | | | | | | | 'trust_identity_servers_for_password_resets' (#11395) * remove background update code related to deprecated config flag * changelog entry * update changelog * Delete 11394.removal Duplicate, wrong number * add no-op background update and change newfragment so it will be consolidated with associated work * remove unused code * Remove code associated with deprecated flag from legacy docker dynamic config file Co-authored-by: reivilibre <oliverw@matrix.org>
* Use auto_attribs for RefreshTokenLookupResult (#11386)reivilibre2021-11-181-7/+7
|
* Add ability to un-shadow-ban via the admin API. (#11347)Patrick Cloke2021-11-161-1/+1
|
* Enable changing user type via users admin API (#11174)Jason Robinson2021-10-261-0/+18
| | | | | | | | Users admin API can now also modify user type in addition to allowing it to be set on user creation. Signed-off-by: Jason Robinson <jasonr@matrix.org> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Fix setting a user's external_id via the admin API returns 500 and deletes ↵Dirk Klimpel2021-10-211-5/+90
| | | | | users existing external mappings if that external ID is already mapped (#11051) Fixes #10846
* Add missing type hints to synapse.api. (#11109)Patrick Cloke2021-10-181-4/+4
| | | | * Convert UserPresenceState to attrs. * Remove args/kwargs from error classes and explicitly pass msg/errorcode.
* Annotate synapse.storage.util (#10892)David Robertson2021-10-081-2/+7
| | | | | Also mark `synapse.streams` as having has no untyped defs Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Require direct references to configuration variables. (#10985)Patrick Cloke2021-10-061-1/+3
| | | | | | This removes the magic allowing accessing configurable variables directly from the config object. It is now required that a specific configuration class is used (e.g. `config.foo` must be replaced with `config.server.foo`).
* Use direct references for configuration variables (part 7). (#10959)Patrick Cloke2021-10-041-1/+1
|
* Use direct references for configuration variables (part 6). (#10916)Patrick Cloke2021-09-291-1/+1
|
* Use direct references for configuration variables (part 5). (#10897)Patrick Cloke2021-09-241-1/+1
|
* Use direct references for some configuration variables (part 3) (#10885)Patrick Cloke2021-09-231-1/+1
| | | | | | | | This avoids the overhead of searching through the various configuration classes by directly referencing the class that the attributes are in. It also improves type hints since mypy can now resolve the types of the configuration variables.
* Use direct references for some configuration variables (#10798)Patrick Cloke2021-09-131-2/+2
| | | | Instead of proxying through the magic getter of the RootConfig object. This should be more performant (and is more explicit).
* Add types to synapse.util. (#10601)reivilibre2021-09-101-0/+1
|
* Implement MSC3231: Token authenticated registration (#10142)Callum Brown2021-08-211-0/+316
| | | | | Signed-off-by: Callum Brown <callum@calcuode.com> This is part of my GSoC project implementing [MSC3231](https://github.com/matrix-org/matrix-doc/pull/3231).
* Remove not needed database updates in modify user admin API (#10627)Dirk Klimpel2021-08-191-7/+18
|
* Allow to edit `external_ids` by Edit User admin API (#10598)Dirk Klimpel2021-08-171-0/+22
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add `get_userinfo_by_id` method to `ModuleApi` (#9581)Jason Robinson2021-08-041-1/+29
| | | | | | Makes it easier to fetch user details in for example spam checker modules, without needing to use api._store or figure out database interactions. Signed-off-by: Jason Robinson <jasonr@matrix.org>
* Use inline type hints in `http/federation/`, `storage/` and `util/` (#10381)Jonathan de Jong2021-07-151-1/+1
|
* MSC2918 Refresh tokens implementation (#9450)Quentin Gliech2021-06-241-4/+203
| | | | | | | | | | 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>
* Remove unnecessary SystemRandom from SQLBaseStore (#9987)Dan Callahan2021-05-141-1/+2
| | | | | | | | It's not obvious that instances of SQLBaseStore each need their own instances of random.SystemRandom(); let's just use random directly. Introduced by 52839886d664576831462e033b88e5aba4c019e3 Signed-off-by: Dan Callahan <danc@element.io>
* Port "Allow users to click account renewal links multiple times without ↵Andrew Morgan2021-04-191-16/+46
| | | | | hitting an 'Invalid Token' page #74" from synapse-dinsic (#9832) This attempts to be a direct port of https://github.com/matrix-org/synapse-dinsic/pull/74 to mainline. There was some fiddling required to deal with the changes that have been made to mainline since (mainly dealing with the split of `RegistrationWorkerStore` from `RegistrationStore`, and the changes made to `self.make_request` in test code).
* 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>`
* Consistently check whether a password may be set for a user. (#9636)Dirk Klimpel2021-03-181-0/+1
|
* Convert Requester to attrs (#9586)Richard van der Hoff2021-03-101-3/+3
| | | | | | ... because namedtuples suck Fix up a couple of other annotations to keep mypy happy.
* Refactor to ensure we call check_consistency (#9470)Erik Johnston2021-02-241-3/+16
| | | The idea here is to stop people forgetting to call `check_consistency`. Folks can still just pass in `None` to the new args in `build_sequence_generator`, but hopefully they won't.
* Add the shadow-banning status to the display user admin API. (#9400)Dirk Klimpel2021-02-171-2/+5
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-2/+5
| | | | | | | - 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 branch 'social_login' into developRichard van der Hoff2021-02-011-20/+20
|\
| * Fix SSO on workers (#9271)Richard van der Hoff2021-02-011-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #8966. * Factor out build_synapse_client_resource_tree Start a function which will mount resources common to all workers. * Move sso init into build_synapse_client_resource_tree ... so that we don't have to do it for each worker * Fix SSO-login-via-a-worker Expose the SSO login endpoints on workers, like the documentation says. * Update workers config for new endpoints Add documentation for endpoints recently added (#8942, #9017, #9262) * remove submit_token from workers endpoints list this *doesn't* work on workers (yet). * changelog * Add a comment about the odd path for SAML2Resource
* | Add an admin API for shadow-banning users. (#9209)Patrick Cloke2021-01-251-0/+29
| | | | | | | | | | | | | | | | | | | | This expands the current shadow-banning feature to be usable via the admin API and adds documentation for it. A shadow-banned users receives successful responses to their client-server API requests, but the events are not propagated into rooms. Shadow-banning a user should be used as a tool of last resort and may lead to confusing or broken behaviour for the client.
* | Use execute_batch in more places (#9188)Erik Johnston2021-01-211-1/+1
|/ | | | | * Use execute_batch in more places * Newsfile
* Allow re-using a UI auth validation for a period of time (#8970)Patrick Cloke2020-12-181-0/+38
|
* UIA: offer only available auth flowsRichard van der Hoff2020-12-021-0/+25
| | | | | | | During user-interactive auth, do not offer password auth to users with no password, nor SSO auth to users with no SSO. Fixes #7559.
* Add admin API for logging in as a user (#8617)Erik Johnston2020-11-171-0/+2
|
* Add ability for access tokens to belong to one user but grant access to ↵Erik Johnston2020-10-291-9/+39
| | | | | | | | | | another user. (#8616) We do it this way round so that only the "owner" can delete the access token (i.e. `/logout/all` by the "owner" also deletes that token, but `/logout/all` by the "target user" doesn't). A future PR will add an API for creating such a token. When the target user and authenticated entity are different the `Processed request` log line will be logged with a: `{@admin:server as @bob:server} ...`. I'm not convinced by that format (especially since it adds spaces in there, making it harder to use `cut -d ' '` to chop off the start of log lines). Suggestions welcome.
* Add type hints for account validity handler (#8620)Patrick Cloke2020-10-261-2/+2
| | | This also fixes a bug by fixing handling of an account which doesn't expire.
* Type hints for RegistrationStore (#8615)Erik Johnston2020-10-221-73/+83
|
* Move additional tasks to the background worker, part 4 (#8513)Patrick Cloke2020-10-131-26/+26
|
* Fix message duplication if something goes wrong after persisting the event ↵Erik Johnston2020-10-131-1/+5
| | | | | (#8476) Should fix #3365.
* Move additional tasks to the background worker, part 3 (#8489)Patrick Cloke2020-10-091-8/+3
|
* Add type hints to some handlers (#8505)Patrick Cloke2020-10-091-1/+3
|
* Move additional tasks to the background worker (#8458)Patrick Cloke2020-10-071-93/+91
|
* Add support for MSC2697: Dehydrated devices (#8380)Hubert Chathi2020-10-071-1/+31
| | | | This allows a user to store an offline device on the server and then restore it at a subsequent login.
* Add checks for postgres sequence consistency (#8402)Erik Johnston2020-09-281-0/+3
|
* Allow existing users to login via OpenID Connect. (#8345)Tdxdxoz2020-09-251-2/+2
| | | | | | | Co-authored-by: Benjamin Koch <bbbsnowball@gmail.com> This adds configuration flags that will match a user to pre-existing users when logging in via OpenID Connect. This is useful when switching to an existing SSO system.
* Don't push if an user account has expired (#8353)Mathieu Velten2020-09-231-0/+14
|
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-3/+3
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Fix incorrect return signatureAndrew Morgan2020-08-281-1/+1
|
* Convert `event_push_actions`, `registration`, and `roommember` datastores to ↵Patrick Cloke2020-08-281-115/+123
| | | | async (#8197)
* Convert simple_delete to async/await. (#8191)Patrick Cloke2020-08-271-15/+14
|
* Convert calls of async database methods to async (#8166)Patrick Cloke2020-08-271-15/+14
|
* Convert simple_update* and simple_select* to async (#8173)Patrick Cloke2020-08-271-10/+12
|
* Convert simple_select_one and simple_select_one_onecol to async (#8162)Patrick Cloke2020-08-261-5/+5
|
* Don't fail /submit_token requests on incorrect session ID if ↵Brendan Abolivier2020-08-241-6/+19
| | | | | | | | | | | | | | | | | | | 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>
* Convert some of the general database methods to async (#8100)Patrick Cloke2020-08-171-5/+3
|
* Add a shadow-banned flag to users. (#8092)Patrick Cloke2020-08-141-1/+8
|
* Remove some unused database functions. (#8085)Patrick Cloke2020-08-141-37/+0
|
* Converts event_federation and registration databases to async/await (#8061)Patrick Cloke2020-08-111-128/+105
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-0/+1588