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 10
10
11
11
12
12
async def verify_health_auth_header (
13
- x_ms_auth_internal_token : Annotated [str , Header ()]
13
+ x_ms_auth_internal_token : Annotated [str , Header ()] = ""
14
14
) -> bool :
15
15
"""Returns true if SHA256 of header_value matches WEBSITE_AUTH_ENCRYPTION_KEY.
16
16
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(
22
22
logger .info (f"Encryption key: '{ settings .WEBSITE_AUTH_ENCRYPTION_KEY } '" )
23
23
website_auth_encryption_key = settings .WEBSITE_AUTH_ENCRYPTION_KEY
24
24
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' )
27
27
# if hash != x_ms_auth_internal_token:
28
28
# raise HTTPException(
29
29
# status_code=400, detail="x-ms-auth-internal-token is invalid"
You can’t perform that action at this time.
0 commit comments