IETF Token Status List construction and verification.
Status values are packed into a compact bit array, compressed with zlib,
and carried in a signed statuslist+jwt. Fetching is deliberately supplied
by the host through resolver functions, so this module has no HTTP or Plug
dependency.
Summary
Functions
Build an unsigned status_list claim.
Build and sign a Status List Token for uri.
Pack status values into bytes, placing the first entry in each byte's least significant field.
Build the status claim carried by a token that references a status list.
Resolve a referenced token's status without performing HTTP.
Sign a caller-supplied Status List Token claim set with the required type.
Read the status value at idx from a packed status array.
Verify and decode a Status List Token.
Types
Functions
@spec build( [non_neg_integer()], keyword() ) :: %{required(String.t()) => term()}
Build an unsigned status_list claim.
:bits defaults to 1.
@spec issue(module(), String.t(), [non_neg_integer()], keyword()) :: String.t()
Build and sign a Status List Token for uri.
Options are :bits (default 1), :exp, :ttl, and :now.
@spec pack([non_neg_integer()], bits()) :: binary()
Pack status values into bytes, placing the first entry in each byte's least significant field.
@spec reference(String.t(), non_neg_integer()) :: %{required(String.t()) => term()}
Build the status claim carried by a token that references a status list.
@spec resolve( map(), (String.t() -> {:ok, String.t()} | {:error, term()}), term(), keyword() ) :: {:ok, non_neg_integer()} | {:error, term()}
Resolve a referenced token's status without performing HTTP.
resolver fetches the Status List Token for a URI and returns
{:ok, token}. The third argument may be trusted JWKS directly or a
function that resolves the trusted JWKS for that URI.
Sign a caller-supplied Status List Token claim set with the required type.
@spec status_at(binary(), bits(), non_neg_integer()) :: non_neg_integer()
Read the status value at idx from a packed status array.
Verify and decode a Status List Token.
:accepted_algs limits the trusted signing algorithms. By default all
asymmetric algorithms supported by Attesto are accepted.