summary refs log tree commit diff
path: root/synapse/rest/admin/rooms.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Filter added to Admin-API GET /rooms (#17276)Alexander Fechler2024-06-191-1/+12
|
* Parse json validation (#16923)Gordan Trevis2024-04-181-24/+12
| | | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | 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-10/+16
|
* Convert simple_select_one_txn and simple_select_one to return tuples. (#16612)Patrick Cloke2023-11-091-4/+4
|
* Remove remaining usage of cursor_to_dict. (#16564)Patrick Cloke2023-10-311-3/+8
|
* Add new module API for adding custom fields to events `unsigned` section ↵Erik Johnston2023-10-271-5/+5
| | | | (#16549)
* Remove more usages of cursor_to_dict. (#16551)Patrick Cloke2023-10-261-1/+11
| | | Mostly to improve type safety.
* Add automatic purge after all users forget a room (#15488)Mathieu Velten2023-09-151-31/+47
| | | | | | 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>
* Move ThirdPartyEventRules into module_api/callbacks (#15535)Andrew Morgan2023-05-041-1/+1
|
* Bump black from 22.12.0 to 23.1.0 (#15103)dependabot[bot]2023-02-221-4/+0
|
* Add helper to parse an enum from query args & use it. (#14956)Patrick Cloke2023-02-011-11/+5
| | | | | | | | The `parse_enum` helper pulls an enum value from the query string (by delegating down to the parse_string helper with values generated from the enum). This is used to pull out "f" and "b" in most places and then we thread the resulting Direction enum throughout more code.
* Move `StateFilter` to `synapse.types` (#14668)David Robertson2022-12-121-1/+1
| | | | | * Move `StateFilter` to `synapse.types` * Changelog
* Add Admin API to Fetch Messages Within a Particular Window (#13672)Connor Davis2022-09-071-0/+104
| | | 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-221-6/+6
| | | | | | | | | `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
|
* 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
|
* 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-231-8/+8
| | | | | | | The presence of this method was confusing, and mostly present for backwards compatibility. Let's get rid of it. Part of #11733
* 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).
* Do not try to serialize raw aggregations dict. (#11791)Patrick Cloke2022-01-211-9/+4
|
* 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.
* 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).
* Clean up `synapse.rest.admin` (#11535)Dirk Klimpel2021-12-081-48/+22
|
* 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.
* 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-291-27/+41
|
* Refactor the code to inject bundled relations during serialization. (#11408)Patrick Cloke2021-11-231-2/+2
|
* Add dedicated admin API for blocking a room (#11324)Dirk Klimpel2021-11-181-0/+63
|
* Convert delete room admin API to async endpoint (#11223)Dirk Klimpel2021-11-121-1/+133
| | | 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.
* Remove deprecated delete room admin API (#11213)Dirk Klimpel2021-11-011-88/+53
| | | | | Remove deprecated delete room admin API, `POST /_synapse/admin/v1/rooms/<room_id>/delete`
* 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>
* Remove deprecated Shutdown Room and Purge Room Admin API (#8830)Dirk Klimpel2021-08-171-35/+0
|
* Experimental support for MSC3266 Room Summary API. (#10394)Michael Telatynski2021-08-161-43/+2
|
* Use inline type hints in `handlers/` and `rest/`. (#10382)Jonathan de Jong2021-07-161-5/+3
|
* 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
|
* 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 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>`
* Make it possible to use dmypy (#9692)Erik Johnston2021-03-261-0/+3
| | | | | | | | | 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.
* 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 a bug when a room alias is given to the admin join endpoint (#9506)Patrick Cloke2021-03-011-58/+74
|
* Update black, and run auto formatting over the codebase (#9381)Eric Eastwood2021-02-161-3/+6
| | | | | | | - 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/+65
|\ | | | | 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-281-0/+53
| | | | | | | | Signed-off-by: David Teller <davidt@element.io>
* | Add an admin API to get the current room state (#9168)Travis Ralston2021-02-021-0/+39
|/ | | | | 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)
* Address pr feedbackJason Robinson2021-01-111-1/+1
| | | | | | | | | | * 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-071-0/+53
| | | | | | 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-2/+134
| | | | | | | (#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>
* Add number of local devices to Room Details Admin API (#8886)Dirk Klimpel2020-12-111-16/+32
|
* 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-251-2/+1
| | | These are now only available via `/_synapse/admin/v1`.
* Add admin API for logging in as a user (#8617)Erik Johnston2020-11-171-1/+3
|
* Remove the deprecated Handlers object (#8494)Patrick Cloke2020-10-091-2/+2
| | | All handlers now available via get_*_handler() methods on the HomeServer.
* 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-161-0/+25
|
* Add delete room admin endpoint (#7613)Dirk Klimpel2020-07-141-109/+48
| | | | | | | | | | | | | | | | | | 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
|
* 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.
* Add room details admin endpoint (#7317)Manuel Stahl2020-05-071-1/+25
|
* 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-271-3/+76
|
* Admin API to list, filter and sort rooms (#6720)Andrew Morgan2020-01-221-0/+82
|
* Move admin endpoints into separate files (#6308)Manuel Stahl2019-11-201-0/+157