Initial import of verae-nats-accounts from zapier monorepo
This commit is contained in:
commit
e81002f4b6
7 changed files with 103 additions and 0 deletions
12
test/policy.test.js
Normal file
12
test/policy.test.js
Normal 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.>'));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue