Coherence.Authentication.Basic (Coherence v0.8.0)

Implements basic HTTP authentication. To use add:

plug Coherence.Authentication.Basic, realm: "Secret world"

to your pipeline.

This module is derived from https://github.com/bitgamma/plug_auth which is derived from https://github.com/lexmag/blaguth

Summary

Functions

Callback implementation for Plug.call/2.

Returns the encoded form for the given user and password combination.

Callback implementation for Plug.init/1.

Update login store for a user. user_data can be any term but must not be nil.

Types

@type conn() :: Plug.Conn.t()
@type t() :: Ecto.Schema.t() | map()

Functions

Link to this function

call(conn, opts)

@spec call(conn(), Keyword.t()) :: conn()

Callback implementation for Plug.call/2.

Link to this function

create_login(email, password, user_data, opts \\ [])

@spec create_login(String.t(), String.t(), t(), keyword()) :: t()
Link to this function

encode_credentials(user, password)

@spec encode_credentials(atom() | String.t(), String.t() | nil) ::
  Coherence.CredentialStore.Types.credentials()

Returns the encoded form for the given user and password combination.

@spec init(Keyword.t()) :: map()

Callback implementation for Plug.init/1.

Link to this function

update_login(email, password, user_data, opts \\ [])

@spec update_login(String.t(), String.t(), t(), keyword()) :: t()

Update login store for a user. user_data can be any term but must not be nil.