MessageSignatures.NonceChecker behaviour (MessageSignatures v0.1.0)

Copy Markdown View Source

Replay-protection hook for verification.

The package does not store nonces. Implement this behaviour over caller-owned storage and pass it as :nonce_checker to MessageSignatures.verify/2. The callback runs after cryptographic authentication and receives the signature's nonce, or nil when none is present.

Summary

Callbacks

check_nonce(nonce, context)

@callback check_nonce(nonce :: String.t() | nil, context :: map()) ::
  :ok | {:error, term()}