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

Commit c1510c9

Browse files
authored
Fix cyclic import in the module API (#11180)
Introduced in #10548 See https://github.com/matrix-org/synapse-email-account-validity/runs/3979337154?check_suite_focus=true for an example of a module's CI choking over this issue.
1 parent 4387b79 commit c1510c9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

changelog.d/11180.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Port the Password Auth Providers module interface to the new generic interface.

synapse/handlers/auth.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
from synapse.http.site import SynapseRequest
6363
from synapse.logging.context import defer_to_thread
6464
from synapse.metrics.background_process_metrics import run_as_background_process
65-
from synapse.module_api import ModuleApi
6665
from synapse.storage.roommember import ProfileInfo
6766
from synapse.types import JsonDict, Requester, UserID
6867
from synapse.util import stringutils as stringutils
@@ -73,6 +72,7 @@
7372
from synapse.util.threepids import canonicalise_email
7473

7574
if TYPE_CHECKING:
75+
from synapse.module_api import ModuleApi
7676
from synapse.rest.client.login import LoginResponse
7777
from synapse.server import HomeServer
7878

@@ -1818,7 +1818,9 @@ def load_legacy_password_auth_providers(hs: "HomeServer") -> None:
18181818

18191819

18201820
def load_single_legacy_password_auth_provider(
1821-
module: Type, config: JsonDict, api: ModuleApi
1821+
module: Type,
1822+
config: JsonDict,
1823+
api: "ModuleApi",
18221824
) -> None:
18231825
try:
18241826
provider = module(config=config, account_handler=api)

0 commit comments

Comments
 (0)