Skip to content

Commit 819427d

Browse files
committed
fix types
1 parent 38de282 commit 819427d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cads_processing_api_service/auth.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ def get_auth_header(
5151
tuple[str | None, str | None]
5252
Authentication header.
5353
"""
54+
auth_header: tuple[str | None, str | None] = (None, None)
5455
if pat:
5556
auth_header = ("PRIVATE-TOKEN", pat)
5657
elif jwt:
5758
auth_header = ("Authorization", jwt)
58-
else:
59-
auth_header = (None, None)
6059
return auth_header
6160

6261

6362
def authenticate_user(
64-
auth_header: tuple[str, str], portal_header: str | None = None
63+
auth_header: tuple[str, str | None], portal_header: str | None = None
6564
) -> dict[str, str]:
6665
verification_endpoint = VERIFICATION_ENDPOINT[auth_header[0]]
6766
request_url = urllib.parse.urljoin(SETTINGS.profiles_api_url, verification_endpoint)
@@ -118,7 +117,7 @@ def get_user_info(
118117
registered/authorized user.
119118
"""
120119
if auth_header[0] is not None:
121-
user_info = authenticate_user(auth_header, portal_header)
120+
user_info = authenticate_user(auth_header, portal_header) # type: ignore
122121
else:
123122
user_info = {"sub": "unauthenticated"}
124123
user_uid: str = user_info["sub"]

0 commit comments

Comments
 (0)