summary refs log tree commit diff
path: root/docs/spam_checker.md
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2021-03-16 12:41:41 +0000
committerGitHub <noreply@github.com>2021-03-16 12:41:41 +0000
commit847ecdd8fafe4af3e073449202a6b2fcc47df622 (patch)
treec6766c09ccd10e61f55d79a01730953e9cfc0332 /docs/spam_checker.md
parentInstall jemalloc in docker image (#8553) (diff)
downloadsynapse-847ecdd8fafe4af3e073449202a6b2fcc47df622.tar.xz
Pass SSO IdP information to spam checker's registration function (#9626)
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`.
Diffstat (limited to 'docs/spam_checker.md')
-rw-r--r--docs/spam_checker.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/spam_checker.md b/docs/spam_checker.md
index 2020eb9006..52947f605e 100644
--- a/docs/spam_checker.md
+++ b/docs/spam_checker.md
@@ -69,7 +69,13 @@ class ExampleSpamChecker:
     async def check_username_for_spam(self, user_profile):
         return False  # allow all usernames
 
-    async def check_registration_for_spam(self, email_threepid, username, request_info):
+    async def check_registration_for_spam(
+        self,
+        email_threepid,
+        username,
+        request_info,
+        auth_provider_id,
+    ):
         return RegistrationBehaviour.ALLOW  # allow all registrations
 
     async def check_media_file_for_spam(self, file_wrapper, file_info):