From 98f891916dfc95954670567603287e3658433819 Mon Sep 17 00:00:00 2001 From: Alex <25013571+alexhb1@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:21:44 +0100 Subject: [PATCH] Remove slash cleanup for OIDC discovery URL (#887) Fixes #869 --- shelfmark/config/security_handlers.py | 1 + tests/config/test_security.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shelfmark/config/security_handlers.py b/shelfmark/config/security_handlers.py index 17cef37..35fb23b 100644 --- a/shelfmark/config/security_handlers.py +++ b/shelfmark/config/security_handlers.py @@ -34,6 +34,7 @@ def on_save_security( normalized_values["OIDC_DISCOVERY_URL"] = normalize_http_url( str(discovery_url), default_scheme="https", + strip_trailing_slash=False, ) proxy_logout_url = normalized_values.get("PROXY_AUTH_LOGOUT_URL") diff --git a/tests/config/test_security.py b/tests/config/test_security.py index 1b2be24..86b5705 100644 --- a/tests/config/test_security.py +++ b/tests/config/test_security.py @@ -435,7 +435,9 @@ class TestSecurityOnSave: assert result["error"] is False - def test_on_save_normalizes_oidc_discovery_url(self, tmp_path, monkeypatch): + def test_on_save_normalizes_oidc_discovery_url_without_stripping_trailing_slash( + self, tmp_path, monkeypatch + ): from shelfmark.config.security import _on_save_security monkeypatch.setenv("CONFIG_DIR", str(tmp_path)) @@ -446,7 +448,7 @@ class TestSecurityOnSave: assert result["error"] is False assert ( result["values"]["OIDC_DISCOVERY_URL"] - == "https://auth.example.com/.well-known/openid-configuration" + == "https://auth.example.com/.well-known/openid-configuration/" ) def test_on_save_normalizes_proxy_logout_url(self, tmp_path, monkeypatch):