Manifold Signature v0.0.2 ManifoldcoSignature.Signature View Source

Verifies a request signature for the Manifold.co service callbacks.

https://docs.manifold.co/providers#section/Authentication

Link to this section Summary

Types

Endorsement provided as the 3 argument in the x-signature header

User friendly error reason

Master key provided by Manifold. This should be securely stored in your environment and passed to validate/2

The canonized request message to verify

Public key provided as the second argument in the x-signature header

Request signature provied as the first argument in the x-signature header

t()

Functions

Builds a new signature from the provided request data

Validates the signature (t) against the master_key

Link to this section Types

Link to this type canonized_headers() View Source
canonized_headers() :: binary()
Link to this type canonized_method() View Source
canonized_method() :: binary()
Link to this type canonized_query_string() View Source
canonized_query_string() :: binary()
Link to this type endorsement() View Source
endorsement() :: binary()

Endorsement provided as the 3 argument in the x-signature header.

Link to this type error_reason() View Source
error_reason() :: binary()

User friendly error reason.

Link to this type master_key() View Source
master_key() :: binary()

Master key provided by Manifold. This should be securely stored in your environment and passed to validate/2.

The canonized request message to verify.

Link to this type public_key() View Source
public_key() :: binary()

Public key provided as the second argument in the x-signature header.

Link to this type request_body() View Source
request_body() :: nil | binary()
Link to this type request_header_key() View Source
request_header_key() :: binary()
Link to this type request_header_value() View Source
request_header_value() :: binary()
Link to this type request_headers() View Source
request_headers() :: [{request_header_key(), request_header_value()}]
Link to this type request_method() View Source
request_method() :: binary()
Link to this type request_path() View Source
request_path() :: binary()
Link to this type request_query_string() View Source
request_query_string() :: nil | binary()
Link to this type signature() View Source
signature() :: binary()

Request signature provied as the first argument in the x-signature header.

Link to this type t() View Source
t() :: %ManifoldcoSignature.Signature{
  date: DateTime.t(),
  endorsement: endorsement(),
  message: message(),
  public_key: public_key(),
  signature: signature()
}

Link to this section Functions

Link to this function build(method, path, query_string, headers, body) View Source

Builds a new signature from the provided request data.

Link to this function validate(signature, master_key, opts \\ []) View Source
validate(t(), master_key(), Keyword.t()) :: :ok | {:error, error_reason()}

Validates the signature (t) against the master_key.