Skip to content

Commit

Permalink
feat: add env var to specify git url for the json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
giosava94 committed Jul 17, 2024
1 parent e652b41 commit 4ec2eda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions fed_mng/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
6 changes: 3 additions & 3 deletions fed_mng/socketio/site_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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"]
)
Expand Down

0 comments on commit 4ec2eda

Please sign in to comment.