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

@buildtovalue/identity

v1.1.0-next.0

Published

Headless identity, signature and RBAC-verification layer (Handoff 8): Ed25519 approval signatures over the canonical payload (WebCrypto, offline verification), and role-requirement evaluation. NEVER generates, stores or manages keys — the Signer is always

Downloads

606

Readme

@buildtovalue/identity

Headless identity, signature and RBAC-verification layer for BPMN governance (Handoff 8): Ed25519 approval signatures over the canonical payload, offline verification via WebCrypto, and role-requirement evaluation.

The library never touches your keys (cerca §1.1 — nunca PKI)

This library does not generate, store or manage keys. There is no key generation, no private-key storage, no key export anywhere in this package. A Signer is always implemented and injected by the host (corporate SSO/IdP, YubiKey, git key). Only the payload bytes cross the boundary into sign(); the private key stays with the host. This package does exactly three things: sign via the injected handle, verify signatures, and evaluate role requirements. Key management — issuance, rotation, revocation, custody — is the host's responsibility.

RBAC is verification, not enforcement (cerca §1.2)

evaluateRoleRequirement answers "does approval #y satisfy the roles this promotion requires?" — a statement any third party can re-check against the signatures. It does not block actions: whoever controls the client can ignore local rules. Enforcement belongs to the anchor and whoever hosts it. (This is line 1 of docs/limitations.md.)

import {
  buildApprovalPayload,
  signApproval,
  verifySignature,
  evaluateRoleRequirement,
} from '@buildtovalue/identity';

// The host implements Signer — the private key never enters the library.
const payload = buildApprovalPayload({
  diagramId: 'onboarding',
  version: '2.1.0',
  xmlHash,        // SHA-256 of the canonical BPMN XML
  ledgerHead,     // the ledger head hash the approval binds to
  decision: 'approve',
  role: 'compliance',
});

const approval = await signApproval(hostSigner, payload, new Date().toISOString());

await verifySignature(approval, publicKey);          // 'valid' | 'invalid' — offline
evaluateRoleRequirement(['compliance', 'architecture'], [approval]); // { satisfied, missing }

What a signature covers

The signature binds diagramId + version + xmlHash + ledgerHead + decision + role, serialized deterministically with canonicalJson from @buildtovalue/core (the same input as the attestation). Any later change to those fields makes verification return invalid — with expected × obtained surfaced by the host UI.

Three-state verification

  • valid — signature verifies against the public key.
  • invalid — payload altered or wrong key (detectable by any third party).
  • legacy — no signature present (pre-Handoff-8 history). The lesser guarantee is declared, never signed retroactively (cerca §1.5).

Decoupling

Consumes only @buildtovalue/core (canonicalJson + types) — pinned by tests/independence.test.ts. Zero network, zero react, zero anchor code (anchor adapters live in separate packages, injected by the host). Zero runtime dependencies beyond the workspace core link.

Runtime note: WebCrypto Ed25519 is stable in Node ≥ 20 and in recent browsers (Chrome 137+, Safari 17+). Older browsers need a host-provided verifier — see docs/limitations.md.