File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
code/function/fastapp/health Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1010
1111
1212async def verify_health_auth_header (
13- x_ms_auth_internal_token : Annotated [str , Header ()]
13+ x_ms_auth_internal_token : Annotated [str , Header ()] = ""
1414) -> bool :
1515 """Returns true if SHA256 of header_value matches WEBSITE_AUTH_ENCRYPTION_KEY.
1616 Documentation: https://learn.microsoft.com/en-us/azure/app-service/monitor-instances-health-check?tabs=python#authentication-and-security
@@ -22,8 +22,8 @@ async def verify_health_auth_header(
2222 logger .info (f"Encryption key: '{ settings .WEBSITE_AUTH_ENCRYPTION_KEY } '" )
2323 website_auth_encryption_key = settings .WEBSITE_AUTH_ENCRYPTION_KEY
2424 hash = base64 .b64encode (
25- sha256 (website_auth_encryption_key .encode (" utf-8" )).digest ()
26- ).decode (" utf-8" )
25+ sha256 (website_auth_encryption_key .encode (' utf-8' )).digest ()
26+ ).decode (' utf-8' )
2727 # if hash != x_ms_auth_internal_token:
2828 # raise HTTPException(
2929 # status_code=400, detail="x-ms-auth-internal-token is invalid"
You can’t perform that action at this time.
0 commit comments