AuthShield v0.0.4 AuthShield.Resources.Schemas.User View Source

Defines all the user fields and its relations.

The user is a resource and an subject that makes requests to the systems and is used on authentication and authorization request.

We do not save users password, only the encripted hash that will be used to authenticate in password based forms.

Link to this section Summary

Types

t()

Abstract user module type.

Functions

Generates an Ecto.Changeset struct with the changes.

Generates an Ecto.Changeset struct with the changes.

Generates an Ecto.Changeset struct with the changes.

Generates an Ecto.Changeset struct with the changes.

Generates an Ecto.Changeset struct with the changes.

Link to this section Types

Link to this type

t()

View Source
t() :: %AuthShield.Resources.Schemas.User{
  __meta__: term(),
  email: String.t(),
  first_name: String.t(),
  id: binary(),
  inserted_at: NaiveDateTime.t(),
  is_active: boolean(),
  last_name: String.t(),
  locked_until: NaiveDateTime.t(),
  password_credential: AuthShield.Credentials.Schemas.Password.t(),
  pin_credential: AuthShield.Credentials.Schemas.PIN.t(),
  roles: [AuthShield.Resources.Schemas.Role.t()],
  totp_credential: AuthShield.Credentials.Schemas.TOTP.t(),
  updated_at: NaiveDateTime.t()
}

Abstract user module type.

Link to this section Functions

Link to this function

changeset_insert(model, params)

View Source
changeset_insert(model :: t(), params :: map()) :: Ecto.Changeset.t()

Generates an Ecto.Changeset struct with the changes.

It defines validations and also generates the password hash if necessary.

Link to this function

changeset_locked_until(model, params)

View Source
changeset_locked_until(model :: t(), params :: map()) :: Ecto.Changeset.t()

Generates an Ecto.Changeset struct with the changes.

THIS ONLY ACCEPTS the locked_until field.

Link to this function

changeset_roles(model, roles)

View Source
changeset_roles(
  model :: t(),
  roles :: [AuthShield.Resources.Schemas.Role.t()]
) :: Ecto.Changeset.t()

Generates an Ecto.Changeset struct with the changes.

It changes the related roles list.

Link to this function

changeset_status(model, params)

View Source
changeset_status(model :: t(), params :: map()) :: Ecto.Changeset.t()

Generates an Ecto.Changeset struct with the changes.

THIS ONLY ACCEPTS the is_active field.

Link to this function

changeset_update(model, params)

View Source
changeset_update(model :: t(), params :: map()) :: Ecto.Changeset.t()

Generates an Ecto.Changeset struct with the changes.

THIS DOES NOT CHANGE THE password and is_active.