diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-04-15 12:40:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 12:40:18 -0400 |
commit | eed7c5b89eee6951ac17861b1695817470bace36 (patch) | |
tree | 755c120c53df6f00dcdf75d2a8b00c3fdc705eb9 /tests/utils.py | |
parent | Add notes to the changelog about an additional SSO template. (#7259) (diff) | |
download | synapse-eed7c5b89eee6951ac17861b1695817470bace36.tar.xz |
Convert auth handler to async/await (#7261)
Diffstat (limited to '')
-rw-r--r-- | tests/utils.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/utils.py b/tests/utils.py index 968d109f77..2079e0143d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -332,10 +332,15 @@ def setup_test_homeserver( # Need to let the HS build an auth handler and then mess with it # because AuthHandler's constructor requires the HS, so we can't make one # beforehand and pass it in to the HS's constructor (chicken / egg) - hs.get_auth_handler().hash = lambda p: hashlib.md5(p.encode("utf8")).hexdigest() - hs.get_auth_handler().validate_hash = ( - lambda p, h: hashlib.md5(p.encode("utf8")).hexdigest() == h - ) + async def hash(p): + return hashlib.md5(p.encode("utf8")).hexdigest() + + hs.get_auth_handler().hash = hash + + async def validate_hash(p, h): + return hashlib.md5(p.encode("utf8")).hexdigest() == h + + hs.get_auth_handler().validate_hash = validate_hash fed = kargs.get("resource_for_federation", None) if fed: |