feat: add authentik admin user sync endpoint

This commit is contained in:
Chris
2026-03-29 23:08:52 +08:00
parent 2b81fd01c3
commit c84d7286a1
10 changed files with 154 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
from fastapi.testclient import TestClient
from app.main import app
def test_internal_authentik_ensure_requires_config() -> None:
client = TestClient(app)
resp = client.post(
"/internal/authentik/users/ensure",
headers={"X-Internal-Secret": "CHANGE_ME"},
json={
"sub": "authentik-sub-1",
"email": "user@example.com",
"display_name": "User Example",
"is_active": True,
},
)
assert resp.status_code == 503
assert resp.json()["detail"] == "authentik_admin_not_configured"