summary refs log tree commit diff
path: root/docs/modules (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix joining remote rooms when a `on_new_event` callback is registered (#16973)Quentin Gliech2024-03-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix typoErik Johnston2023-12-131-1/+1
|
* Update book locationErik Johnston2023-12-132-3/+3
|
* More renamingErik Johnston2023-12-131-6/+6
|
* ModuleAPI SSO auth callbacks (#15207)Andrew Yasinishyn2023-12-011-0/+13
| | | Signed-off-by: Andrii Yasynyshyn yasinishyn.a.n@gmail.com
* Add new module API for adding custom fields to events `unsigned` section ↵Erik Johnston2023-10-271-0/+32
| | | | (#16549)
* Clarify presence router docs. (#16529)Patrick Cloke2023-10-201-3/+11
|
* Add login spam checker API (#15838)Erik Johnston2023-06-261-0/+36
|
* Consolidate logic to check for deactivated users. (#15634)Patrick Cloke2023-05-231-0/+3
| | | | | | | This moves the deactivated user check to the method which all login types call. Additionally updates the application service tests to be more realistic by removing invalid tests and fixing server names.
* Delete pushers after calling on_logged_out module hook on device delete (#15410)Mathieu Velten2023-04-141-0/+3
|
* Update spam checker documentation for moved media modules. (#15175)Patrick Cloke2023-02-281-2/+2
|
* Add documentation for caching in a module (#14026)Brendan Abolivier2023-02-281-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add documentation for caching in a module * Changelog * Formatting * Wrap lines at a length that mdbook is happier with * Typo fix Co-authored-by: Erik Johnston <erik@matrix.org> * Link to recent version of the API In the longer term I'd like to see us generate markdown with Sphinx. * Refer to public `cached` decorator * Mark caching as being added in 1.74 Some of the underlying infrastructure was added in 1.69, but the public-facing `cached` decorator was only added in 1.74. It is the latter that I think we should be advertising. * Update docs/modules/writing_a_module.md Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com> --------- Co-authored-by: David Robertson <davidr@element.io> Co-authored-by: Erik Johnston <erik@matrix.org> Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add module API callbacks for adding and deleting local 3PID associations (#15044Andrew Morgan2023-02-271-1/+44
|
* Clarify the workers that the ThirdPartyRules' `on_new_event` callback will ↵Andrew Morgan2023-02-221-0/+3
| | | | run on (#15071)
* Fix broken links in the Synapse documentation. (#14744)reivilibre2023-01-051-3/+3
| | | | | | | | | | | | | | | | | * Fix stale external links * Fix some internal links * Fix URLs without trailing / where needed * Fix more links * Newsfile Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org> * Reapply docs/openid.md fix after conflict Signed-off-by: Olivier Wilkinson (reivilibre) <oliverw@matrix.org>
* Fix return value in example on `password_auth_provider_callbacks.md` (#13450)Dirk Klimpel2022-08-041-2/+2
| | | | | Fixes: #12534 Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
* Fix version number in spam checker callbacks doc (#13047)Brendan Abolivier2022-06-141-6/+6
|
* Uniformize spam-checker API, part 4: port other spam-checker callbacks to ↵David Teller2022-06-131-56/+134
| | | | | return `Union[Allow, Codes]`. (#12857) Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Fix import in module_api module and docs on the new check_event_for_spam ↵Brendan Abolivier2022-05-311-16/+15
| | | | | signature (#12918) Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Uniformize spam-checker API, part 2: check_event_for_spam (#12808)David Teller2022-05-231-10/+17
| | | Signed-off-by: David Teller <davidt@element.io>
* add SpamChecker callback for silently dropping inbound federated events (#12744)Jess Porter2022-05-231-0/+18
| | | Signed-off-by: jesopo <github@lolnerd.net>
* Add a module callback to react to account data changes (#12327)Brendan Abolivier2022-04-012-1/+107
| | | | Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Add a callback to react to 3PID associations (#12302)Brendan Abolivier2022-03-311-0/+18
|
* Correct `check_username_for_spam` annotations and docs (#12246)David Robertson2022-03-181-4/+6
| | | | | | | * Formally type the UserProfile in user searches * export UserProfile in synapse.module_api * Update docs Co-authored-by: Sean Quah <8349537+squahtx@users.noreply.github.com>
* Add third_party module callbacks to check if a user can delete a room and ↵Will Hunt2022-03-091-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add module callbacks called for reacting to deactivation status change and ↵Brendan Abolivier2022-03-011-0/+56
| | | | profile update (#12062)
* Allow modules to set a display name on registration (#12009)Brendan Abolivier2022-02-171-4/+31
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Explain the meaning of spam checker callbacks' return values (#12003)David Robertson2022-02-161-13/+27
| | | Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
* Add a callback to allow modules to deny 3PID (#11854)Brendan Abolivier2022-02-081-0/+19
| | | | | Part of the Tchap Synapse mainlining. This allows modules to implement extra logic to figure out whether a given 3PID can be added to the local homeserver. In the Tchap use case, this will allow a Synapse module to interface with the custom endpoint /internal_info.
* Stabilise MSC3231 (Token Based Registration) (#11867)Jonathan de Jong2022-02-041-1/+1
|
* Add a module callback to set username at registration (#11790)Brendan Abolivier2022-01-261-0/+62
| | | | | | This is in the context of mainlining the Tchap fork of Synapse. Currently in Tchap usernames are derived from the user's email address (extracted from the UIA results, more specifically the m.login.email.identity step). This change also exports the check_username method from the registration handler as part of the module API, so that a module can check if the username it's trying to generate is correct and doesn't conflict with an existing one, and fallback gracefully if not. Co-authored-by: David Robertson <davidr@element.io>
* Make background updates controllable via a plugin (#11306)Erik Johnston2021-11-292-6/+77
| | | Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Make minor correction to type of auth_checkers callbacks (#11253)reivilibre2021-11-041-1/+1
|
* Make `check_event_allowed` module API callback not fail open (accept events) ↵reivilibre2021-11-011-0/+8
| | | | when an exception is raised (#11033)
* Improve code formatting and fix a few typos in docs (#11221)Sumner Evans2021-11-011-1/+1
| | | | | | * Labeled a lot more code blocks with the appropriate type * Fixed a couple of minor typos (missing/extraneous commas) Signed-off-by: Sumner Evans <me@sumnerevans.com>
* Deprecate user_may_create_room_with_invites (#11206)Brendan Abolivier2021-11-011-36/+0
|
* Implement an `on_new_event` callback (#11126)Brendan Abolivier2021-10-261-0/+21
| | | Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
* Document the version of Synapse each module callback was introduced in (#11132)Brendan Abolivier2021-10-205-0/+44
| | | | | | | | | | | | | | | | | | | | | * Mention callbacks introduced in v1.37.0 According to the documentation introduced in https://github.com/matrix-org/synapse/pull/10062 * Mention callbacks introduced in v1.39.0 According to https://github.com/matrix-org/synapse/pull/10386 and https://github.com/matrix-org/synapse/pull/9884 * Mention callbacks introduced in v1.42.0 According to https://github.com/matrix-org/synapse/pull/10524 * Mention callbacks introduced in v1.44.0 and v1.45.0 As per https://github.com/matrix-org/synapse/pull/10898, https://github.com/matrix-org/synapse/pull/10910 and https://github.com/matrix-org/synapse/pull/10894 * Mention callbacks introduced in v1.46.0 According to https://github.com/matrix-org/synapse/pull/10548
* Document Synapse's behaviour when dealing with multiple modules (#11096)Brendan Abolivier2021-10-187-8/+153
| | | | | | Document Synapse's behaviour when multiple modules register the same callback/web resource/etc. Co-authored-by: reivilibre <oliverw@matrix.org>
* Port the Password Auth Providers module interface to the new generic ↵Azrenbeth2021-10-132-0/+156
| | | | | | interface (#10548) Co-authored-by: Azrenbeth <7782548+Azrenbeth@users.noreply.github.com> Co-authored-by: Brendan Abolivier <babolivier@matrix.org>
* Add a spamchecker method to allow or deny 3pid invites (#10894)Brendan Abolivier2021-10-061-0/+35
| | | | | This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline. Note that a module callback already exists for 3pid invites (https://matrix-org.github.io/synapse/develop/modules/third_party_rules_callbacks.html#check_threepid_can_be_invited) but it doesn't check whether the sender of the invite is allowed to send it.
* Add a spamchecker callback to allow or deny room joins (#10910)Brendan Abolivier2021-10-061-0/+15
| | | Co-authored-by: Erik Johnston <erik@matrix.org>
* Add a spamchecker callback to allow or deny room creation based on invites ↵Brendan Abolivier2021-09-241-0/+29
| | | | | | | (#10898) This is in the context of creating new module callbacks that modules in https://github.com/matrix-org/synapse-dinsic can use, in an effort to reconcile the spam checker API in synapse-dinsic with the one in mainline. This adds a callback that's fairly similar to user_may_create_room except it also allows processing based on the invites sent at room creation.
* Fix #10837 by adding JSON encoding/decoding to the Module API example… ↵Charles Wright2021-09-171-2/+2
| | | | (#10845)
* Improve the modules doc (#10758)Brendan Abolivier2021-09-087-0/+529
* Split up the documentation in several files rather than one huge one * Add examples for each callback category * Other niceties like fixing https://github.com/matrix-org/synapse/issues/10632 * Add titles to callbacks so they're easier to find in the navigation panels and link to