From 4ec2eda89a9b8ac003a3fb36348535acaa67b253 Mon Sep 17 00:00:00 2001 From: Giovanni Savarese Date: Wed, 17 Jul 2024 11:24:20 +0000 Subject: [PATCH] feat: add env var to specify git url for the json schema --- fed_mng/config.py | 2 ++ fed_mng/socketio/site_admin.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fed_mng/config.py b/fed_mng/config.py index 683c94d..987aaea 100644 --- a/fed_mng/config.py +++ b/fed_mng/config.py @@ -50,6 +50,8 @@ def create_doc_url(cls, v: str | None, values: dict[str, Any]) -> str: OPA_URL: AnyHttpUrl = "http://localhost:8181" ROLES_ENDPOINT: str = "v1/data/fedmgr/user_roles" + NEW_PROV_FORM_JSON_SCHEMA_URL: AnyHttpUrl = "" + class Config: """Sub class to set attribute as case sensitive.""" diff --git a/fed_mng/socketio/site_admin.py b/fed_mng/socketio/site_admin.py index b1b12ad..b6d45bf 100644 --- a/fed_mng/socketio/site_admin.py +++ b/fed_mng/socketio/site_admin.py @@ -3,6 +3,7 @@ import requests from socketio import AsyncNamespace +from fed_mng.config import get_settings from fed_mng.socketio.utils import validate_auth_on_connect @@ -79,9 +80,8 @@ async def on_delete_federated_provider(self, sid, data): async def on_get_form(self, id): """Send a dict with the details to use to submit a new provider request.""" - resp = requests.get( - "https://raw.githubusercontent.com/infn-datacloud/federation-registry-feeder/main/json-config-schemas/provider-config-schema.json" - ) + settings = get_settings() + resp = requests.get(settings.NEW_PROV_FORM_JSON_SCHEMA_URL) idp_data = self._resolve_defs( resp.json()["properties"].pop("trusted_idps"), resp.json()["$defs"] )