View Source Assent (Assent v0.3.0)

Multi-provider authentication framework.

Features

Summary

Functions

Fetches the key value from the configuration.

Fetches the key value from the params.

Fetches the JSON library in config.

Functions

fetch_config(config, key)

@spec fetch_config(Keyword.t(), atom()) ::
  {:ok, any()} | {:error, Assent.MissingConfigError.t()}

Fetches the key value from the configuration.

Returns a Assent.MissingConfigError if the key is not found.

fetch_param(params, key)

@spec fetch_param(map(), binary()) ::
  {:ok, any()} | {:error, Assent.MissingParamError.t()}

Fetches the key value from the params.

Returns a Assent.MissingParamError if the key is not found.

json_library(config)

@spec json_library(Keyword.t()) :: module()

Fetches the JSON library in config.

If not found in provided config, this will attempt to load the JSON library from global application environment for :assent. Defaults to JSON.