Skip to content

Commit c0e4ab3

Browse files
committed
feat: add configuration for JWK URL (reanahub#741)
1 parent 0ac0ff7 commit c0e4ab3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

reana_server/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _get_rate_limit(env_variable: str, default: str) -> str:
350350
OAUTHCLIENT_REMOTE_APPS["keycloak"] = KEYCLOAK_APP
351351
OAUTHCLIENT_REST_REMOTE_APPS["keycloak"] = KEYCLOAK_REST_APP
352352

353-
REANA_OAUTH_JWK_URL = PROVIDER_CONFIG["jwk_url"]
353+
REANA_OAUTH_JWK_URL = PROVIDER_CONFIG.get("jwk_url", "")
354354
REANA_OAUTH_USERINFO_URL = PROVIDER_CONFIG["userinfo_url"]
355355

356356
# CERN SSO configuration

reana_server/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
REANA_QUOTAS_DOCS_URL,
7676
WORKSPACE_RETENTION_PERIOD,
7777
DEFAULT_WORKSPACE_RETENTION_RULE,
78+
REANA_OAUTH_JWK_URL,
7879
)
7980
from reana_server.gitlab_client import (
8081
GitLabClient,
@@ -682,7 +683,7 @@ def fetch_and_parse_jwk():
682683
fetch_and_parse_jwk._cache = None
683684

684685
if not fetch_and_parse_jwk._cache:
685-
response = requests.get("https://iam-escape.cloud.cnaf.infn.it/jwk")
686+
response = requests.get(REANA_OAUTH_JWK_URL)
686687
if response.status_code != 200:
687688
raise ValueError(f"Failed to fetch JWK: {response.status_code}")
688689
fetch_and_parse_jwk._cache = response.json()

0 commit comments

Comments
 (0)