File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
cads_processing_api_service Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,16 @@ def get_auth_header(
51
51
tuple[str | None, str | None]
52
52
Authentication header.
53
53
"""
54
+ auth_header : tuple [str | None , str | None ] = (None , None )
54
55
if pat :
55
56
auth_header = ("PRIVATE-TOKEN" , pat )
56
57
elif jwt :
57
58
auth_header = ("Authorization" , jwt )
58
- else :
59
- auth_header = (None , None )
60
59
return auth_header
61
60
62
61
63
62
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
65
64
) -> dict [str , str ]:
66
65
verification_endpoint = VERIFICATION_ENDPOINT [auth_header [0 ]]
67
66
request_url = urllib .parse .urljoin (SETTINGS .profiles_api_url , verification_endpoint )
@@ -118,7 +117,7 @@ def get_user_info(
118
117
registered/authorized user.
119
118
"""
120
119
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
122
121
else :
123
122
user_info = {"sub" : "unauthenticated" }
124
123
user_uid : str = user_info ["sub" ]
You can’t perform that action at this time.
0 commit comments