deepsync commited on
Commit
330ff40
·
verified ·
1 Parent(s): 38975d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -9,10 +9,9 @@ from google.oauth2 import service_account
9
 
10
 
11
  def get_token(function_url):
12
- with open("cf_key.json", "w") as f:
13
- json.dump(json.loads(os.environ.get("CF_KEY")), f, ensure_ascii=False, indent=2)
14
- credentials = service_account.IDTokenCredentials.from_service_account_file(
15
- "cf_key.json", target_audience=function_url
16
  )
17
  if credentials.valid is False:
18
  credentials.refresh(Request())
 
9
 
10
 
11
  def get_token(function_url):
12
+ cf_key = json.loads(os.environ.get("CF_KEY"))
13
+ credentials = service_account.IDTokenCredentials.from_service_account_info(
14
+ cf_key, target_audience=function_url
 
15
  )
16
  if credentials.valid is False:
17
  credentials.refresh(Request())