From b161c4c88c4cee531b6e3773cb61d2fceeaf661b Mon Sep 17 00:00:00 2001 From: timotheyca Date: Wed, 22 Dec 2021 19:37:32 +0300 Subject: [PATCH] bug fix --- v6d0auth/app.py | 2 ++ v6d0auth/cdb.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/v6d0auth/app.py b/v6d0auth/app.py index c73b6ab..55c8b99 100644 --- a/v6d0auth/app.py +++ b/v6d0auth/app.py @@ -33,6 +33,7 @@ class V6D0AuthAppFactory(AppFactory): assert hnonce == nonce.hex() approved = self.cdb.approve(bytes.fromhex(hhandle)) await ws.send_bytes(approved) + await ws.close() @routes.get('/approve') async def approve(request: web.Request): @@ -96,6 +97,7 @@ class V6D0AuthAppFactory(AppFactory): assert hnonce == nonce.hex() self.cdb.remove_role(Role(VerifyKey(bytes.fromhex(hrequester)), role)) await ws.send_bytes(b'0') + await ws.close() @routes.get('/remove_role') async def remove_role(request: web.Request): diff --git a/v6d0auth/cdb.py b/v6d0auth/cdb.py index 218649c..4badca1 100644 --- a/v6d0auth/cdb.py +++ b/v6d0auth/cdb.py @@ -29,7 +29,7 @@ class AbstractRequest: self.future: asyncio.Future[bytes] = self._loop.create_future() def __le__(self, other): - if isinstance(other, SignatureRequest): + if isinstance(other, AbstractRequest): return self.timeout < other.timeout else: return NotImplemented