View Source Rivet.Ident.Factor.Lib (rivet_ident v2.4.0)

Summary

Types

@type auth_result() :: {:ok | :error, Rivet.Auth.Domain.t()}
@type ecto_p_result() :: {:ok | :error, Ecto.Changeset.t()}
@type log_msg() :: str()
@type model_p_result() :: {:ok, Rivet.Ident.Factor.t()}
@type str() :: String.t()
@type usr_msg() :: str()

Functions

Link to this function

all_not_expired!(user, type)

View Source
Link to this function

clean_password_history(user_id, excluding_id)

View Source
Link to this function

preloaded_with(user, type)

View Source

Preload factors for a related model, with criteria, and only unexpired factors

Ident.Factor.Lib.preloaded_with(model, type)
@spec set_factor(user :: Rivet.Ident.User.t(), fedid :: Rivet.Ident.Factor.FedId.t()) ::
  {:ok, Rivet.Ident.Factor.t()} | {:error, Ecto.Changeset.t()}
Link to this function

set_password(user, password, overrides \\ %{})

View Source

set a password

Future change:

change Ident.Factors so there is an archive state, some types when being cleaned are archived instead of deleted (such as passwords).

Then Auth.Signin.Local.load_password_factor should filter on !archived

Link to this function

strong_password(password)

View Source

iex> strong_password("<KO)(IJM,ko09ijm") :ok iex> strong_password("boo")

iex> strong_password("<ko)(ijm,ko09ijm")

iex> strong_password("KOIJMko09ijm")

iex> strong_password("<KO)(IJM,koijm")

iex> strong_password("<)(,)(*&^%$#@><")