summary refs log tree commit diff
path: root/synapse/module_api/callbacks (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove 3pid and identity serversRory&3 days2-212/+2
|
* Remove SAML/2 authRory&3 days1-4/+4
|
* Export RatelimitOverride from ModuleApi (#18513)Hugh Nimmo-Smith2025-06-061-1/+13
|
* Add ratelimit callbacks to module API to allow dynamic ratelimiting (#18458)Hugh Nimmo-Smith2025-06-042-0/+66
|
* Add user_may_send_state_event callback to spam checker module API (#18455)Hugh Nimmo-Smith2025-06-041-0/+57
|
* Add media repository callbacks to module API to control media upload size ↵Hugh Nimmo-Smith2025-06-042-0/+80
| | | | | | | | (#18457) Adds new callbacks for media related functionality: - `get_media_config_for_user` - `is_user_allowed_to_upload_media_of_size`
* Pass room_config argument to user_may_create_room spam checker module ↵Hugh Nimmo-Smith2025-06-041-16/+46
| | | | | | | | | | | | | | callback (#18486) This PR adds an additional `room_config` argument to the `user_may_create_room` spam checker module API callback. It will continue to work with implementations of `user_may_create_room` that do not expect the additional parameter. A side affect is that on a room upgrade the spam checker callback is called *after* doing some work to calculate the state rather than before. However, I hope that this is acceptable given the relative infrequency of room upgrades.
* Cleanup Python 3.8 leftovers (#17967)V024602025-02-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some small cleanups after Python3.8 became EOL. - Move some type imports from `typing_extensions` to `typing` - Remove the `abi3-py38` feature from pyo3 ### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [x] Pull request is based on the develop branch * [x] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [x] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --------- Co-authored-by: Quentin Gliech <quenting@element.io>
* Fix legacy modules `check_username_for_spam` (#18135)Erik Johnston2025-02-051-0/+2
| | | | | Broke in #17916, as the signature inspection incorrectly looks at the wrapper function. We fix this by setting the signature on the wrapper function to that of the wrapped function via `@functools.wraps`.
* forward requester id to check username for spam callbacks (#17916)Wilson2024-12-131-3/+27
|
* Bump mypy from 1.5.1 to 1.8.0 (#16901)dependabot[bot]2024-03-131-1/+1
|
* Fix joining remote rooms when a `on_new_event` callback is registered (#16973)Quentin Gliech2024-03-061-14/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Synapse 1.76.0, any module which registers a `on_new_event` callback would brick the ability to join remote rooms. This is because this callback tried to get the full state of the room, which would end up in a deadlock. Related: https://github.com/matrix-org/synapse-auto-accept-invite/issues/18 The following module would brick the ability to join remote rooms: ```python from typing import Any, Dict, Literal, Union import logging from synapse.module_api import ModuleApi, EventBase logger = logging.getLogger(__name__) class MyModule: def __init__(self, config: None, api: ModuleApi): self._api = api self._config = config self._api.register_third_party_rules_callbacks( on_new_event=self.on_new_event, ) async def on_new_event(self, event: EventBase, _state_map: Any) -> None: logger.info(f"Received new event: {event}") @staticmethod def parse_config(_config: Dict[str, Any]) -> None: return None ``` This is technically a breaking change, as we are now passing partial state on the `on_new_event` callback. However, this callback was broken for federated rooms since 1.76.0, and local rooms have full state anyway, so it's unlikely that it would change anything.
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-234-0/+4
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Merge remote-tracking branch 'gitlab/clokep/license-license' into new_developErik Johnston2023-12-134-41/+64
|\
| * Update license headersPatrick Cloke2023-11-214-41/+64
| |
* | ModuleAPI SSO auth callbacks (#15207)Andrew Yasinishyn2023-12-011-0/+6
|/ | | Signed-off-by: Andrii Yasynyshyn yasinishyn.a.n@gmail.com
* Use full GitHub links instead of bare issue numbers. (#16637)Patrick Cloke2023-11-151-1/+2
|
* Allow modules to delete rooms. (#15997)reivilibre2023-09-061-3/+8
| | | | | | | | | | | | | | | * Allow user_id to be optional for room deletion * Add module API method to delete a room * Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org> * Don't worry about the case block=True && requester_user_id is None --------- Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
* Run pyupgrade for python 3.7 & 3.8. (#16110)Patrick Cloke2023-08-151-36/+12
|
* Add tracing to media `/upload` endpoint (#15850)Eric Eastwood2023-07-051-0/+1
| | | Add tracing instrumentation to media `/upload` code paths to investigate https://github.com/matrix-org/synapse/issues/15841
* Add login spam checker API (#15838)Erik Johnston2023-06-261-0/+80
|
* Move ThirdPartyEventRules into module_api/callbacks (#15535)Andrew Morgan2023-05-042-0/+595
|
* Move Spam Checker callbacks to a dedicated file (#15453)Andrew Morgan2023-04-182-1/+831
|
* Move Account Validity callbacks to a dedicated file (#15237)Andrew Morgan2023-03-162-0/+115