Initial import of verae-nats-accounts from zapier monorepo

This commit is contained in:
George Lambert 2026-09-11 19:10:31 -04:00
commit 952d5077d6
7 changed files with 103 additions and 0 deletions

12
test/policy.test.js Normal file
View file

@ -0,0 +1,12 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { leafAllowed, loadPolicy } from '../src/policy.js';
test('leaf may archive and jobs, never billing', () => {
assert.equal(leafAllowed('verae.archive.put'), true);
assert.equal(leafAllowed('verae.archive.reply.abc'), true);
assert.equal(leafAllowed('verae.zapier.jobs.watch'), true);
assert.equal(leafAllowed('verae.billing.balance.adjust'), false);
assert.equal(leafAllowed('verae.billing.statement.get'), false);
assert.ok(loadPolicy().accounts.LEAF.deny_publish.includes('verae.billing.>'));
});