summary refs log tree commit diff
path: root/synapse/module_api/__init__.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2023-03-09 14:17:12 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2023-03-09 16:50:31 +0000
commit46c0ab559b3713a99c9ac6453243c16ee66b1a3b (patch)
tree9f978e116f10f84dc21b9b51ecf7e57383a2a3ea /synapse/module_api/__init__.py
parentMove callback-related code from the BackgroundUpdater to its own class (diff)
downloadsynapse-46c0ab559b3713a99c9ac6453243c16ee66b1a3b.tar.xz
Move callback-related code from the PasswordAuthProvider to its own class
Diffstat (limited to 'synapse/module_api/__init__.py')
-rw-r--r--synapse/module_api/__init__.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/synapse/module_api/__init__.py b/synapse/module_api/__init__.py

index cb09423cb3..7d34f621f4 100644 --- a/synapse/module_api/__init__.py +++ b/synapse/module_api/__init__.py
@@ -42,15 +42,7 @@ from synapse.events import EventBase from synapse.events.presence_router import PresenceRouter from synapse.events.spamcheck import SpamChecker from synapse.handlers.account_data import ON_ACCOUNT_DATA_UPDATED_CALLBACK -from synapse.handlers.auth import ( - CHECK_3PID_AUTH_CALLBACK, - CHECK_AUTH_CALLBACK, - GET_DISPLAYNAME_FOR_REGISTRATION_CALLBACK, - GET_USERNAME_FOR_REGISTRATION_CALLBACK, - IS_3PID_ALLOWED_CALLBACK, - ON_LOGGED_OUT_CALLBACK, - AuthHandler, -) +from synapse.handlers.auth import AuthHandler from synapse.handlers.device import DeviceHandler from synapse.handlers.push_rules import RuleSpec, check_actions from synapse.http.client import SimpleHttpClient @@ -79,6 +71,14 @@ from synapse.module_api.callbacks.background_updater_callbacks import ( MIN_BATCH_SIZE_CALLBACK, ON_UPDATE_CALLBACK, ) +from synapse.module_api.callbacks.password_auth_provider_callbacks import ( + CHECK_3PID_AUTH_CALLBACK, + CHECK_AUTH_CALLBACK, + GET_DISPLAYNAME_FOR_REGISTRATION_CALLBACK, + GET_USERNAME_FOR_REGISTRATION_CALLBACK, + IS_3PID_ALLOWED_CALLBACK, + ON_LOGGED_OUT_CALLBACK, +) from synapse.module_api.callbacks.presence_router_callbacks import ( GET_INTERESTED_USERS_CALLBACK, GET_USERS_FOR_STATES_CALLBACK, @@ -271,7 +271,6 @@ class ModuleApi: self._public_room_list_manager = PublicRoomListManager(hs) self._account_data_manager = AccountDataManager(hs) - self._password_auth_provider = hs.get_password_auth_provider() self._account_data_handler = hs.get_account_data_handler() ################################################################################# @@ -417,7 +416,7 @@ class ModuleApi: Added in Synapse v1.46.0. """ - return self._password_auth_provider.register_password_auth_provider_callbacks( + return self._callbacks.password_auth_provider.register_callbacks( check_3pid_auth=check_3pid_auth, on_logged_out=on_logged_out, is_3pid_allowed=is_3pid_allowed,