mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:46:02 -04:00
Combine SpamCheckerApi
with the more generic ModuleApi
. (#8464)
Lots of different module apis is not easy to maintain. Rather than adding yet another ModuleApi(hs, hs.get_auth_handler()) incantation, first add an hs.get_module_api() method and use it where possible.
This commit is contained in:
parent
01f82bfe32
commit
4f0637346a
10 changed files with 51 additions and 58 deletions
|
@ -164,7 +164,14 @@ class AuthHandler(BaseHandler):
|
|||
|
||||
self.bcrypt_rounds = hs.config.bcrypt_rounds
|
||||
|
||||
# we can't use hs.get_module_api() here, because to do so will create an
|
||||
# import loop.
|
||||
#
|
||||
# TODO: refactor this class to separate the lower-level stuff that
|
||||
# ModuleApi can use from the higher-level stuff that uses ModuleApi, as
|
||||
# better way to break the loop
|
||||
account_handler = ModuleApi(hs, self)
|
||||
|
||||
self.password_providers = [
|
||||
module(config=config, account_handler=account_handler)
|
||||
for module, config in hs.config.password_providers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue