comment prints

merge-requests/1/merge
Ivan Maslov 2 years ago
parent 23b17e0d1f
commit d15cec2277

@ -116,10 +116,10 @@ def UserAccessCheckBefore(inMethod, inRequest):
lAuthToken = inRequest.OpenRPA["AuthToken"] lAuthToken = inRequest.OpenRPA["AuthToken"]
#go next if user is identified #go next if user is identified
lUserDict = None lUserDict = None
print(f"lAuthToken: {lAuthToken}") #print(f"lAuthToken: {lAuthToken}")
if lAuthToken: if lAuthToken:
lUserDict = gSettingsDict["ServerDict"]["AccessUsers"]["AuthTokensDict"][lAuthToken] lUserDict = gSettingsDict["ServerDict"]["AccessUsers"]["AuthTokensDict"][lAuthToken]
print(f"lUserDict: {lUserDict}") #print(f"lUserDict: {lUserDict}")
#pdb.set_trace() #pdb.set_trace()
######################################## ########################################
######################################## ########################################
@ -513,7 +513,7 @@ def IdentifyAuthorize(inRequest:Request, inResponse:Response,
inCookiesStr: Union[str, None] = Header(default=None,alias="Cookie"), inCookiesStr: Union[str, None] = Header(default=None,alias="Cookie"),
inAuthorizationStr: Union[str, None] = Header(default="",alias="Authorization")): inAuthorizationStr: Union[str, None] = Header(default="",alias="Authorization")):
lResult={"Domain": "", "User": ""} lResult={"Domain": "", "User": ""}
print("IdentifyAuthorize") #print("IdentifyAuthorize")
###################################### ######################################
#Way 1 - try to find AuthToken #Way 1 - try to find AuthToken
lCookies = cookies.SimpleCookie(inCookiesStr) # inRequest.headers.get("Cookie", "") lCookies = cookies.SimpleCookie(inCookiesStr) # inRequest.headers.get("Cookie", "")
@ -576,7 +576,7 @@ def IdentifyAuthorize(inRequest:Request, inResponse:Response,
def BackwardCompatibityWrapperAuth(inRequest:Request, inResponse:Response, inBodyStr:str = Body(""), def BackwardCompatibityWrapperAuth(inRequest:Request, inResponse:Response, inBodyStr:str = Body(""),
inAuthDict:dict=Depends(IdentifyAuthorize)): # Old from v1.3.1 (updated to FastAPI) inAuthDict:dict=Depends(IdentifyAuthorize)): # Old from v1.3.1 (updated to FastAPI)
print(f"{inRequest.url.path}, inAuthDict:{inAuthDict}") #print(f"{inRequest.url.path}, inAuthDict:{inAuthDict}")
lHTTPRequest = HTTPRequestOld(inRequest=inRequest, inResponse=inResponse, inAuthDict=inAuthDict) lHTTPRequest = HTTPRequestOld(inRequest=inRequest, inResponse=inResponse, inAuthDict=inAuthDict)
lHTTPRequest.path = inRequest.url.path lHTTPRequest.path = inRequest.url.path
lHTTPRequest.body = inBodyStr lHTTPRequest.body = inBodyStr
@ -590,7 +590,7 @@ def BackwardCompatibityWrapperAuth(inRequest:Request, inResponse:Response, inBod
return StreamingResponse(io.BytesIO(lResult), media_type=lHTTPRequest.OpenRPAResponseDict["Headers"]["Content-type"]) return StreamingResponse(io.BytesIO(lResult), media_type=lHTTPRequest.OpenRPAResponseDict["Headers"]["Content-type"])
def BackwardCompatibityWrapperNoAuth(inRequest:Request, inResponse:Response, inBodyStr:str = Body("")): # Old from v1.3.1 (updated to FastAPI) def BackwardCompatibityWrapperNoAuth(inRequest:Request, inResponse:Response, inBodyStr:str = Body("")): # Old from v1.3.1 (updated to FastAPI)
print(f"{inRequest.url.path}, BackwardCompatibityWrapperNoAuth") #print(f"{inRequest.url.path}, BackwardCompatibityWrapperNoAuth")
lHTTPRequest = HTTPRequestOld(inRequest=inRequest, inResponse=inResponse, inAuthDict=None) lHTTPRequest = HTTPRequestOld(inRequest=inRequest, inResponse=inResponse, inAuthDict=None)
lHTTPRequest.path = inRequest.url.path lHTTPRequest.path = inRequest.url.path
lHTTPRequest.body = inBodyStr lHTTPRequest.body = inBodyStr

Loading…
Cancel
Save