summary refs log tree commit diff
path: root/synapse/events/spamcheck.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add missing type hints to handlers and fix a Spam Checker type hint. (#9896)Patrick Cloke2021-04-291-1/+4
| | | | | The user_may_create_room_alias method on spam checkers declared the room_alias parameter as a str when in reality it is passed a RoomAlias object.
* Remove `synapse.types.Collection` (#9856)Richard van der Hoff2021-04-221-2/+1
| | | This is no longer required, since we have dropped support for Python 3.5.
* 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>`
* Pass SSO IdP information to spam checker's registration function (#9626)Andrew Morgan2021-03-161-3/+26
| | | | | | | Fixes https://github.com/matrix-org/synapse/issues/9572 When a SSO user logs in for the first time, we create a local Matrix user for them. This goes through the register_user flow, which ends up triggering the spam checker. Spam checker modules don't currently have any way to differentiate between a user trying to sign up initially, versus an SSO user (whom has presumably already been approved elsewhere) trying to log in for the first time. This PR passes `auth_provider_id` as an argument to the `check_registration_for_spam` function. This argument will contain an ID of an SSO provider (`"saml"`, `"cas"`, etc.) if one was used, else `None`.
* Add check_media_file_for_spam spam checker hookErik Johnston2021-02-041-0/+47
|
* Allow spam-checker modules to be provide async methods. (#8890)David Teller2020-12-111-16/+39
| | | | Spam checker modules can now provide async methods. This is implemented in a backwards-compatible manner.
* Use TYPE_CHECKING instead of magic MYPY variable. (#8770)Patrick Cloke2020-11-171-3/+2
|
* Combine `SpamCheckerApi` with the more generic `ModuleApi`. (#8464)Richard van der Hoff2020-10-071-2/+3
| | | | | Lots of different module apis is not easy to maintain. Rather than adding yet another ModuleApi(hs, hs.get_auth_handler()) incantation, first add an hs.get_module_api() method and use it where possible.
* Stop sub-classing object (#8249)Patrick Cloke2020-09-041-1/+1
|
* Allow denying or shadow banning registrations via the spam checker (#8034)Patrick Cloke2020-08-201-2/+33
|
* Extend spam checker to allow for multiple modules (#7435)Andrew Morgan2020-05-081-39/+39
|
* Add type hints to the spam check module (#6915)Patrick Cloke2020-02-141-18/+26
| | | | Add typing information to the spam checker modules.
* Filter the results of user directory searching via the spam checker (#6888)Patrick Cloke2020-02-141-0/+27
| | | Add a method to the spam checker to filter the user directory results.
* Expose some homeserver functionality to spam checkers (#6259)Travis Ralston2019-10-311-1/+13
| | | | | | | | | | | | | | * Offer the homeserver instance to the spam checker * Newsfile * Linting * Expose a Spam Checker API instead of passing the homeserver object * Alter changelog * s/hs/api
* Run Black. (#5482)Amber Brown2019-06-201-1/+3
|
* Remove periods from copyright headers (#5046)Andrew Morgan2019-04-111-1/+1
|
* replace 'except:' with 'except Exception:'Richard van der Hoff2017-10-231-1/+1
| | | | what could possibly go wrong
* Spam checking: add the invitee to user_may_inviteDavid Baker2017-10-051-2/+2
|
* spam check room publishingDavid Baker2017-10-041-0/+18
|
* Add room creation checks to spam checkerDavid Baker2017-10-041-0/+32
| | | | | Lets the spam checker deny attempts to create rooms and add aliases to them.
* s/roomid/room_id/David Baker2017-10-031-2/+2
|
* pass room id tooDavid Baker2017-10-031-2/+2
|
* Actually write warpper functionDavid Baker2017-10-031-0/+16
|
* Don't test is spam_checker not NoneDavid Baker2017-09-271-1/+7
| | | | | Sometimes it's a Mock object which is not none but is still not what we're after
* Remove unintentional debuggingDavid Baker2017-09-271-1/+0
|
* pep8David Baker2017-09-271-0/+1
|
* Make the spam checker a moduleDavid Baker2017-09-261-17/+20
|
* fix thinko'd docstringMatthew Hodgson2017-09-221-1/+1
|
* PoC for filtering spammy events (#2456)Richard van der Hoff2017-09-191-0/+38
Demonstration of how you might add some hooks to filter out spammy events.