Add readonly todo and archive providers and retire legacy writes

This commit is contained in:
abaishu0730 committed 2026-10-19 12:43:03 +08:00
1 parent 37b4a156c9
commit 5c7ce76f5d
12 files changed
+187 -25

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ test('workspace API requires authentication and roles and preserves same-origin
const readerLogin=await call('/api/login',{username:'reader',password:'Test-password-123'});const reader=readerLogin.headers.get('set-cookie').split(';')[0];
assert.equal((await call('/api/workspace',undefined,reader)).status,200);assert.equal((await call('/api/exceptions',{title:'示例',component:'pdf',priority:'normal',description:'',owner:''},reader)).status,403);
const opLogin=await call('/api/login',{username:'operator',password:'Test-password-123'});const operator=opLogin.headers.get('set-cookie').split(';')[0];
assert.equal((await call('/api/connections',{name:'示例连接',owner:'operator'},operator)).status,403);assert.equal((await call('/api/supervisor',{version:1,defaultOwner:'operator',notifyChannel:'manual',maxAttempts:1},operator)).status,403);
assert.equal((await call('/api/connections',{name:'示例连接',owner:'operator'},operator)).status,403);assert.equal((await call('/api/supervisor',{version:1,defaultOwner:'operator',notifyChannel:'manual',maxAttempts:1},operator)).status,410);
const made=await call('/api/exceptions',{title:'示例',component:'pdf',priority:'normal',description:'',owner:''},operator);assert.equal(made.status,201);const item=await made.json();const claimed=await call('/api/exceptions/'+item.id+'/action',{version:1,action:'claim'},operator);assert.equal(claimed.status,200);assert.equal((await claimed.json()).owner,'operator');
assert.equal((await call('/api/connections',{name:'示例连接',owner:'operator'},cookie)).status,201);assert.equal((await call('/workspace.js')).status,200);
});