feat: add authentik admin user sync endpoint

This commit is contained in:
Chris
2026-03-29 23:08:52 +08:00
parent 5790878c87
commit dbd2ccf43f
13 changed files with 160 additions and 3 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"