feat(storage): simplify shared path setup and allow passwordless access
This commit is contained in:
1 parent
6c2cc526e6
commit
b34d51432d
9 files changed
+101
-21
No files matched your search
@@ -8,6 +8,8 @@ test('storage HTTP enforces roles, redacts passwords and archives only successfu
|
||||
const {dir,outputDir,store,storageStore,call,login}=await fixture(t);assert.equal((await call('/api/storage')).status,401);
|
||||
const admin=await login('admin'),operator=await login('operator'),viewer=await login('viewer');
|
||||
assert.equal((await call('/api/storage/servers',config,operator)).status,403);assert.equal((await call('/api/storage/servers',config,admin,'https://evil.test')).status,403);
|
||||
const quick=await call('/api/storage/servers',{address:String.raw`\\storage.company.test\orders`,authMode:'windows',enabled:true},admin);assert.equal(quick.status,201);const quickServer=await quick.json();assert.equal(quickServer.authMode,'windows');assert.equal(quickServer.hasPassword,false);assert.equal(quickServer.username,'');assert.equal((await call(`/api/storage/servers/${quickServer.id}/check`,{},admin)).status,200);
|
||||
const invalid=await call('/api/storage/servers',{address:String.raw`\\storage.company.test\orders\..\outside`,authMode:'windows',enabled:true},admin);assert.equal(invalid.status,400);
|
||||
const saved=await call('/api/storage/servers',config,admin);assert.equal(saved.status,201);const server=await saved.json();assert.equal(server.password,undefined);
|
||||
assert.doesNotMatch(JSON.stringify(await(await call('/api/storage',undefined,viewer)).json()),/Private-storage/);
|
||||
assert.equal((await call(`/api/storage/servers/${server.id}/files`,undefined,viewer)).status,403);
|
||||
|
||||
Reference in new issue
Block a user