mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-06 14:44:11 -04:00
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`.
This commit is contained in:
parent
ccf1dc51d7
commit
847ecdd8fa
5 changed files with 67 additions and 6 deletions
|
@ -198,8 +198,7 @@ class RegistrationHandler(BaseHandler):
|
|||
admin api, otherwise False.
|
||||
user_agent_ips: Tuples of IP addresses and user-agents used
|
||||
during the registration process.
|
||||
auth_provider_id: The SSO IdP the user used, if any (just used for the
|
||||
prometheus metrics).
|
||||
auth_provider_id: The SSO IdP the user used, if any.
|
||||
Returns:
|
||||
The registered user_id.
|
||||
Raises:
|
||||
|
@ -211,6 +210,7 @@ class RegistrationHandler(BaseHandler):
|
|||
threepid,
|
||||
localpart,
|
||||
user_agent_ips or [],
|
||||
auth_provider_id=auth_provider_id,
|
||||
)
|
||||
|
||||
if result == RegistrationBehaviour.DENY:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue