Resuelve AuthPlug v1.3.0 ResuelveAuth.Utils.Secret View Source

Contiene lógica de codificación, decodificación, cifrado y descifrado.

Link to this section Summary

Functions

Identifica si la tupla de la cadena firmada es válida de acuerdo al token enviado.

Firma la información con una semilla (secret) pasando primero por un proceso de códificación.

Link to this section Functions

Link to this function

cypher(data, sign, secret) View Source

Link to this function

decode(result) View Source
decode(tuple() | %{}) :: {:ok, any()} | {:error, any()}
decode(%{}) :: {:ok, any()} | {:error, any()}

Link to this function

decode64(input) View Source
decode64(%{}) :: tuple()

Link to this function

encode(input) View Source
encode(%{}) :: tuple()

Link to this function

encode64(error) View Source
encode64(tuple() | %{}) :: {:ok, any()} | {:error, any()}

Link to this function

equivalent?(params, sign) View Source
equivalent?({:error, String.t()}, String.t() | nil) :: {:error, String.t()}
equivalent?(%{}, String.t()) :: boolean()

Identifica si la tupla de la cadena firmada es válida de acuerdo al token enviado.

Ejemplo:


iex> alias ResuelveAuth.Utils.Secret
iex> data = {:error, "mensaje de error"}
iex> Secret.equivalent?(data, "data")
{:error, "mensaje de error"}

iex> alias ResuelveAuth.Utils.Secret
iex> data = %{valid: "datos"}
iex> Secret.equivalent?(data, "datos")
true
Link to this function

sign(data, options) View Source
sign(%{}, list()) :: String.t()

Firma la información con una semilla (secret) pasando primero por un proceso de códificación.