feat: require admin token for ingestion endpoints
This commit is contained in:
8
apps/web/src/__tests__/admin-gates-imports.test.ts
Normal file
8
apps/web/src/__tests__/admin-gates-imports.test.ts
Normal 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" });
|
||||
});
|
||||
Reference in New Issue
Block a user