Rivet.Ident.Factor.Lib (rivet_ident v3.5.0)

View Source

Summary

Types

auth_result()

@type auth_result() :: {:ok | :error, Rivet.Auth.Domain.t()}

ecto_p_result()

@type ecto_p_result() :: {:ok | :error, Ecto.Changeset.t()}

log_msg()

@type log_msg() :: str()

model_p_result()

@type model_p_result() :: {:ok, Rivet.Ident.Factor.t()}

str()

@type str() :: String.t()

usr_msg()

@type usr_msg() :: str()

Functions

all_not_expired!(user)

all_not_expired!(user, type)

clean_password_history(user_id, excluding_id)

drop_expired()

get(factor_id)

get_user(factor_id)

preloaded_with(user, type)

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

Ident.Factor.Lib.preloaded_with(model, type)

set_factor(user, fedid)

@spec set_factor(user :: Rivet.Ident.User.t(), fedid :: Rivet.Ident.Factor.FedId.t()) ::
  {:ok, Rivet.Ident.Factor.t()} | {:error, Ecto.Changeset.t()}

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

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

strong_password(password)

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("<)(,)(*&^%$#@><")