Named presets for Ankusa.Verifier.Hmac and Ankusa.Verifier.Asymmetric —
the wire details of well-known providers as data, so adding a provider is
editing a table, not writing a module.
Any body-HMAC provider not listed here is expressed inline as a
%Ankusa.Verifier.Hmac.Scheme{}, any public-key one as a
%Ankusa.Verifier.Asymmetric.Scheme{} (see validate!/1 for the
invariants). Providers that are not a signature over a request-derived
string (Twilio's URL + sorted-form-param SHA1, PayPal's RSA over a fetched
certificate) are not expressible by these engines and stay bespoke
Ankusa.Verifier modules.
Summary
Functions
Every named Ankusa.Verifier.Hmac preset, keyed by scheme name.
Every named Ankusa.Verifier.Asymmetric preset, keyed by scheme name.
Look up a named Ankusa.Verifier.Hmac preset.
Look up a named Ankusa.Verifier.Asymmetric preset.
A named Ankusa.Verifier.Asymmetric preset with its signed template compiled.
A named Ankusa.Verifier.Hmac preset with its signed template compiled.
Validate a scheme descriptor (Ankusa.Verifier.Hmac.Scheme or
Ankusa.Verifier.Asymmetric.Scheme), raising ArgumentError naming the
offending field on the first violation.
Functions
@spec all() :: %{required(atom()) => Ankusa.Verifier.Hmac.Scheme.t()}
Every named Ankusa.Verifier.Hmac preset, keyed by scheme name.
@spec asymmetric_all() :: %{required(atom()) => Ankusa.Verifier.Asymmetric.Scheme.t()}
Every named Ankusa.Verifier.Asymmetric preset, keyed by scheme name.
@spec fetch(atom()) :: {:ok, Ankusa.Verifier.Hmac.Scheme.t()} | :error
Look up a named Ankusa.Verifier.Hmac preset.
@spec fetch_asymmetric(atom()) :: {:ok, Ankusa.Verifier.Asymmetric.Scheme.t()} | :error
Look up a named Ankusa.Verifier.Asymmetric preset.
@spec fetch_asymmetric_compiled(atom()) :: {:ok, Ankusa.Verifier.Asymmetric.Scheme.t(), Ankusa.Verifier.Template.compiled()} | :error
A named Ankusa.Verifier.Asymmetric preset with its signed template compiled.
@spec fetch_compiled(atom()) :: {:ok, Ankusa.Verifier.Hmac.Scheme.t(), Ankusa.Verifier.Template.compiled()} | :error
A named Ankusa.Verifier.Hmac preset with its signed template compiled.
@spec validate!(Ankusa.Verifier.Hmac.Scheme.t()) :: Ankusa.Verifier.Hmac.Scheme.t()
@spec validate!(Ankusa.Verifier.Asymmetric.Scheme.t()) :: Ankusa.Verifier.Asymmetric.Scheme.t()
Validate a scheme descriptor (Ankusa.Verifier.Hmac.Scheme or
Ankusa.Verifier.Asymmetric.Scheme), raising ArgumentError naming the
offending field on the first violation.