HTTPSignatures.Adapter behaviour (http_signatures v0.1.2)

Contract for HTTPSignatures adapters.

Projects making use of the HTTPSignatures library use an adapter in order to provide and refresh the keys used to validate signatures.

To set the adapter in your project, use the config system:

config :http_signatures, adapter: YourAdapter

Summary

Callbacks

Fetch a public key, given a Plug.Conn structure.

Refetch a public key, given a Plug.Conn structure. Called when the initial key supplied failed to validate the signature.

Callbacks

Link to this callback

fetch_public_key(t)

@callback fetch_public_key(Plug.Conn.t()) :: {:ok, any()} | {:error, any()}

Fetch a public key, given a Plug.Conn structure.

Link to this callback

refetch_public_key(t)

@callback refetch_public_key(Plug.Conn.t()) :: {:ok, any()} | {:error, any()}

Refetch a public key, given a Plug.Conn structure. Called when the initial key supplied failed to validate the signature.