diff --git a/pages/api/endpoint/gethash_api.js b/pages/api/endpoint/gethash_api.js index 5927cf87..7b241718 100644 --- a/pages/api/endpoint/gethash_api.js +++ b/pages/api/endpoint/gethash_api.js @@ -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" ]; diff --git a/tests/phase14/service-behaviour.test.cjs b/tests/phase14/service-behaviour.test.cjs index 86bb0714..28e7a8a7 100644 --- a/tests/phase14/service-behaviour.test.cjs +++ b/tests/phase14/service-behaviour.test.cjs @@ -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",