Repository avatar
Security
v0.1.0-dev.1
active

permissionproof

io.github.Unique50101/permissionproof

Validate permission policies and compare cross-layer authorization evidence locally.

Documentation

PermissionProof

Test every permission before you ship. A local-first authorization contract checker from Unique Open Sources. Declare what an actor may do once, and see the evidence for each application layer side by side.

A customer should be able to read an order they own. In the included shop, the regression fixture removes that permission from the API. The interface still shows the order and the database still returns it. PermissionProof points to the API row for owner-read.

CI · MIT license · UniqueOSS project directory

Run the shop

Use Node.js 24.12 or newer and npm. From a checkout of this repository:

npm ci
npm run build
node dist/cli.js test --demo corrected --save good.json
node dist/cli.js test --demo regression --save regression.json
node dist/cli.js dashboard --run regression.json

The regression command intentionally exits 1 and writes its run before exiting. Open the loopback address printed by the dashboard. Run the commands individually if your shell stops on a nonzero exit.

RequirementFrontendAPIDatabase
Owner reads own order, correctedPassedPassedPassed
Same requirement, regressionPassedFailedPassed

PermissionProof dashboard showing the API regression

Animated dashboard walkthrough · Actual CLI output

Use your own test evidence

  1. Run node dist/cli.js init --yes. Review the example identities and replace the requirements with your application's permission contract.
  2. Add observations in the tests that already exercise your components. Each observation carries a rule ID, layer, fixture precondition, decision and the observed data or state effect.
  3. Use node dist/cli.js test --config permissionproof.json --evidence evidence.json --save run.json. Missing evidence makes the CI gate incomplete. Raw response bodies, headers and tokens have no fields in the evidence format.
  4. Use node dist/cli.js report --run run.json --format html --out report.html to save an interactive report. Compare two saved runs with node dist/cli.js compare --before regression.json --after good.json.

Architecture

flowchart TD
  A["Reviewed permission contract"] --> C["Validate and match requirement IDs"]
  B["Observations from application tests"] --> C
  C --> D["Compare decision and effect by layer"]
  D --> E["CLI and CI gate"]
  D --> F["Local dashboard and exports"]

The shop executes a rendered component, in-process REST handler and in-memory SQLite queries independently. Separate fixtures exercise official Firestore rules testing, PostgreSQL RLS through PGlite and GraphQL field selection. Imported observations depend on the assertions in the producer. The CLI accepts local files and synthetic demos.

Documentation

NPM
permissionproof
Install Command
npm install permissionproof