View Source Momento.Auth.CredentialProvider (Momento Elixir SDK v0.2.0)
Handles decoding and managing Momento authentication credentials.
Link to this section Summary
Functions
Fetches the given environment variable and parses it into a credential.
Parses the given string into a credential.
Link to this section Types
@opaque t()
Link to this section Functions
@spec from_env_var!( env_var :: String.t(), opts :: [control_endpoint: String.t(), cache_endpoint: String.t()] ) :: t()
Fetches the given environment variable and parses it into a credential.
Returns the credential or raises an exception.
Supply control_endpoint or cache_endpoint in the options to override them.
examples
Examples
iex> Momento.Auth.CredentialProvider.from_env_var!("MOMENTO_AUTH_TOKEN")
%Momento.Auth.CredentialProvider{}
Parses the given string into a credential.
Returns the credential or raises an exception.
Supply control_endpoint or cache_endpoint in the options to override them.
examples
Examples
iex> valid_token = "valid_token" # This should be a valid Momento auth token.
iex> Momento.Auth.Credential.from_string!(valid_token)
%Momento.Auth.Credential{}