summary refs log tree commit diff
path: root/synapse/rest/admin (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move `StateFilter` to `synapse.types` (#14668)David Robertson2022-12-121-1/+1
| | | | | * Move `StateFilter` to `synapse.types` * Changelog
* Add a type hint for `get_device_handler()` and fix incorrect types. (#14055)Patrick Cloke2022-11-222-14/+25
| | | | | This was the last untyped handler from the HomeServer object. Since it was being treated as Any (and thus unchecked) it was being used incorrectly in a few places.
* Remove redundant types from comments. (#14412)Patrick Cloke2022-11-161-2/+3
| | | | | | | Remove type hints from comments which have been added as Python type hints. This helps avoid drift between comments and reality, as well as removing redundant information. Also adds some missing type hints which were simple to fill in.
* Add an Admin API endpoint for looking up users based on 3PID (#14405)Ashish Kumar2022-11-112-0/+27
|
* Allow admins to require a manual approval process before new accounts can be ↵Brendan Abolivier2022-09-291-1/+42
| | | | used (using MSC3866) (#13556)
* Support enabling/disabling pushers (from MSC3881) (#13799)Brendan Abolivier2022-09-211-2/+2
| | | Partial implementation of MSC3881
* Add an admin API endpoint to find a user based on its external ID in an auth ↵Quentin Gliech2022-09-162-0/+29
| | | | provider. (#13810)
* Add Admin API to Fetch Messages Within a Particular Window (#13672)Connor Davis2022-09-072-0/+108
| | | This adds two new admin APIs that allow us to fetch messages from a room within a particular time.
* `synapse.api.auth.Auth` cleanup: make permission-related methods use ↵Quentin Gliech2022-08-224-22/+21
| | | | | | | | | `Requester` instead of the `UserID` (#13024) Part of #13019 This changes all the permission-related methods to rely on the Requester instead of the UserID. This is a first step towards enabling scoped access tokens at some point, since I expect the Requester to have scope-related informations in it. It also changes methods which figure out the user/device/appservice out of the access token to return a Requester instead of something else. This avoids having store-related objects in the methods signatures.
* Add forgotten status to Room Details API (#13503)Dirk Klimpel2022-08-171-0/+1
|
* Fix "add user" admin api error when request contains a "msisdn" threepid ↵Thomas Weston2022-07-131-0/+1
| | | | | | (#13263) Co-authored-by: Thomas Weston <thomas.weston@clearspancloud.com> Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
* Fix Synapse git info missing in version strings (#12973)David Robertson2022-06-071-3/+2
|
* Consolidate the logic of delete_device/delete_devices. (#12970)Patrick Cloke2022-06-071-1/+1
| | | | | | | | By always using delete_devices and sometimes passing a list with a single device ID. Previously these methods had gotten out of sync with each other and it seems there's little benefit to the single-device variant.
* Prevent local quarantined media from being claimed by media retention (#12972)Andrew Morgan2022-06-071-5/+3
|
* Allow updating passwords using the admin api without logging out devices ↵Jan Christian Grünhage2022-06-061-1/+7
| | | | (#12952)
* Reduce the amount of state we pull from the DB (#12811)Erik Johnston2022-06-061-9/+25
|
* Wait for lazy join to complete when getting current state (#12872)Erik Johnston2022-06-011-1/+2
|
* Remove user-visible groups/communities code (#12553)Patrick Cloke2022-05-252-53/+0
| | | | | | | | | Makes it so that groups/communities no longer exist from a user-POV. E.g. we remove: * All API endpoints (including Client-Server, Server-Server, and admin). * Documented configuration options (and the experimental flag, which is now unused). * Special handling during room upgrades. * The `groups` section of the `/sync` response.
* Deprecate the groups/communities endpoints and add an experimental ↵Patrick Cloke2022-03-121-1/+2
| | | | configuration flag. (#12200)
* Add third_party module callbacks to check if a user can delete a room and ↵Will Hunt2022-03-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deactivate a user (#12028) * Add check_can_deactivate_user * Add check_can_shutdown_rooms * Documentation * callbacks, not functions * Various suggested tweaks * Add tests for test_check_can_shutdown_room and test_check_can_deactivate_user * Update check_can_deactivate_user to not take a Requester * Fix check_can_shutdown_room docs * Renegade and use `by_admin` instead of `admin_user_id` * fix lint * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> * Update docs/modules/third_party_rules_callbacks.md Co-authored-by: Brendan Abolivier <babolivier@matrix.org> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-2310-45/+45
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* Use version string helper from matrix-common (#11979)David Robertson2022-02-141-3/+3
| | | | * Require latest matrix-common * Use the common function
* Improvements to bundling aggregations. (#11815)Patrick Cloke2022-01-261-15/+24
| | | | | | | | | | | This is some odds and ends found during the review of #11791 and while continuing to work in this code: * Return attrs classes instead of dictionaries from some methods to improve type safety. * Call `get_bundled_aggregations` fewer times. * Adds a missing assertion in the tests. * Do not return empty bundled aggregations for an event (preferring to not include the bundle at all, as the docstring states).
* Add admin API to get a list of federated rooms (#11658)Dirk Klimpel2022-01-252-0/+58
|
* Add admin API to reset connection timeouts for remote server (#11639)Dirk Klimpel2022-01-252-3/+47
| | | * Fix get federation status of destination if no error occured
* Do not try to serialize raw aggregations dict. (#11791)Patrick Cloke2022-01-211-9/+4
|
* Remove the 'password_hash' from the Users Admin API endpoint response ↵Andrew Morgan2022-01-141-7/+6
| | | | dictionary (#11576)
* Replace uses of simple_insert_many with simple_insert_many_values. (#11742)Patrick Cloke2022-01-131-26/+18
| | | | This should be (slightly) more efficient and it is simpler to have a single method for inserting multiple values.
* Bundle aggregations outside of the serialization method. (#11612)Patrick Cloke2022-01-071-8/+8
| | | | | | | | This makes the serialization of events synchronous (and it no longer access the database), but we must manually calculate and provide the bundled aggregations. Overall this should cause no change in behavior, but is prep work for other improvements.
* Fix get federation status of destination if no error occured (#11593)Dirk Klimpel2022-01-051-7/+19
|
* Run `pyupgrade --py37-plus --keep-percent-format` on Synapse (#11685)Shay2022-01-051-1/+1
| | | | | | | | | * newsfragment * fix newsfragment number * update changelog * remove extra space
* Add admin API to get users' account data (#11664)Dirk Klimpel2022-01-052-0/+32
| | | Co-authored-by: reivilibre <olivier@librepush.net>
* Do not bundle aggregations for APIs which shouldn't include them. (#11592)Patrick Cloke2021-12-201-3/+9
| | | | | And make bundling aggregations opt-in, instead of opt-out to avoid having APIs to include extraneous data (and being much heavier than necessary).
* Make `get_device` return None if the device doesn't exist rather than ↵reivilibre2021-12-131-0/+2
| | | | | raising an exception. (#11565) Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Clean up `synapse.rest.admin` (#11535)Dirk Klimpel2021-12-0813-164/+94
|
* Fix 'delete room' admin api to work on incomplete rooms (#11523)Richard van der Hoff2021-12-071-3/+0
| | | | | If, for some reason, we don't have the create event, we should still be able to purge a room.
* Add admin API to get some information about federation status (#11407)Dirk Klimpel2021-12-062-0/+141
|
* Include bundled aggregations in /sync and related fixes (#11478)Patrick Cloke2021-12-061-11/+2
| | | | | | | | Due to updates to MSC2675 this includes a few fixes: * Include bundled aggregations for /sync. * Do not include bundled aggregations for /initialSync and /events. * Do not bundle aggregations for state events. * Clarifies comments and variable names.
* Convert status codes to `HTTPStatus` in `synapse.rest.admin` (#11452)Dirk Klimpel2021-11-2911-171/+275
|
* Refactor the code to inject bundled relations during serialization. (#11408)Patrick Cloke2021-11-231-2/+2
|
* Add an admin API to run background jobs. (#11352)Dirk Klimpel2021-11-192-27/+98
| | | | | | Instead of having admins poke into the database directly. Can currently run jobs to populate stats and to populate the user directory.
* Add dedicated admin API for blocking a room (#11324)Dirk Klimpel2021-11-182-0/+65
|
* Rename `get_access_token_for_user_id` method to ↵reivilibre2021-11-171-1/+1
| | | | `create_access_token_for_user_id` (#11369)
* Add ability to un-shadow-ban via the admin API. (#11347)Patrick Cloke2021-11-161-2/+22
|
* Convert delete room admin API to async endpoint (#11223)Dirk Klimpel2021-11-122-1/+139
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Allow admins to proactively block rooms (#11228)David Robertson2021-11-091-4/+17
| | | | Co-authored-by: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Support filtering by relations per MSC3440 (#11236)Patrick Cloke2021-11-091-1/+4
| | | | Adds experimental support for `relation_types` and `relation_senders` fields for filters.
* Add some background update admin APIs (#11263)Erik Johnston2021-11-082-0/+113
| | | Fixes #11259
* Remove deprecated delete room admin API (#11213)Dirk Klimpel2021-11-012-90/+53
| | | | | Remove deprecated delete room admin API, `POST /_synapse/admin/v1/rooms/<room_id>/delete`
* Enable changing user type via users admin API (#11174)Jason Robinson2021-10-261-0/+3
| | | | | | | | 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>
* Add type hints for most `HomeServer` parameters (#11095)Sean Quah2021-10-221-1/+1
|
* Fix setting a user's external_id via the admin API returns 500 and deletes ↵Dirk Klimpel2021-10-211-29/+18
| | | | | users existing external mappings if that external ID is already mapped (#11051) Fixes #10846
* Show error when timestamp in seconds is provided to the /purge_media_cache ↵Aaron R2021-10-201-6/+27
| | | | API (#11101)
* Use direct references for configuration variables (part 7). (#10959)Patrick Cloke2021-10-041-2/+2
|
* Use direct references for configuration variables (part 5). (#10897)Patrick Cloke2021-09-241-1/+1
|
* Allow `.` and `~` chars in registration tokens (#10887)Callum Brown2021-09-231-1/+1
| | | | Per updates to MSC3231 in order to use the same grammar as other identifiers.
* Use direct references for some configuration variables (part 3) (#10885)Patrick Cloke2021-09-231-2/+2
| | | | | | | | 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.
* Remove unnecessary parentheses around tuples returned from methods (#10889)Andrew Morgan2021-09-231-2/+2
|
* Allow Synapse Admin API's Room Search to accept non-ASCII characters (#10859)Hillery Shay2021-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add tests for checking if room search works with non-ascii char * change encoding on parse_string to UTF-8 * lints * properly encode search term * lints * add changelog file * update changelog number * set changelog entry filetype to .bugfix * Revert "set changelog entry filetype to .bugfix" This reverts commit be8e5a314251438ec4ec7dbc59ba32162c93e550. * update changelog message and file type * change parse_string default encoding back to ascii and update room search admin api calll to parse string * refactor tests * Update tests/rest/admin/test_room.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add missing type hints to non-client REST servlets. (#10817)Patrick Cloke2021-09-153-3/+3
| | | | Including admin, consent, key, synapse, and media. All REST servlets (the synapse.rest module) now require typed method definitions.
* Use direct references for some configuration variables (#10798)Patrick Cloke2021-09-131-1/+1
| | | | Instead of proxying through the magic getter of the RootConfig object. This should be more performant (and is more explicit).
* Additional type hints for client REST servlets (part 5) (#10736)Patrick Cloke2021-09-031-2/+4
| | | | Additionally this enforce type hints on all function signatures inside of the synapse.rest.client package.
* Improve ServerNoticeServlet to avoid duplicate requests (#10679)Dirk Klimpel2021-08-272-8/+16
| | | Fixes: #9544
* Implement MSC3231: Token authenticated registration (#10142)Callum Brown2021-08-212-0/+329
| | | | | 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-20/+35
|
* Merge branch 'release-v1.41' into developErik Johnston2021-08-183-164/+163
|\
| * Mount /_synapse/admin/v1/users/{userId}/media admin API on media workers ↵Andrew Morgan2021-08-183-164/+163
| | | | | | | | | | only (#10628) Co-authored-by: Patrick Cloke <patrickc@matrix.org>
* | Remove deprecated Shutdown Room and Purge Room Admin API (#8830)Dirk Klimpel2021-08-173-97/+0
|/
* Flatten the synapse.rest.client package (#10600)reivilibre2021-08-171-2/+2
|
* Allow to edit `external_ids` by Edit User admin API (#10598)Dirk Klimpel2021-08-171-48/+91
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add an admin API to check if a username is available (#10578)Will Hunt2021-08-172-0/+53
| | | This adds a new API GET /_synapse/admin/v1/username_available?username=foo to check if a username is available. It is the counterpart to https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available, except that it works even if registration is disabled.
* Experimental support for MSC3266 Room Summary API. (#10394)Michael Telatynski2021-08-161-43/+2
|
* Admin API to delete media for a specific user (#10558)Dirk Klimpel2021-08-112-7/+77
|
* Add `creation_ts` to list users admin API (#10448)Dirk Klimpel2021-07-221-0/+2
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add a return type to parse_string. (#10438)Patrick Cloke2021-07-211-2/+2
| | | | And set the required attribute in a few places which will error if a parameter is not provided.
* Use inline type hints in `handlers/` and `rest/`. (#10382)Jonathan de Jong2021-07-162-6/+4
|
* Add a module type for account validity (#9884)Brendan Abolivier2021-07-161-8/+16
| | | | | This adds an API for third-party plugin modules to implement account validity, so they can provide this feature instead of Synapse. The module implementing the current behaviour for this feature can be found at https://github.com/matrix-org/synapse-email-account-validity. To allow for a smooth transition between the current feature and the new module, hooks have been added to the existing account validity endpoints to allow their behaviours to be overridden by a module.
* Bugfix `make_room_admin` fails for users that have left a private room (#10367)Dirk Klimpel2021-07-131-1/+8
| | | Fixes: #10338
* Correct type hints for parse_string(s)_from_args. (#10137)Patrick Cloke2021-06-081-1/+1
|
* Add missing type hints to the admin API servlets (#10105)Dirk Klimpel2021-06-075-40/+47
|
* Add new admin APIs to remove media by media ID from quarantine. (#10044)Dirk Klimpel2021-06-021-0/+30
| | | | | Related to: #6681, #5956, #10040 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add an admin API for unprotecting local media from quarantine (#10040)Dirk Klimpel2021-05-261-2/+26
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Use a database table to hold the users that should have full presence sent ↵Andrew Morgan2021-05-181-3/+5
| | | | to them, instead of something in-memory (#9823)
* Delete room endpoint (#9889)ThibF2021-04-291-44/+90
| | | | | | Support the delete of a room through DELETE request and mark previous request as deprecated through documentation. Signed-off-by: Thibault Ferrante <thibault.ferrante@pm.me>
* Remove various bits of compatibility code for Python <3.6 (#9879)Andrew Morgan2021-04-271-1/+2
| | | I went through and removed a bunch of cruft that was lying around for compatibility with old Python versions. This PR also will now prevent Synapse from starting unless you're running Python 3.6+.
* Remove redundant "coding: utf-8" lines (#9786)Jonathan de Jong2021-04-1411-11/+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>`
* Add an admin API to manage ratelimit for a specific user (#9648)Dirk Klimpel2021-04-132-0/+113
|
* Remove old admin API `GET /_synapse/admin/v1/users/<user_id>` (#9401)Dirk Klimpel2021-04-092-25/+0
| | | | | | | | | | | | | Related: #8334 Deprecated in: #9429 - Synapse 1.28.0 (2021-02-25) `GET /_synapse/admin/v1/users/<user_id>` has no - unit tests - documentation API in v2 is available (#5925 - 12/2019, v1.7.0). API is misleading. It expects `user_id` and returns a list of all users. Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add `order_by` to list user admin API (#9691)Dirk Klimpel2021-04-011-1/+20
|
* Make it possible to use dmypy (#9692)Erik Johnston2021-03-262-0/+6
| | | | | | | | | Running `dmypy run` will do a `mypy` check while spinning up a daemon that makes rerunning `dmypy run` a lot faster. `dmypy` doesn't support `follow_imports = silent` and has `local_partial_types` enabled, so this PR enables those options and fixes the issues that were newly raised. Note that `local_partial_types` will be enabled by default in upcoming mypy releases.
* Import HomeServer from the proper module. (#9665)Patrick Cloke2021-03-231-1/+1
|
* Consistently check whether a password may be set for a user. (#9636)Dirk Klimpel2021-03-181-1/+1
|
* Prevent bundling aggregations for state events (#9619)Andrew Morgan2021-03-161-1/+4
| | | There's no need to do aggregation bundling for state events. Doing so can cause performance issues.
* Fix additional type hints from Twisted 21.2.0. (#9591)Patrick Cloke2021-03-122-19/+25
|
* Re-Activating account when local passwords are disabled (#9587)Dirk Klimpel2021-03-111-1/+4
| | | Fixes: #8393
* Add type hints to purge room and server notice admin API. (#9520)Dirk Klimpel2021-03-082-15/+23
|
* Add type hints to user admin API. (#9521)Dirk Klimpel2021-03-031-29/+56
|
* Add type hints to device and event report admin API (#9519)Dirk Klimpel2021-03-022-16/+39
|
* Fix a bug when a room alias is given to the admin join endpoint (#9506)Patrick Cloke2021-03-011-58/+74
|
* Use the proper Request in type hints. (#9515)Patrick Cloke2021-03-011-1/+1
| | | | This also pins the Twisted version in the mypy job for CI until proper type hints are fixed throughout Synapse.
* Add an `order_by` field to list users' media admin API. (#8978)Dirk Klimpel2021-02-221-1/+27
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-164-12/+11
| | | | | | | - 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
* Fix some typos.Patrick Cloke2021-02-121-1/+1
|
* Merge pull request #9150 from Yoric/develop-contextDavid Teller2021-02-082-0/+67
|\ | | | | New API /_synapse/admin/rooms/{roomId}/context/{eventId}
| * FIXUP: linterDavid Teller2021-01-281-0/+5
| |
| * FIXUP: Making get_event_context a bit more paranoidDavid Teller2021-01-281-1/+1
| |
| * FIXUP: DocDavid Teller2021-01-281-0/+6
| |
| * FIXUP: Now testing that the user is admin!David Teller2021-01-281-1/+2
| |
| * New API /_synapse/admin/rooms/{roomId}/context/{eventId}David Teller2021-01-282-0/+55
| | | | | | | | Signed-off-by: David Teller <davidt@element.io>
* | Add an admin API to get the current room state (#9168)Travis Ralston2021-02-022-0/+41
|/ | | | | This could arguably replace the existing admin API for `/members`, however that is out of scope of this change. This sort of endpoint is ideal for moderation use cases as well as other applications, such as needing to retrieve various bits of information about a room to perform a task (like syncing power levels between two places). This endpoint exposes nothing more than an admin would be able to access with a `select *` query on their database.
* Check if a user is in the room before sending a PowerLevel event on their ↵Pankaj Yadav2021-01-271-1/+11
| | | | behalf (#9235)
* Merge branch 'develop' into jaywink/admin-forward-extremitiesJason Robinson2021-01-262-0/+38
|\ | | | | | | | | # Conflicts: # synapse/rest/admin/__init__.py
| * Add an admin API for shadow-banning users. (#9209)Patrick Cloke2021-01-252-0/+38
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge branch 'develop' into jaywink/admin-forward-extremitiesJason Robinson2021-01-232-32/+82
|\|
| * Add tests for List Users Admin API (#9045)Dirk Klimpel2021-01-211-3/+18
| |
| * Add an admin API endpoint to protect media. (#9086)Patrick Cloke2021-01-151-15/+49
| | | | | | | | | | | | Protecting media stops it from being quarantined when e.g. all media in a room is quarantined. This is useful for sticker packs and other media that is uploaded by server administrators, but used by many people.
| * Remove user's avatar URL and displayname when deactivated. (#8932)Dirk Klimpel2021-01-121-7/+15
| | | | | | This only applies if the user's data is to be erased.
| * Also support remote users on the joined_rooms admin API. (#8948)David Teller2021-01-111-7/+0
| | | | | | | | For remote users, only the rooms which the server knows about are returned. Local users have all of their joined rooms returned.
* | Address pr feedbackJason Robinson2021-01-112-1/+3
| | | | | | | | | | | | | | | | | | | | * docs updates * prettify SQL * add missing copyright * cursor_to_dict * update touched files copyright years Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | Implement clearing cache after deleting forward extremitiesJason Robinson2021-01-091-12/+9
| | | | | | | | | | | | Also run linter. Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | Add Rooms admin forward extremities DELETE endpointJason Robinson2021-01-081-0/+5
| | | | | | | | Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | Move unknown room ID error into resolve_room_idJason Robinson2021-01-071-7/+9
| | | | | | | | Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | Add forward extremities endpoint to rooms admin APIJason Robinson2021-01-072-0/+55
|/ | | | | | GET /_synapse/admin/v1/rooms/<identifier>/forward_extremities now gets forward extremities for a room, returning count and the list of extremities. Signed-off-by: Jason Robinson <jasonr@matrix.org>
* Allow server admin to get admin bit in rooms where local user is an admin ↵Erik Johnston2020-12-182-2/+136
| | | | | | | (#8756) This adds an admin API that allows a server admin to get power in a room if a local user has power in a room. Will also invite the user if they're not in the room and its a private room. Can specify another user (rather than the admin user) to be granted power. Co-authored-by: Matthew Hodgson <matthew@matrix.org>
* Convert internal pusher dicts to attrs classes. (#8940)Patrick Cloke2020-12-161-15/+1
| | | This improves type hinting and should use less memory.
* Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-16/+32
|
* Call set_avatar_url with target_user, not user_id (#8872)Will Hunt2020-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | * Call set_avatar_url with target_user, not user_id Fixes https://github.com/matrix-org/synapse/issues/8871 * Create 8872.bugfix * Update synapse/rest/admin/users.py Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> * Testing * Update changelog.d/8872.bugfix Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Add additional validation for the admin register endpoint. (#8837)David Florness2020-12-021-0/+3
| | | Raise a proper 400 error if the `mac` field is missing.
* Add `force_purge` option to delete-room admin api. (#8843)Richard van der Hoff2020-11-301-5/+17
|
* Remove deprecated `/_matrix/client/*/admin` endpoints (#8785)Dirk Klimpel2020-11-256-57/+27
| | | These are now only available via `/_synapse/admin/v1`.
* Add admin API for logging in as a user (#8617)Erik Johnston2020-11-173-2/+58
|
* Add an admin API for users' media statistics (#8700)Dirk Klimpel2020-11-052-0/+124
| | | | | | | | Add `GET /_synapse/admin/v1/statistics/users/media` to get statisics about local media usage by users. Related to #6094 It is the first API for statistics. Goal is to avoid/reduce usage of sql queries like [Wiki analyzing Synapse](https://github.com/matrix-org/synapse/wiki/SQL-for-analyzing-Synapse-PostgreSQL-database-stats) Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add `displayname` to Shared-Secret Registration for admins (#8722)Dirk Klimpel2020-11-051-0/+2
| | | Add `displayname` to Shared-Secret Registration for admins to `POST /_synapse/admin/v1/register`
* Add an admin APIs to allow server admins to list users' pushers (#8610)Dirk Klimpel2020-10-282-1/+55
| | | Add an admin API `GET /_synapse/admin/v1/users/<user_id>/pushers` like https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushers
* Add admin API to list users' local media (#8647)Dirk Klimpel2020-10-272-1/+68
| | | Add admin API `GET /_synapse/admin/v1/users/<user_id>/media` to get information of users' uploaded files.
* Split admin API for reported events into a detail and a list view (#8539)Dirk Klimpel2020-10-262-2/+50
| | | | | | | | | | | | Split admin API for reported events in detail und list view. API was introduced with #8217 in synapse v.1.21.0. It makes the list (`GET /_synapse/admin/v1/event_reports`) less complex and provides a better overview. The details can be queried with: `GET /_synapse/admin/v1/event_reports/<report_id>`. It is similar to room and users API. It is a kind of regression in `GET /_synapse/admin/v1/event_reports`. `event_json` was removed. But the api was introduced one version before and it is an admin API (not under spec). Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add an admin api to delete local media. (#8519)Dirk Klimpel2020-10-261-2/+79
| | | | | | Related to: #6459, #3479 Add `DELETE /_synapse/admin/v1/media/<server_name>/<media_id>` to delete a single file from server.
* Fix a bug in the joined_rooms admin API (#8643)Dirk Klimpel2020-10-261-3/+4
| | | | If the user was not in any rooms then the API returned the same error as if the user did not exist.
* Add field `total` to device list in admin API (#8644)Dirk Klimpel2020-10-261-1/+1
|
* Remove the deprecated Handlers object (#8494)Patrick Cloke2020-10-092-9/+8
| | | All handlers now available via get_*_handler() methods on the HomeServer.
* Remove stream ordering from Metadata dict (#8452)Richard van der Hoff2020-10-051-1/+4
| | | | | | | | There's no need for it to be in the dict as well as the events table. Instead, we store it in a separate attribute in the EventInternalMetadata object, and populate that on load. This means that we can rely on it being correctly populated for any event which has been persited to the database.
* Make token serializing/deserializing async (#8427)Erik Johnston2020-09-301-1/+1
| | | The idea is that in future tokens will encode a mapping of instance to position. However, we don't want to include the full instance name in the string representation, so instead we'll have a mapping between instance name and an immutable integer ID in the DB that we can use instead. We'll then do the lookup when we serialize/deserialize the token (we could alternatively pass around an `Instance` type that includes both the name and ID, but that turns out to be a lot more invasive).
* Various clean ups to room stream tokens. (#8423)Erik Johnston2020-09-291-1/+2
|
* Admin API for reported events (#8217)Dirk Klimpel2020-09-222-0/+90
| | | Add an admin API to read entries of table `event_reports`. API: `GET /_synapse/admin/v1/event_reports`
* Admin API for querying rooms where a user is a member (#8306)Dirk Klimpel2020-09-182-0/+28
| | | | Add a new admin API `GET /_synapse/admin/v1/users/<user_id>/joined_rooms` to list all rooms where a user is a member.
* Simplify super() calls to Python 3 syntax. (#8344)Patrick Cloke2020-09-181-1/+1
| | | | | | | This converts calls like super(Foo, self) -> super(). Generated with: sed -i "" -Ee 's/super\([^\(]+\)/super()/g' **/*.py
* Use admin_patterns for all admin APIs. (#8331)Patrick Cloke2020-09-176-26/+19
| | | This reduces duplication of the admin prefix in regular expressions.
* Search in columns 'name' and 'displayname' in the admin users endpoint (#7377)Manuel Stahl2020-08-251-1/+3
| | | | | * Search in columns 'name' and 'displayname' in the admin users endpoint Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* Stop shadow-banned users from sending invites. (#8095)Patrick Cloke2020-08-201-0/+3
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-1/+1
|
* Add an option to disable purge in delete room admin API (#7964)Dirk Klimpel2020-07-281-1/+10
| | | | | | Add option ```purge``` to ```POST /_synapse/admin/v1/rooms/<room_id>/delete``` Fixes: #3761 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add admin endpoint to get members in a room. (#7842)Michael Albert2020-07-162-0/+27
|
* Allow accounts to be re-activated from the admin APIs. (#7847)Patrick Cloke2020-07-151-1/+9
|
* Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-142-109/+50
| | | | | | | | | | | | | | | | | | The Delete Room admin API allows server admins to remove rooms from server and block these rooms. `DELETE /_synapse/admin/v1/rooms/<room_id>` It is a combination and improvement of "[Shutdown room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/shutdown_room.md)" and "[Purge room](https://github.com/matrix-org/synapse/blob/develop/docs/admin_api/purge_room.md)" API. Fixes: #6425 It also fixes a bug in [synapse/storage/data_stores/main/room.py](synapse/storage/data_stores/main/room.py) in ` get_room_with_stats`. It should return `None` if the room is unknown. But it returns an `IndexError`. https://github.com/matrix-org/synapse/blob/901b1fa561e3cc661d78aa96d59802cf2078cb0d/synapse/storage/data_stores/main/room.py#L99-L105 Related to: - #5575 - https://github.com/Awesome-Technologies/synapse-admin/issues/17 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Additional configuration options for auto-join rooms (#7763)Patrick Cloke2020-06-301-2/+2
|
* Replace all remaining six usage with native Python 3 equivalents (#7704)Dagfinn Ilmari Mannsåker2020-06-161-14/+6
|
* Fix type information on `assert_*_is_admin` methods (#7645)Richard van der Hoff2020-06-051-19/+14
| | | These things don't return Deferreds.
* Allow new users to be registered via the admin API even if the monthly ↵Dirk Klimpel2020-06-051-0/+2
| | | | active user limit has been reached (#7263)
* Add device management to admin API (#7481)Dirk Klimpel2020-06-052-0/+169
| | | | | | | | | | - Admin is able to - change displaynames - delete devices - list devices - get device informations Fixes #7330
* Email notifications for new users when creating via the Admin API. (#7267)Dirk Klimpel2020-06-011-0/+16
|
* Add option to move event persistence off master (#7517)Erik Johnston2020-05-221-2/+9
|
* Add ability to wait for replication streams (#7542)Erik Johnston2020-05-221-1/+9
| | | | | | | The idea here is that if an instance persists an event via the replication HTTP API it can return before we receive that event over replication, which can lead to races where code assumes that persisting an event immediately updates various caches (e.g. current state of the room). Most of Synapse doesn't hit such races, so we don't do the waiting automagically, instead we do so where necessary to avoid unnecessary delays. We may decide to change our minds here if it turns out there are a lot of subtle races going on. People probably want to look at this commit by commit.
* Hash passwords earlier in the password reset process (#7538)Patrick Cloke2020-05-201-2/+11
| | | | This now matches the logic of the registration process as modified in 56db0b1365965c02ff539193e26c333b7f70d101 / #7523.
* Merge tag 'v1.13.0rc3' into developPatrick Cloke2020-05-181-15/+15
|\ | | | | | | | | | | | | | | Synapse 1.13.0rc3 (2020-05-18) Bugfixes: - Hash passwords as early as possible during registration. #7523
| * Hash passwords earlier in the registration process (#7523)Patrick Cloke2020-05-181-15/+15
| |
* | Add room details admin endpoint (#7317)Manuel Stahl2020-05-072-1/+27
|/
* Return total number of users and profile attributes in admin users endpoint ↵Manuel Stahl2020-04-281-4/+4
| | | | | (#6881) Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* Extend room admin api with additional attributes (#7225)Dirk Klimpel2020-04-221-1/+14
|
* Admin API to join users to a room. (#7051)Dirk Klimpel2020-03-272-4/+82
|
* Add an option to the set password API to choose whether to logout other ↵Patrick Cloke2020-03-181-2/+4
| | | | devices. (#7085)
* Fixed set a user as an admin with the new API (#6928)Dirk Klimpel2020-02-281-4/+2
| | | Fix #6910
* Ensure 'deactivated' parameter is a boolean on user admin API, Fix error ↵Andrew Morgan2020-02-261-4/+7
| | | | handling of call to deactivate user (#6990)
* Clarify list/set/dict/tuple comprehensions and enforce via flake8 (#6957)Patrick Cloke2020-02-211-2/+2
| | | | Ensure good comprehension hygiene using flake8-comprehensions.
* Return a 404 for admin api user lookup if user not found (#6901)Andrew Morgan2020-02-121-1/+4
|
* Admin api to add an email address (#6789)Dirk Klimpel2020-02-071-0/+39
|
* Allow URL-encoded user IDs on user admin api paths (#6825)Andrew Morgan2020-02-031-2/+2
|
* Minor fixes to user admin api (#6761)Richard van der Hoff2020-01-231-9/+5
| | | | * don't insist on a password (this is valid if you have an SSO login) * fix reference to undefined `requester`
* Remove unnecessary abstractions in admin handler (#6751)Andrew Morgan2020-01-221-10/+9
|
* Admin API to list, filter and sort rooms (#6720)Andrew Morgan2020-01-223-1/+99
|
* Fix and add test to deprecated quarantine media admin api (#6756)Andrew Morgan2020-01-221-1/+1
|
* Fixup synapse.rest to pass mypy (#6732)Erik Johnston2020-01-201-11/+12
|
* Fix changing password via user admin API. (#6730)Erik Johnston2020-01-201-2/+2
|
* Remove get_room_event_after_stream_ordering entirelyBrendan Abolivier2020-01-161-1/+1
|
* Quarantine media by ID or user ID (#6681)Andrew Morgan2020-01-131-2/+66
|
* Allow admin users to create or modify users without a shared secret (#6495)Manuel Stahl2020-01-092-0/+144
| | | Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* Replace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925)Manuel Stahl2019-12-052-56/+31
|
* Move admin endpoints into separate files (#6308)Manuel Stahl2019-11-204-555/+621
|
* Remove usage of deprecated logger.warn method from codebase (#6271)Andrew Morgan2019-10-311-1/+1
| | | Replace every instance of `logger.warn` with `logger.warning` as the former is deprecated.
* Port synapse/rest/client/_base.py to async/awaitErik Johnston2019-10-111-9/+5
|
* Add maybe_awaitable and fix __init__ bugsErik Johnston2019-10-111-2/+5
|
* Port synaps/rest/client/users.py to async/awaitErik Johnston2019-10-111-11/+7
|
* Port synaps/rest/client/server_notice_servlet.py to async/awaitErik Johnston2019-10-111-6/+3
|
* Port synaps/rest/client/media.py to async/awaitErik Johnston2019-10-111-16/+11
|
* Port rest/admin/__init__.py to async/awaitErik Johnston2019-10-111-72/+55
|
* Ensure the list media admin API is always available (#5966)Travis Ralston2019-09-031-2/+5
| | | | | | | | * Ensure the list media admin API is always available This API is required for some external media repo implementations to operate (mostly for doing quarantine operations on a room). * changelog
* Ensure an auth instance is available to ListMediaInRoom (#5967)Travis Ralston2019-09-031-0/+1
| | | | | | | | * Ensure an auth instance is available to ListMediaInRoom Fixes https://github.com/matrix-org/synapse/issues/5737 * Changelog
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-305-20/+20
| | | | | 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 GET method to admin API /users/@user:dom/adminOlivier Wilkinson (reivilibre)2019-08-272-9/+33
| | | | Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
* Add Admin API capability to set adminship of a user (#5878)reivilibre2019-08-272-0/+78
| | | Admin API: Set adminship of a user
* Servlet to purge old rooms (#5845)Richard van der Hoff2019-08-222-0/+59
|
* Don't load the media repo when configured to use an external media repo (#5754)Amber Brown2019-08-133-90/+138
|
* Merge tag 'v1.2.0rc2' into developAndrew Morgan2019-07-241-2/+7
|\ | | | | | | | | | | | | Bugfixes -------- - Fix a regression introduced in v1.2.0rc1 which led to incorrect labels on some prometheus metrics. ([\#5734](https://github.com/matrix-org/synapse/issues/5734))
| * Fix servlet metric names (#5734)Jorik Schellekens2019-07-241-2/+7
| | | | | | | | | | | | | | | | | | | | * Fix servlet metric names Co-Authored-By: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Remove redundant check * Cover all return paths
* | Replace returnValue with return (#5736)Amber Brown2019-07-232-26/+24
|/
* Remove access-token support from RegistrationHandler.register (#5641)Richard van der Hoff2019-07-081-2/+1
| | | | | | | | 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-202-90/+76
|
* Implement the SHHS complexity API (#5216)Amber Brown2019-05-301-3/+9
|
* Remove the requirement to authenticate for /admin/server_version. (#5122)Richard van der Hoff2019-05-071-10/+5
| | | | | | | | | This endpoint isn't much use for its intended purpose if you first need to get yourself an admin's auth token. I've restricted it to the `/_synapse/admin` path to make it a bit easier to lock down for those concerned about exposing this information. I don't imagine anyone is using it in anger currently.
* Add admin api for sending server_notices (#5121)Richard van der Hoff2019-05-022-2/+115
|
* Factor out an "assert_requester_is_admin" function (#5120)Richard van der Hoff2019-05-022-75/+79
| | | | Rather than copying-and-pasting the same four lines hundreds of times
* fix examplesRichard van der Hoff2019-05-011-4/+4
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-011-0/+896
It doesn't really belong under rest/client/v1 any more.