Ueberauth.Strategy.Mastodon.Secret (ueberauth_mastodon v0.2.0) View Source
Functions for dealing with configuration secrets.
Link to this section Summary
Types
Tuple in the form {module, function_name, args}
.
Parsed into a string at runtime.
A configuration secret.
Either a mfa_secret/0
, a function, or a string.
Link to this section Types
Specs
Tuple in the form {module, function_name, args}
.
Parsed into a string at runtime.
Example:
{System, :get_env, ["SECRET_KEY"]}
Specs
secret() :: mfa_secret() | function() | String.t()
A configuration secret.
Either a mfa_secret/0
, a function, or a string.
Link to this section Functions
Specs
Accepts a secret/0
and returns a tuple with the parsed string.
Useful for runtime configuration.
Example:
iex(1)> parse_secret({System, :get_env, ["SECRET_KEY"]})
{:ok, "12345678"}
iex(2)> parse_secret(nil)
{:error, nil}