Skip to guide

Developer documentation

The Verify package

Install passcontrol. Import the checking helpers from passcontrol/verify. No PassControl account or developer API key is required.

Install

Use npm install passcontrol for Node. The Python token example uses pip install 'PyJWT[crypto]'. Curl is enough for public lookups.

Choose the issuer in your application configuration. verifyAgent and verifyAgentRequest trust only https://passcontrol.vertias.eu by default. trustedIssuers replaces that set. They require canonical ASCII HTTPS origins. checkMandate requires an explicit issuer with the same origin rules. verifyReceipt requires trustedIssuers and compares issuer strings after removing trailing slashes; it does not enforce HTTPS or canonical origins.

verifyAgent

Pass the token from the Authorization header and the exact audience used at minting. The verifier checks the issuer, key, signature, token type, claims, audience, expiry and maximum age. Its default maximum age is 300 seconds.

A successful result includes ok, passport, owner, tier, issuer and notPermission, plus mnd when the token carries a mandate reference. The owner is a signed snapshot, or null. It is not a live owner lookup.

Enable revocation with an explicit freshness limit when your decision needs it. The signed list covers permanent revocation and rotation deadlines. It excludes expiry and reversible stops such as suspension or a kill switch.

The minimal Python example checks a fixed issuer, exact audience, Ed25519 signature, expiry and token age. It returns the claims dictionary and raises exceptions on failure, including a missing signing key. It has no token size cap, full claim-shape validation, revocation check or key cache. Its socket timeout is not a total fetch deadline. Before using it in production, bound token size, validate non-empty sub/agid/jti, own/mnd shapes and integer ver/nbf, require exp after iat, handle missing keys, and enforce a total fetch deadline. Add fresh signed revocation checks and key caching as needed.

verifyAgentRequest

Web Bot Auth uses an HTTP Message Signature to bind a request to the agent's key. verifyAgentRequest resolves the key through GET /agents/{id}/keys under a trusted issuer. Use the request's original public HTTPS URL. Do not build that URL from untrusted forwarding headers.

A successful result includes ok, passport, issuer, keyid, signatureAgent, nonce, expires and notPermission. It does not include owner identity or an owner verification tier.

The profile covers the authority, method, target URI and Signature-Agent. Agent-Token and PassControl-Act must also be covered when present. Body bytes are not covered. Add a nonce store to reject replay.

checkMandate

Verify the request signature and claim its nonce before the live mandate check. The signed request must carry an Agent-Token with mnd and a PassControl-Act header.

checkMandate forwards the three signature headers, Agent-Token and PassControl-Act to the live check. It uses a three-second timeout and a 65,536-byte response limit. It returns inside, outside, revoked, expired, stopped, unavailable or refused.

Derive act and amount from the operation your door will execute. The helper does not prove body integrity. Use commit: false for a peek or commit: true to reserve and count one act. The check never moves money or grants your service's permission.

Only accept inside when your own access rule also allows the act. A Shadow trial returns outside with reason trial and counts nothing.

verifyReceipt

checkMandate may return a receipt string without verifying it. Check that receipt is present, then pass it to verifyReceipt with trustedIssuers set explicitly.

Signature verification is offline once you hold the issuer's trusted public Ed25519 keys. Keep the keys needed to verify historical receipts. verifyReceipt fetches JWKS on each call unless you pass a jwksCache Map. That cache has no built-in expiry or ETag handling. Its default fetch has no helper-enforced timeout, response size cap or redirect refusal. Supply a custom fetch to enforce those limits.

A verified door-act receipt records a reservation or refusal. It does not prove that the act completed.

Nonce stores

A nonce is a random value used once. Without a seenNonce store, an exact signed request can be replayed until it expires.

Create MemorySeenNonce once, outside your request handler. It is for one low-volume process. Its defaults are 10,000 total entries and 1,000 entries per passport. Unexpired entries are never evicted. Reaching a limit refuses the request with replay.

For multiple processes, supply a seenNonce object backed by shared storage. claim(key, expiresAt, passport?) must atomically accept a key once and return a boolean or a promise of one. The key is issuer|passport|nonce. expiresAt is Unix time in seconds. Store errors fail closed. Redis SET NX with expiry is one option.

Local replay rejection and live-check idempotency are separate. A successful repeated live commit can return its stored answer, while the receiving door's nonce store still rejects a repeated incoming HTTP request.

The Verify package · Developers · PassControl