You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get a JWT Authorization token suitable to call Ganymede gRPC API.
30
31
We either use 'AUTH0_TOKEN' environment variable (if present) to create a bearer token from it.
31
-
Or 'CLIENT_ID' and 'CLIENT_SECRET' environment variables (optionally 'AUDIENCE' can override DEFAULT_AUDIENCE, and 'TENANT' can override DEFAULT_TENANT).
32
+
Or 'CLIENT_ID' and 'CLIENT_SECRET' environment variables (optionally 'AUDIENCE' can override DEFAULT_AUDIENCE, and 'TENANT' can override DEFAULT_TENANT).
33
+
Optionally a 'PUBLIC_CA_BUNDLE' environment variable can be provided to set a specific certificate store.
32
34
Returns:
33
35
A JWT Authorization token suitable to call Ganymede gRPC API.
34
36
"""
@@ -37,6 +39,7 @@ def get_token() -> str:
37
39
client_secret=os.getenv("CLIENT_SECRET","")
38
40
audience=os.getenv("AUDIENCE","")
39
41
tenant=os.getenv("TENANT","")
42
+
public_ca_bundle=os.getenv("PUBLIC_CA_BUNDLE","")
40
43
41
44
# If we have AUTH0_TOKEN, generate a bearer token
42
45
if(auth0_token!=""):
@@ -48,11 +51,22 @@ def get_token() -> str:
48
51
client_id,
49
52
client_secret,
50
53
audienceifaudienceelseDEFAULT_AUDIENCE,
51
-
tenantiftenantelseDEFAULT_TENANT)
54
+
tenantiftenantelseDEFAULT_TENANT,
55
+
public_ca_bundle)
52
56
else:
53
57
raiseException(f"AUTH0_TOKEN environment variable is not set, therefore CLIENT_ID and CLIENT_SECRET (and optionally AUDIENCE and TENANT) environment variables must be set")
0 commit comments