Keep-going: tree shares, health flags, CI, compose, timestamp Zapier action
Directory-tree encrypted share mock; /health reports mockVerae/nats; middleware OpenAPI extended; zappier receipt by jobId; activate Create Timestamp (local mock or hosted); GitHub Actions test:offline; compose builds zappier image; seed-demo.mjs. No Zapier login or live Verae required.
This commit is contained in:
parent
645a24909a
commit
5925e76c72
39 changed files with 514 additions and 33 deletions
|
|
@ -62,6 +62,41 @@ describe('encrypted objects + share + pdf receipt', () => {
|
|||
assert.equal(redeemed.body.publicMetadata.title, 'pub');
|
||||
});
|
||||
|
||||
it('shares a directory tree of encrypted files', async () => {
|
||||
const tree = await call(port, 'POST', '/zapier/v1/objects/trees', ownerKey, {
|
||||
prefix: 'docs/',
|
||||
files: [
|
||||
{ path: 'docs/a.txt', data: 'alpha' },
|
||||
{ path: 'docs/b.txt', data: 'beta' },
|
||||
],
|
||||
});
|
||||
assert.equal(tree.status, 201);
|
||||
assert.equal(tree.body.fileCount, 2);
|
||||
const share = await call(port, 'POST', `/zapier/v1/objects/trees/${tree.body.id}/share`, ownerKey, {});
|
||||
assert.equal(share.status, 201);
|
||||
assert.equal(share.body.kind, 'tree');
|
||||
const redeemed = await call(port, 'GET', `/zapier/v1/shares/${share.body.token}`, otherKey);
|
||||
assert.equal(redeemed.status, 200);
|
||||
assert.equal(redeemed.body.kind, 'tree');
|
||||
assert.equal(redeemed.body.files.length, 2);
|
||||
assert.ok(redeemed.body.files[0].dek);
|
||||
});
|
||||
|
||||
it('hash lookup never includes privateMetadata', async () => {
|
||||
const created = await call(port, 'POST', '/zapier/v1/timestamp', ownerKey, {
|
||||
data: 'meta-private',
|
||||
publicMetadata: { vis: 'yes' },
|
||||
privateMetadata: { secret: 'nope' },
|
||||
});
|
||||
const sha = created.body.sha256;
|
||||
const look = await call(port, 'GET', `/zapier/v1/hashes/${sha}`, ownerKey);
|
||||
assert.equal(look.status, 200);
|
||||
assert.equal(look.body.publicMetadata.vis, 'yes');
|
||||
assert.equal(look.body.privateMetadata, undefined);
|
||||
const st = await call(port, 'GET', `/zapier/v1/status/${created.body.jobId}`, ownerKey);
|
||||
assert.equal(st.body.privateMetadata.secret, 'nope');
|
||||
});
|
||||
|
||||
it('returns a PDF receipt starting with %PDF', async () => {
|
||||
const wait = await call(port, 'POST', '/zapier/v1/timestamp/wait', ownerKey, { data: 'pdf-receipt' });
|
||||
const jobId = wait.body.id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue