File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 11from datetime import datetime , timezone
22import hashlib
3+ import traceback
34from typing import Tuple
45import urllib .parse
56
@@ -50,14 +51,17 @@ def get_access_token(headers: Headers) -> Tuple[str, str]:
5051 logger .error (err_msg )
5152 raise HTTPException (HTTP_401_UNAUTHORIZED , err_msg )
5253 try :
54+ logger .info (f"DEBUG: auth_header = { auth_header } " )
5355 if "Credential=" in auth_header : # format 1 (see docstring)
5456 access_key_id = auth_header .split ("Credential=" )[1 ].split ("/" )[0 ]
57+ user_id = None
5558 else : # format 2 (see docstring)
5659 access_key_id = auth_header .split ("AWS " )[1 ]
5760 access_key_id = ":" .join (access_key_id .split (":" )[:- 1 ])
58- access_token , user_id = access_key_id .split (";userId=" )
61+ access_token , user_id = access_key_id .split (";userId=" )
5962 return access_token , user_id
6063 except Exception as e :
64+ traceback .print_exc ()
6165 logger .error (
6266 f"Unexpected format; unable to extract access token from authorization header: { e } "
6367 )
You can’t perform that action at this time.
0 commit comments