feat: add authentik admin user sync endpoint
This commit is contained in:
19
tests/test_internal_authentik_sync.py
Normal file
19
tests/test_internal_authentik_sync.py
Normal 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"
|
||||
Reference in New Issue
Block a user