Skip to content

Commit b3dbba4

Browse files
committed
Fix backend tests
1 parent b722785 commit b3dbba4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

api/PclusterApiHandler.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,17 @@
6363
if not JWKS_URL:
6464
JWKS_URL = os.getenv("JWKS_URL",
6565
f"https://cognito-idp.{REGION}.amazonaws.com/{USER_POOL_ID}/" ".well-known/jwks.json")
66-
API_BASE_URL_MAPPING = {}
6766

68-
for url in API_BASE_URL.split(","):
69-
if url:
70-
pair=url.split("=")
71-
API_BASE_URL_MAPPING[pair[0]] = pair[1]
7267

68+
def create_api_base_url_mapping(base):
69+
result = {}
70+
for url in base.split(","):
71+
if url:
72+
pair=url.split("=")
73+
result[pair[0]] = pair[1]
74+
return result
7375

76+
API_BASE_URL_MAPPING = create_api_base_url_mapping(API_BASE_URL)
7477

7578
def jwt_decode(token, audience=None, access_token=None):
7679
return jwt.decode(

0 commit comments

Comments
 (0)