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.
|