From 03dbb9c933d41e4973065594b32c3ca93071ae9f Mon Sep 17 00:00:00 2001 From: pietrodematteis <146813010+pietrodematteis@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:38:50 +0100 Subject: [PATCH] Schema for authn_request ui_locales is not correct #303 --- spid_cie_oidc/provider/schemas/authn_requests.py | 4 ++-- spid_cie_oidc/provider/tests/authn_request_settings.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spid_cie_oidc/provider/schemas/authn_requests.py b/spid_cie_oidc/provider/schemas/authn_requests.py index f425c4e5..b5564e90 100644 --- a/spid_cie_oidc/provider/schemas/authn_requests.py +++ b/spid_cie_oidc/provider/schemas/authn_requests.py @@ -133,7 +133,7 @@ class AuthenticationRequest(BaseModel): claims: Optional[dict] state: constr(min_length=32) # TODO: to be improved - ui_locales: Optional[List[str]] + ui_locales: Optional[constr(regex=r'[^ ]+(\s([^ ]+))*')] # sub claim MUST not be used to prevent that this jwt # could be reused as a private_key_jwt @@ -186,7 +186,7 @@ def example(): # pragma: no cover acr_values= ["https://www.spid.gov.it/SpidL2", "https://www.spid.gov.it/SpidL1"], claims= {}, state= "fyZiOL9Lf2CeKuNT2JzxiLRDink0uPcd", - ui_locales= ["codice1", "codice2", "codice3"], + ui_locales= "codice1 codice2 codice3", sub= "https://rp.cie.it/", iss= "https://op.spid.agid.gov.it/", aud= ["https://rp.spid.agid.gov.it/auth"], diff --git a/spid_cie_oidc/provider/tests/authn_request_settings.py b/spid_cie_oidc/provider/tests/authn_request_settings.py index a22e1a24..07037437 100644 --- a/spid_cie_oidc/provider/tests/authn_request_settings.py +++ b/spid_cie_oidc/provider/tests/authn_request_settings.py @@ -39,7 +39,7 @@ "acr_values": ["https://www.spid.gov.it/SpidL2", "https://www.spid.gov.it/SpidL1"], "claims": CLAIMS_SPID, "state": "fyZiOL9Lf2CeKuNT2JzxiLRDink0uPcd", - "ui_locales": ["codice1", "codice2", "codice3"], + "ui_locales": "codice1 codice2 codice3", "sub": "https://rp.cie.it/", "iss": "https://op.spid.agid.gov.it/", "aud": ["https://rp.spid.agid.gov.it/auth"],