@vensofts-integration-testkit/license-core
v0.1.4
Published
Offline Ed25519 entitlement verification for the suite's Pro features (no heartbeat, no machine fingerprint, no private keys).
Maintainers
Readme
@vensofts-integration-testkit/license-core
Offline license checks for the NodeSDK Pro packages. MIT.
You get it as a dependency of the CLIs and Pro packages. Install it directly to load a license in your own code:
npm install @vensofts-integration-testkit/license-coreimport { readFileSync } from 'node:fs';
import { entitlementOrThrow } from '@vensofts-integration-testkit/license-core';
// Pass the result to the Pro functions. product is 'authz' or 'scenario'; a suite license covers both.
const entitlement = entitlementOrThrow(readFileSync('license.json', 'utf8'), { product: 'authz' });Buying a license: a free 14-day trial, then USD 299 per year per organization; see the price table. Email [email protected].
How it works
A license file is { payload, signature }, where the signature is Ed25519 over the JCS
canonicalization of the payload. Licenses verify only against VENDOR_KEYRING, the Vensofts public
keys bundled in this package (keyed by keyId, so keys can rotate). There is no network call and
no machine fingerprint.
- Every license has an
expiresAtdate, trials and subscriptions alike. After it, paid features stop withLICENSE_EXPIRED. Releases newer than the license'supdatesThroughdate are refused too. Each release carries its ownRELEASE_DATE. The check uses the system clock, offline. - Only
verifyLicenseandentitlementOrThrowproduce entitlements that Pro features accept. A hand-built entitlement object, or features added to one afterwards, unlock nothing. - Failure happens only when a paid feature is actually invoked, and always as
UnlicensedFeatureError(exit code 5). An invalid license never silently reduces what a run covers.
JavaScript licensing cannot be made tamper-proof. The value sold is maintained, supported releases.
import assert from 'node:assert/strict';
import { generateKeyPairSync, sign } from 'node:crypto';
import {
requireFeature,
signingInput,
verifyLicense,
type Entitlement,
type LicensePayload,
} from '@vensofts-integration-testkit/license-core';
// A license signed with any key other than a Vensofts key is rejected.
const { privateKey } = generateKeyPairSync('ed25519');
const payload: LicensePayload = {
format: 'nodesdk-license',
formatVersion: 2,
kind: 'subscription',
licenseId: 'lic-docs',
product: 'suite',
features: ['authz.reports', 'scenario.reduction'],
licensee: 'Example Ltd',
issuedAt: '2026-01-01T00:00:00.000Z',
updatesThrough: '2099-12-31',
expiresAt: '2099-12-31',
keyId: 'vensofts-2026-01',
};
const forged = JSON.stringify({
payload,
signature: sign(null, signingInput(payload), privateKey).toString('base64url'),
});
const r = verifyLicense(forged, { product: 'scenario' });
assert.equal(r.valid ? 'valid' : r.reason, 'bad-signature');
// Pro features refuse anything that did not come from verifyLicense.
const handMade: Entitlement = {
licenseId: 'x',
product: 'suite',
features: new Set(['scenario.reduction']),
licensee: 'x',
updatesThrough: '2099-12-31',
expiresAt: '2099-12-31',
kind: 'subscription',
testOnly: false,
};
assert.throws(
() => requireFeature(handMade, 'scenario.reduction'),
(e: { code: string; exitCode: number }) => e.code === 'LICENSE_NOT_VERIFIED' && e.exitCode === 5,
);
assert.throws(
() => requireFeature(undefined, 'authz.lifecycle'),
(e: { exitCode: number }) => e.exitCode === 5,
);Licenses are issued by Vensofts. To buy one, email [email protected].
