Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 6a7cc42

Browse files
committed
Fix mypy errors
1 parent b9ad022 commit 6a7cc42

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

swift_upload_runner/auth.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,19 @@
1313
)
1414

1515

16-
AiohttpHandler = typing.Callable[[aiohttp.web.Request], aiohttp.web.Response]
16+
AiohttpHandler = typing.Callable[
17+
[aiohttp.web.Request],
18+
typing.Coroutine[
19+
typing.Awaitable,
20+
typing.Any,
21+
aiohttp.web.Response
22+
]
23+
]
1724

1825

1926
async def handle_login(
2027
request: aiohttp.web.Request
21-
) -> aiohttp.web.Request:
28+
) -> aiohttp.web.StreamResponse:
2229
"""Begin a new session for the upload process."""
2330
session_key = hashlib.sha1(os.urandom(128)).hexdigest() # nosec
2431

@@ -71,7 +78,7 @@ async def test_signature(
7178
digestmod="sha256"
7279
).hexdigest()
7380
if digest == signature:
74-
return
81+
return True
7582
raise aiohttp.web.HTTPUnauthorized(
7683
reason="Missing valid query signature"
7784
)

swift_upload_runner/middleware.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55

66
import aiohttp.web
77

8-
AiohttpHandler = typing.Callable[[aiohttp.web.Request], aiohttp.web.Response]
8+
9+
AiohttpHandler = typing.Callable[
10+
[aiohttp.web.Request],
11+
typing.Coroutine[
12+
typing.Awaitable,
13+
typing.Any,
14+
aiohttp.web.Response
15+
]
16+
]
917

1018

1119
@aiohttp.web.middleware

0 commit comments

Comments
 (0)