Auctoritas v0.2.1 Auctoritas.Config View Source

Link to this section Summary

Functions

Create new config for Auctoritas

Read Auctoritas config from config files

Link to this section Functions

Link to this function

new(options \\ []) View Source
new([]) :: %Auctoritas.Config{
  data_storage: term(),
  expiration: term(),
  name: term(),
  token_manager: term()
}

Create new config for Auctoritas

Arguments:

  • secret_key: Secret key to use when generating authentication tokens.
  • data_storage: Data storage module to save data and manage authentication tokens. (DEFAULT value exists)
  • token_manager: Token manager module to generate and read tokens. (DEFAULT value exists)

Examples

iex> Auctoritas.Config.new()
%Auctoritas.Config{
  name: "auctoritas_default",
  data_storage: Auctoritas.AuthenticationManager.DataStorage,
  token_manager: Auctoritas.AuthenticationManager.DefaultTokenManager,
  expiration: 86400
}

iex> Auctoritas.Config.new(name: "custom_name")
%Auctoritas.Config{
  name: "custom_name",
  data_storage: Auctoritas.AuthenticationManager.DataStorage,
  token_manager: Auctoritas.AuthenticationManager.DefaultTokenManager,
  expiration: 86400
}
Link to this function

read() View Source
read() :: %Auctoritas.Config{
  data_storage: term(),
  expiration: term(),
  name: term(),
  token_manager: term()
}

Read Auctoritas config from config files