summary refs log tree commit diff
path: root/tests/rest/admin (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add an `order_by` field to list users' media admin API. (#8978)Dirk Klimpel2021-02-221-21/+225
|
* Add the shadow-banning status to the display user admin API. (#9400)Dirk Klimpel2021-02-171-0/+2
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-167-252/+748
| | | | | | | - 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 pull request #9150 from Yoric/develop-contextDavid Teller2021-02-081-0/+84
|\ | | | | New API /_synapse/admin/rooms/{roomId}/context/{eventId}
| * FIXUP: linterDavid Teller2021-01-281-1/+3
| |
| * FIXUP: Now testing that the user is admin!David Teller2021-01-281-1/+35
| |
| * New API /_synapse/admin/rooms/{roomId}/context/{eventId}David Teller2021-01-281-0/+48
| | | | | | | | Signed-off-by: David Teller <davidt@element.io>
* | Add an admin API to get the current room state (#9168)Travis Ralston2021-02-021-0/+15
|/ | | | | 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.
* Add an admin API for shadow-banning users. (#9209)Patrick Cloke2021-01-251-0/+64
| | | | | | | | | | 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.
* Add tests for List Users Admin API (#9045)Dirk Klimpel2021-01-211-27/+196
|
* Add an admin API endpoint to protect media. (#9086)Patrick Cloke2021-01-151-3/+5
| | | | | | 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-0/+220
| | | 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-6/+52
| | | | For remote users, only the rooms which the server knows about are returned. Local users have all of their joined rooms returned.
* Removes unnecessary declarations in the tests for the admin API. (#9063)Dirk Klimpel2021-01-116-17/+0
|
* Drop the unused local_invites table. (#8979)Patrick Cloke2020-12-291-1/+0
| | | This table has been unused since Synapse v1.17.0.
* Allow server admin to get admin bit in rooms where local user is an admin ↵Erik Johnston2020-12-181-0/+138
| | | | | | | (#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>
* Fix `UsersListTestCase` (#8964)Richard van der Hoff2020-12-171-6/+4
|
* Fix a bug that deactivated users appear in the directory (#8933)Dirk Klimpel2020-12-171-1/+49
| | | | | | | | | | Fixes a bug that deactivated users appear in the directory when their profile information was updated. To change profile information of deactivated users is neccesary for example you will remove displayname or avatar. But they should not appear in directory. They are deactivated. Co-authored-by: Erik Johnston <erikj@jki.re>
* Make search statement in List Room and User Admin API case-insensitive (#8931)Dirk Klimpel2020-12-172-3/+105
|
* Convert internal pusher dicts to attrs classes. (#8940)Patrick Cloke2020-12-161-1/+1
| | | This improves type hinting and should use less memory.
* Remove spurious "SynapseRequest" result from `make_request"Richard van der Hoff2020-12-157-441/+301
| | | | This was never used, so let's get rid of it.
* Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-0/+34
|
* Call set_avatar_url with target_user, not user_id (#8872)Will Hunt2020-12-071-1/+6
| | | | | | | | | | | | | | | | | | | | * 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 to pusher URLs. (#8865)Patrick Cloke2020-12-041-1/+1
| | | | Pusher URLs now must end in `/_matrix/push/v1/notify` per the specification.
* Apply an IP range blacklist to push and key revocation requests. (#8821)Patrick Cloke2020-12-021-1/+1
| | | | | | | | | | | | Replaces the `federation_ip_range_blacklist` configuration setting with an `ip_range_blacklist` setting with wider scope. It now applies to: * Federation * Identity servers * Push notifications * Checking key validitity for third-party invite events The old `federation_ip_range_blacklist` setting is still honored if present, but with reduced scope (it only applies to federation and identity servers).
* Fix broken testcase (#8851)Richard van der Hoff2020-12-011-1/+0
| | | | This test was broken by #8565. It doesn't need to set set `self.clock` here anyway - that is done by `setUp`.
* Remove deprecated `/_matrix/client/*/admin` endpoints (#8785)Dirk Klimpel2020-11-253-4/+112
| | | These are now only available via `/_synapse/admin/v1`.
* Fix tests on develop (#8777)Erik Johnston2020-11-181-16/+0
| | | This was broken due to #8617 and #8761.
* Merge pull request #8761 from matrix-org/rav/test_request_renderingRichard van der Hoff2020-11-177-278/+0
|\ | | | | Make `make_request` actually render the request
| * Remove redundant `HomeserverTestCase.render`Richard van der Hoff2020-11-167-266/+0
| |
| * Make `make_request` actually render the requestRichard van der Hoff2020-11-162-12/+0
| | | | | | | | | | | | remove the stubbing out of `request.process`, so that `requestReceived` also renders the request via the appropriate resource. Replace render() with a stub for now.
* | Add admin API for logging in as a user (#8617)Erik Johnston2020-11-171-2/+243
|/
* Merge branch 'develop' into rav/pass_site_to_make_requestRichard van der Hoff2020-11-161-1/+1
|\
| * Rename `create_test_json_resource` to `create_test_resource` (#8759)Richard van der Hoff2020-11-161-1/+1
| | | | | | | | | | The root resource isn't necessarily a JsonResource, so rename this method accordingly, and update a couple of test classes to use the method rather than directly manipulating self.resource.
* | use global make_request() directly where we have a custom ResourceRichard van der Hoff2020-11-152-7/+24
|/ | | | | | Where we want to render a request against a specific Resource, call the global make_request() function rather than the one in HomeserverTestCase, allowing us to pass in an appropriate `Site`.
* Add an admin API for users' media statistics (#8700)Dirk Klimpel2020-11-051-0/+485
| | | | | | | | 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-2/+119
| | | Add `displayname` to Shared-Secret Registration for admins to `POST /_synapse/admin/v1/register`
* Consolidate purge table lists to prevent desyncronisation (#8713)Andrew Morgan2020-11-041-67/+38
| | | I idly noticed that these lists were out of sync with each other, causing us to miss a table in a test case (`local_invites`). Let's consolidate this list instead to prevent this from happening in the future.
* Fix unit tests (#8689)Erik Johnston2020-10-291-1/+1
| | | | | * Fix unit tests * Newsfile
* Add an admin APIs to allow server admins to list users' pushers (#8610)Dirk Klimpel2020-10-281-0/+124
| | | 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/+282
| | | 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-13/+183
| | | | | | | | | | | | 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-0/+568
| | | | | | 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-1/+15
| | | | 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-0/+17
|
* Fixed a bug with reactivating users with the admin API (#8362)Dirk Klimpel2020-09-221-0/+14
| | | | | | | Fixes: #8359 Trying to reactivate a user with the admin API (`PUT /_synapse/admin/v2/users/<user_name>`) causes an internal server error. Seems to be a regression in #8033.
* Admin API for reported events (#8217)Dirk Klimpel2020-09-221-0/+382
| | | Add an admin API to read entries of table `event_reports`. API: `GET /_synapse/admin/v1/event_reports`
* Create function to check for long names in devices (#8364)Dionysis Grigoropoulos2020-09-221-1/+1
| | | | | | | | | * Create a new function to verify that the length of a device name is under a certain threshold. * Refactor old code and tests to use said function. * Verify device name length during registration of device * Add a test for the above Signed-off-by: Dionysis Grigoropoulos <dgrig@erethon.com>
* Admin API for querying rooms where a user is a member (#8306)Dirk Klimpel2020-09-181-2/+94
| | | | Add a new admin API `GET /_synapse/admin/v1/users/<user_id>/joined_rooms` to list all rooms where a user is a member.
* Add the topic and avatar to the room details admin API (#8305)Tulir Asokan2020-09-141-0/+2
|
* Allow for make_awaitable's return value to be re-used. (#8261)Patrick Cloke2020-09-081-3/+3
|
* Convert stats and related calls to async/await (#8192)Patrick Cloke2020-08-271-5/+4
|
* Convert synapse.api to async/await (#8031)Patrick Cloke2020-08-061-3/+7
|
* Rename database classes to make some sense (#8033)Erik Johnston2020-08-051-2/+2
|
* Convert federation client to async/await. (#7975)Patrick Cloke2020-07-301-2/+2
|
* Add an option to disable purge in delete room admin API (#7964)Dirk Klimpel2020-07-281-2/+55
| | | | | | Add option ```purge``` to ```POST /_synapse/admin/v1/rooms/<room_id>/delete``` Fixes: #3761 Signed-off-by: Dirk Klimpel dirk@klimpel.org
* Convert tests/rest/admin/test_room.py to unix file endings (#7953)Andrew Morgan2020-07-271-1447/+1447
| | | | | Converts tests/rest/admin/test_room.py to have unix file endings after they were accidentally changed in #7613. Keeping the same changelog as #7613 as it hasn't gone out in a release yet.
* Add admin endpoint to get members in a room. (#7842)Michael Albert2020-07-161-0/+46
|
* Allow accounts to be re-activated from the admin APIs. (#7847)Patrick Cloke2020-07-151-0/+47
|
* Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-141-0/+395
| | | | | | | | | | | | | | | | | | 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
* Stop populating unused table `local_invites`. (#7793)Richard van der Hoff2020-07-071-1/+0
| | | | | This table is no longer used, so we may as well stop populating it. Removing it would prevent people rolling back to older releases of Synapse, so that can happen in a future release.
* Allow local media to be marked as safe from being quarantined. (#7718)Patrick Cloke2020-06-221-72/+65
|
* Allow new users to be registered via the admin API even if the monthly ↵Dirk Klimpel2020-06-051-15/+163
| | | | active user limit has been reached (#7263)
* Add device management to admin API (#7481)Dirk Klimpel2020-06-051-0/+541
| | | | | | | | | | - 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/+75
|
* Add room details admin endpoint (#7317)Manuel Stahl2020-05-071-0/+41
|
* Return total number of users and profile attributes in admin users endpoint ↵Manuel Stahl2020-04-281-0/+2
| | | | | (#6881) Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* Extend room admin api with additional attributes (#7225)Dirk Klimpel2020-04-222-592/+680
|
* Admin API to join users to a room. (#7051)Dirk Klimpel2020-03-271-0/+288
|
* Remove special casing of `m.room.aliases` events (#7034)Patrick Cloke2020-03-171-0/+7
|
* Fixed set a user as an admin with the new API (#6928)Dirk Klimpel2020-02-281-32/+186
| | | Fix #6910
* Ensure 'deactivated' parameter is a boolean on user admin API, Fix error ↵Andrew Morgan2020-02-261-0/+59
| | | | handling of call to deactivate user (#6990)
* Return a 404 for admin api user lookup if user not found (#6901)Andrew Morgan2020-02-121-0/+16
|
* Admin api to add an email address (#6789)Dirk Klimpel2020-02-071-2/+17
|
* MSC2260: Block direct sends of m.room.aliases events (#6794)Richard van der Hoff2020-01-301-7/+0
| | | | | as per MSC2260
* Admin API to list, filter and sort rooms (#6720)Andrew Morgan2020-01-221-4/+389
|
* Fix and add test to deprecated quarantine media admin api (#6756)Andrew Morgan2020-01-221-4/+11
|
* Fix changing password via user admin API. (#6730)Erik Johnston2020-01-201-0/+13
|
* Fix purge_room admin API (#6711)Erik Johnston2020-01-151-3/+1
|
* Quarantine media by ID or user ID (#6681)Andrew Morgan2020-01-131-0/+341
|
* Allow admin users to create or modify users without a shared secret (#6495)Manuel Stahl2020-01-092-338/+465
| | | Signed-off-by: Manuel Stahl <manuel.stahl@awesome-technologies.de>
* Fix GET request on /_synapse/admin/v2/users endpoint (#6563)Manuel Stahl2020-01-081-0/+41
| | | | Fixes #6552
* Move DB pool and helper functions into dedicated Database classErik Johnston2019-12-051-1/+1
|
* Remove underscore from SQLBaseStore functionsErik Johnston2019-12-041-1/+1
|
* Blacklist PurgeRoomTestCase (#6361)Andrew Morgan2019-11-131-0/+2
|
* Fix deleting state groups during room purge.Erik Johnston2019-11-061-1/+3
| | | | And fix the tests to actually test that things got deleted.
* Add unit test for /purge_room APIErik Johnston2019-10-311-0/+78
|
* Fix races in room stats (and other) updates. (#6187)Richard van der Hoff2019-10-101-1/+1
| | | | | | | Hopefully this will fix the occasional failures we were seeing in the room directory. The problem was that events are not necessarily persisted (and `current_state_delta_stream` updated) in the same order as their stream_id. So for instance current_state_delta 9 might be persisted *before* current_state_delta 8. Then, when the room stats saw stream_id 9, it assumed it had done everything up to 9, and never came back to do stream_id 8. We can solve this easily by only processing up to the stream_id where we know all events have been persisted.
* Run Black. (#5482)Amber Brown2019-06-201-51/+49
|
* Unify v1 and v2 REST client APIs (#5226)Amber Brown2019-06-031-1/+0
|
* Run Black on the tests again (#5170)Amber Brown2019-05-101-70/+33
|
* Remove the requirement to authenticate for /admin/server_version. (#5122)Richard van der Hoff2019-05-071-22/+8
| | | | | | | | | 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-4/+4
|
* Move admin api impl to its own packageRichard van der Hoff2019-05-012-0/+631
It doesn't really belong under rest/client/v1 any more.