Decouple synapse.api.auth_blocking.AuthBlocking from synapse.api.auth.Auth. (#13021)

This commit is contained in:
Quentin Gliech 2022-06-14 10:51:15 +02:00 committed by GitHub
parent a164a46038
commit 92103cb2c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 63 additions and 50 deletions

View file

@ -199,6 +199,7 @@ class AuthHandler:
def __init__(self, hs: "HomeServer"):
self.store = hs.get_datastores().main
self.auth = hs.get_auth()
self.auth_blocking = hs.get_auth_blocking()
self.clock = hs.get_clock()
self.checkers: Dict[str, UserInteractiveAuthChecker] = {}
for auth_checker_class in INTERACTIVE_AUTH_CHECKERS:
@ -985,7 +986,7 @@ class AuthHandler:
not is_appservice_ghost
or self.hs.config.appservice.track_appservice_user_ips
):
await self.auth.check_auth_blocking(user_id)
await self.auth_blocking.check_auth_blocking(user_id)
access_token = self.generate_access_token(target_user_id_obj)
await self.store.add_access_token_to_user(
@ -1439,7 +1440,7 @@ class AuthHandler:
except Exception:
raise AuthError(403, "Invalid login token", errcode=Codes.FORBIDDEN)
await self.auth.check_auth_blocking(res.user_id)
await self.auth_blocking.check_auth_blocking(res.user_id)
return res
async def delete_access_token(self, access_token: str) -> None: