ex_multipass v0.2.0 ExMultipass View Source

Support for consuming and generating Multipass payloads based on the Rails gem Multipass.

If integrating with a service using the Rails gem care must be taken to ensure site_key and api_key match between the services.

Example

iex> ExMultipass.encode(%{example: "data"}, "my_site_key", "my_super_secret_key_shh")
{:ok, "HFtLULqnAfVZexe46_T5KHJcgSRwAtf45zPwJ5g361w"}

iex> ExMultipass.decode("HFtLULqnAfVZexe46_T5KHJcgSRwAtf45zPwJ5g361w", "my_site_key", "my_super_secret_key_shh")
{:ok, %{"example" => "data"}}

Link to this section Summary

Functions

Decodes a Multipass string into a map.

Encodes a map resulting in a Multipass compliant string.

Link to this section Functions

Decodes a Multipass string into a map.

Link to this function

encode(data, site_key, api_key)

View Source
encode(map(), String.t(), String.t()) ::
  {:ok, String.t()} | {:error, ExMultipass.EncodingError.t()}

Encodes a map resulting in a Multipass compliant string.