Skip to content

Commit 71bdd64

Browse files
committed
feat: add configuration for JWK URL (reanahub#741)
1 parent ecbf497 commit 71bdd64

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

reana_server/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ def _get_rate_limit(env_variable: str, default: str) -> str:
346346
OAUTHCLIENT_REMOTE_APPS["keycloak"] = KEYCLOAK_APP
347347
OAUTHCLIENT_REST_REMOTE_APPS["keycloak"] = KEYCLOAK_REST_APP
348348

349+
REANA_OAUTH_JWK_URL = PROVIDER_CONFIG.get("jwk_url", "")
350+
349351
# CERN SSO configuration
350352
OAUTH_REMOTE_REST_APP = copy.deepcopy(cern_openid.REMOTE_REST_APP)
351353
OAUTH_REMOTE_REST_APP.update(

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)