Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 85fc7ea

Browse files
authored
Remove the complete_sso_login method from the Module API which was deprecated in Synapse 1.13.0. (#13843)
Signed-off-by: Quentin Gliech <[email protected]>
1 parent fff9b95 commit 85fc7ea

File tree

3 files changed

+2
-58
lines changed

3 files changed

+2
-58
lines changed

changelog.d/13843.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove the `complete_sso_login` method from the Module API which was deprecated in Synapse 1.13.0.

synapse/handlers/auth.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
from synapse.http.site import SynapseRequest
6464
from synapse.logging.context import defer_to_thread
6565
from synapse.metrics.background_process_metrics import run_as_background_process
66-
from synapse.storage.roommember import ProfileInfo
6766
from synapse.types import JsonDict, Requester, UserID
6867
from synapse.util import stringutils as stringutils
6968
from synapse.util.async_helpers import delay_cancellation, maybe_awaitable
@@ -1687,41 +1686,10 @@ async def complete_sso_login(
16871686
respond_with_html(request, 403, self._sso_account_deactivated_template)
16881687
return
16891688

1690-
profile = await self.store.get_profileinfo(
1689+
user_profile_data = await self.store.get_profileinfo(
16911690
UserID.from_string(registered_user_id).localpart
16921691
)
16931692

1694-
self._complete_sso_login(
1695-
registered_user_id,
1696-
auth_provider_id,
1697-
request,
1698-
client_redirect_url,
1699-
extra_attributes,
1700-
new_user=new_user,
1701-
user_profile_data=profile,
1702-
auth_provider_session_id=auth_provider_session_id,
1703-
)
1704-
1705-
def _complete_sso_login(
1706-
self,
1707-
registered_user_id: str,
1708-
auth_provider_id: str,
1709-
request: Request,
1710-
client_redirect_url: str,
1711-
extra_attributes: Optional[JsonDict] = None,
1712-
new_user: bool = False,
1713-
user_profile_data: Optional[ProfileInfo] = None,
1714-
auth_provider_session_id: Optional[str] = None,
1715-
) -> None:
1716-
"""
1717-
The synchronous portion of complete_sso_login.
1718-
1719-
This exists purely for backwards compatibility of synapse.module_api.ModuleApi.
1720-
"""
1721-
1722-
if user_profile_data is None:
1723-
user_profile_data = ProfileInfo(None, None)
1724-
17251693
# Store any extra attributes which will be passed in the login response.
17261694
# Note that this is per-user so it may overwrite a previous value, this
17271695
# is considered OK since the newest SSO attributes should be most valid.

synapse/module_api/__init__.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -836,31 +836,6 @@ def run_db_interaction(
836836
self._store.db_pool.runInteraction(desc, func, *args, **kwargs) # type: ignore[arg-type]
837837
)
838838

839-
def complete_sso_login(
840-
self, registered_user_id: str, request: SynapseRequest, client_redirect_url: str
841-
) -> None:
842-
"""Complete a SSO login by redirecting the user to a page to confirm whether they
843-
want their access token sent to `client_redirect_url`, or redirect them to that
844-
URL with a token directly if the URL matches with one of the whitelisted clients.
845-
846-
This is deprecated in favor of complete_sso_login_async.
847-
848-
Added in Synapse v1.11.1.
849-
850-
Args:
851-
registered_user_id: The MXID that has been registered as a previous step of
852-
of this SSO login.
853-
request: The request to respond to.
854-
client_redirect_url: The URL to which to offer to redirect the user (or to
855-
redirect them directly if whitelisted).
856-
"""
857-
self._auth_handler._complete_sso_login(
858-
registered_user_id,
859-
"<unknown>",
860-
request,
861-
client_redirect_url,
862-
)
863-
864839
async def complete_sso_login_async(
865840
self,
866841
registered_user_id: str,

0 commit comments

Comments
 (0)