npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vensofts-integration-testkit/authz-core

v0.1.4

Published

Authorization Contract SDK core: independent contract AST and evaluator, explain traces, witness obligation planning, HTTP/in-process execution with controls and effect evidence.

Downloads

589

Readme

@vensofts-integration-testkit/authz-core

Authorization testing that does not trust your own code. Most access-control tests reuse the app's own permission logic, so a bug in that logic passes its own tests. Here you write an independent authorization contract, and the SDK checks your real app against it: every route, every tenant boundary, every role. MIT.

The open core of the NodeSDK Authorization Contract SDK. Node.js 22 or newer. For the command line, see @vensofts-integration-testkit/authz-cli.

Install

npm install --save-dev @vensofts-integration-testkit/authz-core

What it does

You write a contract: default deny, forbid always wins, roles with inheritance that count only through active memberships, and grants with half-open [from, until) windows. The SDK then:

  1. Evaluates and explains any decision (decide, formatExplanation). An independent reference interpreter is differentially tested against it on ≥ 10,000 generated cases.
  2. Compiles a plan (compilePlan) from the contract, a world of facts, and bindings from operations to HTTP surfaces: detail, mutation, collection, count, search, batch, content scope, field-level and existence probes. Every allow, deny and forbid witness becomes an obligation. Any obligation without a concrete witness is reported as unsatisfied, never silently dropped.
  3. Runs the plan (runPlan) against your real app. Each deny case is paired with an identity control and an allow control, so a broken login cannot pass as "denied". Mutations are checked by observers and forbidden-write probes in the database, not only by the status code.
  4. Classifies failures into stable signatures, redacts secrets, and reports in JSON.

Example: decide and explain

import assert from 'node:assert/strict';
import { decide, defineContract, formatExplanation } from '@vensofts-integration-testkit/authz-core';

const contract = defineContract({
  id: 'docs',
  version: 1,
  roles: { viewer: [], editor: ['viewer'] },
  resources: { document: { states: ['active', 'archived'] } },
  operations: {
    'document.update': {
      resource: 'document',
      kind: 'update',
      expect: { allow: { status: [200] }, deny: { semantics: '404' } },
    },
  },
  rules: [
    {
      id: 'editors-update-active',
      effect: 'allow',
      operations: ['document.update'],
      when: {
        all: [{ sameTenant: true }, { hasRole: { role: 'editor' } }, { state: { in: ['active'] } }],
      },
    },
  ],
});

const editor = {
  id: 'u1',
  state: 'active',
  memberships: [{ tenant: 'orgA', roles: ['editor'], state: 'active' as const }],
  attributes: {},
};
const doc = {
  type: 'document',
  id: 'd1',
  exists: true,
  tenant: 'orgA',
  owner: null,
  state: 'active',
  grants: [],
  attributes: {},
};
const time = '2026-01-15T12:00:00.000Z';

const ok = decide(contract, { operation: 'document.update', actor: editor, resource: doc, time });
assert.equal(ok.decision, 'allow');

const archived = decide(contract, {
  operation: 'document.update',
  actor: editor,
  resource: { ...doc, state: 'archived' },
  time,
});
assert.equal(archived.decision, 'deny');
console.log(formatExplanation(archived)); // shows which condition failed: resource.state=archived

Use it in your test runner

authzSuite(plan, runtime, { describe, it }) from @vensofts-integration-testkit/authz-core/testing registers one test per case with your test runner's describe and it (Vitest, Jest, Mocha or node:test). An incomplete plan cannot pass.

import { describe, it } from 'vitest';
import { authzSuite } from '@vensofts-integration-testkit/authz-core/testing';

authzSuite(plan, async () => runtime, { describe, it });

What finds real bugs

The test suite of this SDK includes a demo app with 16 deliberately injected authorization faults (missing tenant filters, count leaks, mass assignment, existence oracles, stale sessions and more). Each one is detected, and the correct app passes.

Pro features

HTML, JUnit, SARIF and Markdown reports, lifecycle scenarios, contract sensitivity analysis and contract review are in @vensofts-integration-testkit/authz-pro under a commercial license: a free 14-day trial, then USD 299 per year per organization; see the price table. Contact [email protected].