TASK22028: allow signer hash for deleteblobcase browser flow
This commit is contained in:
@@ -16,6 +16,7 @@ ApiProxy.get(async (req, res) => {
|
|||||||
"/api/endpoint/getportallogin_api",
|
"/api/endpoint/getportallogin_api",
|
||||||
"/api/file/upload",
|
"/api/file/upload",
|
||||||
"/api/file/uploadsinglefile",
|
"/api/file/uploadsinglefile",
|
||||||
|
"/api/file/deleteblobcase",
|
||||||
"/api/file/createrepcompletemessage_api",
|
"/api/file/createrepcompletemessage_api",
|
||||||
"/api/file/createappealcompletemessage_api"
|
"/api/file/createappealcompletemessage_api"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -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 () => {
|
test("gethash_api rejects unauthenticated requests with 401", async () => {
|
||||||
const mod = loadModule("pages/api/endpoint/gethash_api.js", {
|
const mod = loadModule("pages/api/endpoint/gethash_api.js", {
|
||||||
hashAPIPath: () => "&hash=expected",
|
hashAPIPath: () => "&hash=expected",
|
||||||
|
|||||||
Reference in New Issue
Block a user