feat(api): standardize REST contracts and auth

This commit is contained in:
2026-07-30 20:38:51 +08:00
parent 9bff6a556a
commit 91f25c8747
77 changed files with 54018 additions and 658 deletions
+19
View File
@@ -0,0 +1,19 @@
from pathlib import Path
THEME_SCRIPT = (
Path(__file__).resolve().parents[2]
/ "infra"
/ "docker"
/ "keycloak"
/ "configure-theme.sh"
)
def test_theme_script_clears_client_login_theme_override() -> None:
script = THEME_SCRIPT.read_text(encoding="utf-8")
assert "TJWATER_KEYCLOAK_CLIENT_ID" in script
assert "sed -n '1p'" in script
assert "--set attributes.login_theme=" in script
assert "client ${client_id} 已改为继承 realm 登录主题。" in script
+7
View File
@@ -1,3 +1,5 @@
import sys
from app.services import scheme_management, tjnetwork
@@ -50,6 +52,11 @@ def test_query_scheme_list_pushes_scheme_type_into_sql(monkeypatch):
def test_get_all_schemes_filters_central_scheme_list_by_type(monkeypatch):
captured = {}
monkeypatch.setitem(
sys.modules,
"app.services.scheme_management",
scheme_management,
)
def fake_query_scheme_list(name, scheme_type=None, query_date=None):
captured["name"] = name