summary refs log tree commit diff
path: root/synapse/rest/admin/__init__.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add support for MSC3823 - Account Suspension Part 2 (#17255)Shay2024-06-241-0/+3
|
* Bump black from 23.10.1 to 24.2.0 (#16936)dependabot[bot]2024-03-131-4/+6
|
* deactivated flag refactored to filter deactivated users. (#16874)Alexander Fechler2024-03-111-0/+2
| | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+2
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-3/+19
|
* Add an Admin API to temporarily grant the ability to update an existing ↵David Robertson2023-11-151-0/+2
| | | | cross-signing key without UIA (#16634)
* Factor out `MultiWriter` token from `RoomStreamToken` (#16427)Erik Johnston2023-10-051-1/+1
|
* Remove Python version from `/_synapse/admin/v1/server_version` (#16380)MomentQYC2023-10-021-5/+1
| | | | There's no reason to expose the full Python version over what is frequently a public API.
* Add automatic purge after all users forget a room (#15488)Mathieu Velten2023-09-151-5/+15
| | | | | | Also add restore of purge/shutdown rooms after a synapse restart. Co-authored-by: Eric Eastwood <erice@matrix.org> Co-authored-by: Erik Johnston <erikj@matrix.org>
* Merge remote-tracking branch 'origin/release-v1.91' into release-v1.92Patrick Cloke2023-09-061-3/+0
|\
| * Revert MSC3861 introspection cache, admin impersonation and account lock ↵Quentin Gliech2023-09-061-3/+0
| | | | | | | | (#16258)
* | Bump ruff from 0.0.277 to 0.0.286 (#16198)dependabot[bot]2023-08-291-1/+1
|/ | | | Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add an admin endpoint to allow authorizing server to signal token ↵Shay2023-08-221-0/+3
| | | | revocations (#16125)
* Disable incompatible Admin API endpointsQuentin Gliech2023-05-301-8/+13
|
* Add an admin API endpoint to support per-user feature flags (#15344)Shay2023-04-281-0/+2
|
* Add admin endpoint to query room sizes (#15482)Erik Johnston2023-04-261-1/+5
|
* Prefer `type(x) is int` to `isinstance(x, int)` (#14945)David Robertson2023-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Perfer `type(x) is int` to `isinstance(x, int)` This covered all additional instances I could see where `x` was user-controlled. The remaining cases are ``` $ rg -s 'isinstance.*[^_]int' tests/replication/_base.py 576: if isinstance(obj, int): synapse/util/caches/stream_change_cache.py 136: assert isinstance(stream_pos, int) 214: assert isinstance(stream_pos, int) 246: assert isinstance(stream_pos, int) 267: assert isinstance(stream_pos, int) synapse/replication/tcp/external_cache.py 133: if isinstance(result, int): synapse/metrics/__init__.py 100: if isinstance(calls, (int, float)): synapse/handlers/appservice.py 262: assert isinstance(new_token, int) synapse/config/_util.py 62: if isinstance(p, int): ``` which cover metrics, logic related to `jsonschema`, and replication and data streams. AFAICS these are all internal to Synapse * Changelog
* Add a type hint for `get_device_handler()` and fix incorrect types. (#14055)Patrick Cloke2022-11-221-11/+15
| | | | | 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.
* Add an Admin API endpoint for looking up users based on 3PID (#14405)Ashish Kumar2022-11-111-0/+2
|
* Add an admin API endpoint to find a user based on its external ID in an auth ↵Quentin Gliech2022-09-161-0/+2
| | | | provider. (#13810)
* Add Admin API to Fetch Messages Within a Particular Window (#13672)Connor Davis2022-09-071-0/+4
| | | This adds two new admin APIs that allow us to fetch messages from a room within a particular time.
* Fix Synapse git info missing in version strings (#12973)David Robertson2022-06-071-3/+2
|
* Remove user-visible groups/communities code (#12553)Patrick Cloke2022-05-251-3/+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)
* Remove `HomeServer.get_datastore()` (#12031)Richard van der Hoff2022-02-231-1/+1
| | | | | | | 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
* Add admin API to get a list of federated rooms (#11658)Dirk Klimpel2022-01-251-0/+2
|
* Add admin API to reset connection timeouts for remote server (#11639)Dirk Klimpel2022-01-251-2/+4
| | | * Fix get federation status of destination if no error occured
* Add admin API to get users' account data (#11664)Dirk Klimpel2022-01-051-0/+2
| | | Co-authored-by: reivilibre <olivier@librepush.net>
* Clean up `synapse.rest.admin` (#11535)Dirk Klimpel2021-12-081-2/+2
|
* Add admin API to get some information about federation status (#11407)Dirk Klimpel2021-12-061-0/+6
|
* Convert status codes to `HTTPStatus` in `synapse.rest.admin` (#11452)Dirk Klimpel2021-11-291-7/+12
|
* Add an admin API to run background jobs. (#11352)Dirk Klimpel2021-11-191-0/+2
| | | | | | 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-181-0/+2
|
* Convert delete room admin API to async endpoint (#11223)Dirk Klimpel2021-11-121-0/+6
| | | Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Add some background update admin APIs (#11263)Erik Johnston2021-11-081-0/+6
| | | Fixes #11259
* Remove deprecated delete room admin API (#11213)Dirk Klimpel2021-11-011-2/+0
| | | | | Remove deprecated delete room admin API, `POST /_synapse/admin/v1/rooms/<room_id>/delete`
* Use direct references for configuration variables (part 5). (#10897)Patrick Cloke2021-09-241-1/+1
|
* 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).
* Improve ServerNoticeServlet to avoid duplicate requests (#10679)Dirk Klimpel2021-08-271-1/+4
| | | Fixes: #9544
* Implement MSC3231: Token authenticated registration (#10142)Callum Brown2021-08-211-0/+8
| | | | | 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).
* Merge branch 'release-v1.41' into developErik Johnston2021-08-181-2/+0
|\
| * Mount /_synapse/admin/v1/users/{userId}/media admin API on media workers ↵Andrew Morgan2021-08-181-2/+0
| | | | | | | | | | only (#10628) Co-authored-by: Patrick Cloke <patrickc@matrix.org>
* | Remove deprecated Shutdown Room and Purge Room Admin API (#8830)Dirk Klimpel2021-08-171-4/+0
|/
* Add an admin API to check if a username is available (#10578)Will Hunt2021-08-171-0/+2
| | | 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.
* Add missing type hints to the admin API servlets (#10105)Dirk Klimpel2021-06-071-21/+24
|
* 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>`
* Add an admin API to manage ratelimit for a specific user (#9648)Dirk Klimpel2021-04-131-0/+2
|
* Remove old admin API `GET /_synapse/admin/v1/users/<user_id>` (#9401)Dirk Klimpel2021-04-091-2/+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
* Merge pull request #9150 from Yoric/develop-contextDavid Teller2021-02-081-0/+2
|\ | | | | New API /_synapse/admin/rooms/{roomId}/context/{eventId}
| * New API /_synapse/admin/rooms/{roomId}/context/{eventId}David Teller2021-01-281-0/+2
| | | | | | | | Signed-off-by: David Teller <davidt@element.io>
* | Add an admin API to get the current room state (#9168)Travis Ralston2021-02-021-0/+2
|/ | | | | 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.
* Merge branch 'develop' into jaywink/admin-forward-extremitiesJason Robinson2021-01-261-0/+2
|\ | | | | | | | | # Conflicts: # synapse/rest/admin/__init__.py
| * Add an admin API for shadow-banning users. (#9209)Patrick Cloke2021-01-251-0/+2
| | | | | | | | | | | | | | | | | | | | 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.
* | Address pr feedbackJason Robinson2021-01-111-0/+2
| | | | | | | | | | | | | | | | | | | | * docs updates * prettify SQL * add missing copyright * cursor_to_dict * update touched files copyright years Signed-off-by: Jason Robinson <jasonr@matrix.org>
* | Add forward extremities endpoint to rooms admin APIJason Robinson2021-01-071-0/+2
|/ | | | | | 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-181-0/+2
| | | | | | | (#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>
* Remove deprecated `/_matrix/client/*/admin` endpoints (#8785)Dirk Klimpel2020-11-251-9/+3
| | | These are now only available via `/_synapse/admin/v1`.
* Add admin API for logging in as a user (#8617)Erik Johnston2020-11-171-0/+2
|
* Add an admin API for users' media statistics (#8700)Dirk Klimpel2020-11-051-0/+2
| | | | | | | | 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 an admin APIs to allow server admins to list users' pushers (#8610)Dirk Klimpel2020-10-281-1/+3
| | | 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-271-0/+2
| | | 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-261-1/+5
| | | | | | | | | | | | 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
* 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-221-0/+2
| | | 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-181-0/+2
| | | | Add a new admin API `GET /_synapse/admin/v1/users/<user_id>/joined_rooms` to list all rooms where a user is a member.
* Use admin_patterns for all admin APIs. (#8331)Patrick Cloke2020-09-171-2/+2
| | | This reduces duplication of the admin prefix in regular expressions.
* Add admin endpoint to get members in a room. (#7842)Michael Albert2020-07-161-0/+2
|
* Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-141-0/+2
| | | | | | | | | | | | | | | | | | 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
* Add device management to admin API (#7481)Dirk Klimpel2020-06-051-0/+8
| | | | | | | | | | - Admin is able to - change displaynames - delete devices - list devices - get device informations Fixes #7330
* Add room details admin endpoint (#7317)Manuel Stahl2020-05-071-0/+2
|
* Admin API to join users to a room. (#7051)Dirk Klimpel2020-03-271-1/+6
|
* Admin API to list, filter and sort rooms (#6720)Andrew Morgan2020-01-221-1/+2
|
* Remove get_room_event_after_stream_ordering entirelyBrendan Abolivier2020-01-161-1/+1
|
* Allow admin users to create or modify users without a shared secret (#6495)Manuel Stahl2020-01-091-0/+2
| | | Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* Replace /admin/v1/users_paginate endpoint with /admin/v2/users (#5925)Manuel Stahl2019-12-051-2/+2
|
* Move admin endpoints into separate files (#6308)Manuel Stahl2019-11-201-553/+14
|
* 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.
* Add maybe_awaitable and fix __init__ bugsErik Johnston2019-10-111-2/+5
|
* 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
* Remove unnecessary parentheses around return statements (#5931)Andrew Morgan2019-08-301-13/+13
| | | | | 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-271-1/+1
| | | | Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
* Add Admin API capability to set adminship of a user (#5878)reivilibre2019-08-271-0/+2
| | | Admin API: Set adminship of a user
* Servlet to purge old rooms (#5845)Richard van der Hoff2019-08-221-0/+2
|
* Don't load the media repo when configured to use an external media repo (#5754)Amber Brown2019-08-131-90/+12
|
* Replace returnValue with return (#5736)Amber Brown2019-07-231-25/+23
|
* 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-201-81/+72
|
* 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-021-2/+15
|
* Factor out an "assert_requester_is_admin" function (#5120)Richard van der Hoff2019-05-021-75/+20
| | | | 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.