TASK22028: allow signer hash for deleteblobcase browser flow

This commit is contained in:
2026-03-13 16:30:23 +00:00
parent 6a9a257ae8
commit 49dd99016a
2 changed files with 21 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ ApiProxy.get(async (req, res) => {
"/api/endpoint/getportallogin_api",
"/api/file/upload",
"/api/file/uploadsinglefile",
"/api/file/deleteblobcase",
"/api/file/createrepcompletemessage_api",
"/api/file/createappealcompletemessage_api"
];
+20
View File
@@ -132,6 +132,26 @@ test("gethash_api returns hash for allow-listed getportallogin path", async () =
});
});
test("gethash_api returns hash for allow-listed deleteblobcase path", async () => {
const mod = loadModule("pages/api/endpoint/gethash_api.js", {
hashAPIPath: () => "&hash=deletecase",
getSession: async () => ({ user: { id: "u1" } }),
nextConnect: createNextConnectMock(),
middleware: () => {}
});
const req = {
query: { path: "/api/file/deleteblobcase?container=c1&casefolderID=r1" }
};
const res = createRes();
await mod.default.handler(req, res);
assert.strictEqual(res.state.statusCode, 200);
assert.deepStrictEqual(JSON.parse(JSON.stringify(res.state.jsonBody)), {
hash: "&hash=deletecase"
});
});
test("gethash_api rejects unauthenticated requests with 401", async () => {
const mod = loadModule("pages/api/endpoint/gethash_api.js", {
hashAPIPath: () => "&hash=expected",