feat(auth): single-admin password login (signed cookie) — gate tuning + Sources catalog, keep chat and document viewer public
This commit is contained in:
@@ -12,15 +12,15 @@ from sqlalchemy import text
|
||||
from app.models import Chunk, Document
|
||||
|
||||
|
||||
def test_docs_empty_shape(client, db) -> None:
|
||||
def test_docs_empty_shape(admin_client, db) -> None:
|
||||
db.execute(text("TRUNCATE chunks, documents"))
|
||||
db.commit()
|
||||
r = client.get("/api/docs")
|
||||
r = admin_client.get("/api/docs")
|
||||
assert r.status_code == 200
|
||||
assert r.json() == {"documents": []}
|
||||
|
||||
|
||||
def test_docs_populated_shape_sorted_with_chunk_counts(client, db) -> None:
|
||||
def test_docs_populated_shape_sorted_with_chunk_counts(admin_client, db) -> None:
|
||||
db.execute(text("TRUNCATE chunks, documents"))
|
||||
db.commit()
|
||||
now = datetime.now(UTC)
|
||||
@@ -50,7 +50,7 @@ def test_docs_populated_shape_sorted_with_chunk_counts(client, db) -> None:
|
||||
)
|
||||
db.commit()
|
||||
|
||||
r = client.get("/api/docs")
|
||||
r = admin_client.get("/api/docs")
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
# Ordered by (source, path): Deployments < Homelab.
|
||||
@@ -69,8 +69,8 @@ def test_docs_populated_shape_sorted_with_chunk_counts(client, db) -> None:
|
||||
db.commit()
|
||||
|
||||
|
||||
def test_docs_response_matches_schema_shape(client, db) -> None:
|
||||
r = client.get("/api/docs")
|
||||
def test_docs_response_matches_schema_shape(admin_client, db) -> None:
|
||||
r = admin_client.get("/api/docs")
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert set(body) == {"documents"}
|
||||
|
||||
Reference in New Issue
Block a user