UMIS SDK
    Preparing search index...

    Module @umis/policy

    @umis/policy

    Use @umis/policy to define what a UMIS checkpoint accepts, over which channels, how stale its revocation data may be and how much authority it checks. The package validates each policy against the caps of its risk class, and the organisation that owns a policy can sign it. It also ships four presets and an in-memory ledger for limits per period.

    npm install @umis/policy @umis/core
    
    Export What it does
    validatePolicy(doc) returns { ok: true, policy }, or { ok: false, code, errors } with POLICY_INVALID or POLICY_CLASS_CAP_EXCEEDED
    isChannelAllowed(policy, channel) tells whether the policy lists the channel and its risk class allows it
    signPolicy(envelope, signer), verifyPolicy(jws, keys) sign and verify a policy as umis-policy+jwt with the payload {iss, sub, ver, iat, policy}
    DEFAULT_POLICIES the presets below
    createMemoryLedger() creates an AuthorityLedger that adds up accepted amounts per key and period window
    checkpointPolicySchema, checkpointPolicyJsonSchema the policy as a zod schema and as JSON Schema, which also ships as @umis/policy/schema/checkpoint-policy.v1.schema.json

    In the table, S is the age of the oldest status list a checkpoint accepts and Δ is how often it refreshes its status lists. Both are in seconds.

    Preset Class Channels S Δ Accepts Asks for
    door_low low qr_oneway, qr_full 259 200 600 organisation members from its own issuer org, display, and keeps the relay open for 3 s
    warehouse_medium medium qr_reverse, ble 86 400 3 600 role and authority from issuers of the registry org, role, authority, and checks the authority for rebar in t against the amount in the request
    mutual_medium medium qr_reverse, ble 86 400 3 600 both types from issuers of the registry org, role, display
    login_oid4vp medium oid4vp 600 600 both types from issuers of the registry org, role

    All presets accept a holder proof that lives at most 30 seconds. All but door_low require biometric confirmation. The class caps come from CLASS_CAPS of @umis/core. The low class allows S ≤ 72 h over every channel. The medium class allows S ≤ 24 h and the high class S ≤ 1 h, and neither allows one-way or full QR codes. The highest class allows S ≤ 10 min over OpenID4VP only. Δ never exceeds S.

    With a ledger in the verifier context, an authority item limited per shift, day, week or month accepts an amount only while the total accepted in that window stays within the limit. The ledger books an amount only when the verifier accepts. A delegate and its parent share one budget. A ledger belongs to one verifier, so several offline verifiers do not add up their totals.

    See also the UMIS SDK, the profile, the security model and the API reference.

    Copyright 2026 Ishtvan Komonii. Licensed under the Apache License 2.0.

    PolicyEnvelopeV1
    PolicyErrorCode
    checkpointPolicyJsonSchema
    checkpointPolicySchema
    DEFAULT_POLICIES
    createMemoryLedger
    isChannelAllowed
    signPolicy
    validatePolicy
    verifyPolicy