Update app.py
Browse files
app.py
CHANGED
@@ -9,10 +9,9 @@ from google.oauth2 import service_account
|
|
9 |
|
10 |
|
11 |
def get_token(function_url):
|
12 |
-
|
13 |
-
|
14 |
-
|
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())
|