Explicit policy for draft-ietf-webbotauth-httpsig-protocol-00.
new/1 requires :algorithms, :agents, :cache (PID or nil),
:freshness (clock, skew, max_age), :content, and :replay.
Freshness always requires expiration. Content and replay use the generic
RequestSeal.Policy contracts; HMAC algorithms are forbidden.
The arity-one :agents trust function receives identifier, location, and
type (:directory, :jwks_uri, or :cimd) and returns {:ok, source_or_key_set}
or :error. It selects caller-configured trust, never an arbitrary fetch URL.
A Source requires a caller-started cache. A KeySet must be fresh and associated
with the same URL and type. Attribution requires this trusted association.
Optional choices: :components (extra required identifiers, default "()"),
:max_lifetime (1..604,800 seconds, default 86,400), :unresolved (:reject
or {:held_keys, key_resolver}), :test_keys (:reject or :allow),
:untagged (:ignore or :reject), :max_signatures (1..64, default 16),
and :field_schemas. Held-key verification attributes only the thumbprint,
never an unresolved agent URL. The :held_keys option waives the draft's
field-presence rule only when the field is absent.
A present Signature-Agent field, including an empty dictionary, must have
a member for the selected signature label or verification rejects with :missing_member.
Test keys default to rejection under Section 6.8.
Within the caller's chosen replay namespace, commitments should hash each
signature's nonce, keyid, and agent identifier only (identifier, keyid, and
agent.identifier in the supplied facts; held keys have no agent identifier).
Replay facts retain the agent's stable kind, identifier, type, origin,
and thumbprint fields. They exclude provenance and cache-refresh fields such as
fetched_at and revision, so hashing the supplied facts is stable across directory
refreshes. Full provenance remains available in the verification result.
Replay scope remains caller-owned,
as described in RFC 9421 Section 7.2.2.
Inspection omits callback environments and source configuration.
Summary
Functions
Construct an explicit policy without invoking trust, clock, or storage.
Types
@type agents() :: (map() -> {:ok, RequestSeal.Discovery.Source.t() | RequestSeal.Discovery.KeySet.t()} | :error)
@type signer() :: RequestSeal.Policy.signer()
@type t() :: %RequestSeal.WebBotAuth.Policy{ agents: agents(), algorithms: list(), cache: pid() | nil, components: binary(), content: term(), field_schemas: map(), freshness: map(), max_lifetime: pos_integer(), max_signatures: pos_integer(), replay: term(), test_keys: :reject | :allow, unresolved: term(), untagged: :ignore | :reject }
Functions
@spec new(map()) :: {:ok, t()} | {:error, RequestSeal.Error.t()}
Construct an explicit policy without invoking trust, clock, or storage.