summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorSean Quah <seanq@element.io>2021-10-26 14:32:17 +0100
committerSean Quah <seanq@element.io>2021-10-26 14:32:17 +0100
commitd8c1a2149262ded099e24d74856a33405ceca3a0 (patch)
tree38439de5e9baba953606e6518f1ba227b7ec4955 /synapse/server.py
parentMerge branch 'release-v1.45' of github.com:matrix-org/synapse into matrix-org... (diff)
parentMove #10975 to bugfix section in changelog (diff)
downloadsynapse-d8c1a2149262ded099e24d74856a33405ceca3a0.tar.xz
Merge branch 'release-v1.46' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/synapse/server.py b/synapse/server.py

index 5bc045d615..0fbf36ba99 100644 --- a/synapse/server.py +++ b/synapse/server.py
@@ -65,7 +65,7 @@ from synapse.handlers.account_data import AccountDataHandler from synapse.handlers.account_validity import AccountValidityHandler from synapse.handlers.admin import AdminHandler from synapse.handlers.appservice import ApplicationServicesHandler -from synapse.handlers.auth import AuthHandler, MacaroonGenerator +from synapse.handlers.auth import AuthHandler, MacaroonGenerator, PasswordAuthProvider from synapse.handlers.cas import CasHandler from synapse.handlers.deactivate_account import DeactivateAccountHandler from synapse.handlers.device import DeviceHandler, DeviceWorkerHandler @@ -688,6 +688,10 @@ class HomeServer(metaclass=abc.ABCMeta): return ThirdPartyEventRules(self) @cache_in_self + def get_password_auth_provider(self) -> PasswordAuthProvider: + return PasswordAuthProvider() + + @cache_in_self def get_room_member_handler(self) -> RoomMemberHandler: if self.config.worker.worker_app: return RoomMemberWorkerHandler(self) @@ -796,9 +800,14 @@ class HomeServer(metaclass=abc.ABCMeta): return ExternalCache(self) @cache_in_self - def get_outbound_redis_connection(self) -> Optional["RedisProtocol"]: - if not self.config.redis.redis_enabled: - return None + def get_outbound_redis_connection(self) -> "RedisProtocol": + """ + The Redis connection used for replication. + + Raises: + AssertionError: if Redis is not enabled in the homeserver config. + """ + assert self.config.redis.redis_enabled # We only want to import redis module if we're using it, as we have # `txredisapi` as an optional dependency.