View Source Pow.Plug.MessageVerifier behaviour (Pow v1.0.36)
This module can sign and verify messages.
Based on Phoenix.Token.
Summary
Callbacks
@callback sign(Plug.Conn.t(), binary(), binary(), keyword()) :: binary()
@callback verify(Plug.Conn.t(), binary(), binary(), keyword()) :: {:ok, binary()} | :error
Functions
@spec sign(Plug.Conn.t(), binary(), binary(), keyword()) :: binary()
Signs a message.
Plug.Crypto.MessageVerifier.sign/2 is used. The secret is derived from the
salt and conn.secret_key_base using
Plug.Crypto.KeyGenerator.generate/3. If :key_generator_opts is set in the
config, this will be passed on to Plug.Crypto.KeyGenerator.
@spec verify(Plug.Conn.t(), binary(), binary(), keyword()) :: {:ok, binary()} | :error
Verifies a message.
Plug.Crypto.MessageVerifier.sign/2 is used. The secret is derived from the
salt and conn.secret_key_base using
Plug.Crypto.KeyGenerator.generate/3. If :key_generator_opts is set in the
config, this will be passed on to Plug.Crypto.KeyGenerator.