summary refs log tree commit diff
path: root/synapse/api/auth_blocking.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--synapse/api/auth_blocking.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/synapse/api/auth_blocking.py b/synapse/api/auth_blocking.py

index 303c9ba03e..a56ffd58e4 100644 --- a/synapse/api/auth_blocking.py +++ b/synapse/api/auth_blocking.py
@@ -24,7 +24,6 @@ from typing import TYPE_CHECKING, Optional from synapse.api.constants import LimitBlockingTypes, UserTypes from synapse.api.errors import Codes, ResourceLimitError -from synapse.config.server import is_threepid_reserved from synapse.types import Requester if TYPE_CHECKING: @@ -43,16 +42,13 @@ class AuthBlocking: self._admin_contact = hs.config.server.admin_contact self._max_mau_value = hs.config.server.max_mau_value self._limit_usage_by_mau = hs.config.server.limit_usage_by_mau - self._mau_limits_reserved_threepids = ( - hs.config.server.mau_limits_reserved_threepids - ) self._is_mine_server_name = hs.is_mine_server_name self._track_appservice_user_ips = hs.config.appservice.track_appservice_user_ips async def check_auth_blocking( self, user_id: Optional[str] = None, - threepid: Optional[dict] = None, + threepid: Optional[str] = None, # Not used in this method, but kept for compatibility user_type: Optional[str] = None, requester: Optional[Requester] = None, ) -> None: @@ -63,12 +59,6 @@ class AuthBlocking: user_id: If present, checks for presence against existing MAU cohort - threepid: If present, checks for presence against configured - reserved threepid. Used in cases where the user is trying register - with a MAU blocked server, normally they would be rejected but their - threepid is on the reserved list. user_id and - threepid should never be set at the same time. - user_type: If present, is used to decide whether to check against certain blocking reasons like MAU. @@ -111,9 +101,8 @@ class AuthBlocking: admin_contact=self._admin_contact, limit_type=LimitBlockingTypes.HS_DISABLED, ) - if self._limit_usage_by_mau is True: - assert not (user_id and threepid) + if self._limit_usage_by_mau is True: # If the user is already part of the MAU cohort or a trial user if user_id: timestamp = await self.store.user_last_seen_monthly_active(user_id) @@ -123,11 +112,6 @@ class AuthBlocking: is_trial = await self.store.is_trial_user(user_id) if is_trial: return - elif threepid: - # If the user does not exist yet, but is signing up with a - # reserved threepid then pass auth check - if is_threepid_reserved(self._mau_limits_reserved_threepids, threepid): - return elif user_type == UserTypes.SUPPORT: # If the user does not exist yet and is of type "support", # allow registration. Support users are excluded from MAU checks.