add auth check
This commit is contained in:
@@ -121,6 +121,7 @@ test("existing two-step client flow uploads, lists, and downloads a file", async
|
||||
});
|
||||
const downloaded = await fetch(download.url);
|
||||
assert.equal(await downloaded.text(), "time,pressure\n0,10\n");
|
||||
assert.equal((await fetch(download.url)).status, 403);
|
||||
});
|
||||
|
||||
test("admin lists, downloads, and deletes only the selected device control data", async () => {
|
||||
@@ -159,8 +160,9 @@ test("admin lists, downloads, and deletes only the selected device control data"
|
||||
});
|
||||
assert.equal(download.success, true);
|
||||
assert.equal(download.size, Buffer.byteLength('{"parts":1}'));
|
||||
assert.match(download.url, /expires=.*token=/);
|
||||
assert.match(download.url, /\/downloads\//);
|
||||
assert.equal(await (await fetch(download.url)).text(), '{"parts":1}');
|
||||
assert.equal((await fetch(download.url)).status, 403);
|
||||
|
||||
const forbiddenDelete = await post({
|
||||
type: "deleteControlFile", fileID: "model://control-co/line-1/controller.bin", adminToken: "test-token"
|
||||
|
||||
Reference in New Issue
Block a user