File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import json
22import logging
3+ import os
34from io import StringIO
45
56import azure .functions as func
@@ -72,13 +73,13 @@ def validate_jwt(token: str, audience: str) -> bool:
7273 return False
7374
7475
75- @app .route (route = "upload_csv" , auth_level = func .AuthLevel .FUNCTION )
76+ @app .route (route = "upload_csv" , auth_level = func .AuthLevel .ANONYMOUS )
7677@app .blob_output (arg_name = "outbound" , path = "hvalfangstcontainer/in/input.csv" , connection = "AzureWebJobsStorage" )
7778def upload_csv (req : func .HttpRequest , outbound : func .Out [str ]) -> str :
7879 try :
7980
8081 token = req .headers .get ("Authorization" ).split (" " )[1 ] # Extract Bearer token
81- if not validate_jwt (token , audience = "61b4a548-3979-48df-b2df-37dc4e5e0e02" ):
82+ if not validate_jwt (token , audience = os . environ . get ( "FUNCTION_APP_CLIENT_ID" ) ):
8283 return func .HttpResponse ("Unauthorized" , status_code = 401 )
8384
8485 logging .info ("Received HTTP request to upload CSV" )
You can’t perform that action at this time.
0 commit comments