feat: require admin token for ingestion endpoints

This commit is contained in:
William Valentin
2026-02-01 03:08:15 -08:00
parent 50aa6008e3
commit 7c8406c7cc
6 changed files with 249 additions and 185 deletions

View File

@@ -0,0 +1,8 @@
import { test, expect } from "bun:test";
test("imports POST rejects when missing admin token", async () => {
const { handleCreateImport } = await import("../../app/api/imports/handlers");
const res = await handleCreateImport({ adminOk: false, body: {} });
expect(res.status).toBe(401);
expect(res.body).toEqual({ error: "admin_required" });
});