howdy/auth/user

Small facts about a user, such as a username, fit howdy/auth/field. Anything relational belongs in application tables keyed by user ID.

Types

Who performed a privileged operation, recorded with its audit event. System is trusted code acting for nobody: provisioning, scheduled jobs. SystemFrom is the same, with a client to record for an operator request that arrived over some transport of the application’s own.

pub type Actor {
  System
  Acting(Principal)
  SystemFrom(client: String)
}

Constructors

  • System
  • Acting(Principal)
  • SystemFrom(client: String)

A verified session. Roles are intentionally absent: authorization reads current grants rather than retaining stale permissions in a session. client is where this request came from, as the caller identified it; it is recorded with the audit events the principal causes. It is empty when the transport did not supply one.

pub type Principal {
  Principal(user: User, session_id: String, client: String)
}

Constructors

  • Principal(user: User, session_id: String, client: String)

group_id is the one group the user belongs to; see howdy/auth/group. updated_at moves when the user is suspended or resumed, changes group, or has a field changed; credentials and sessions do not move it. Both are whole seconds. created_at is the epoch for a user who predates it and whose registration has been pruned from the audit trail. locale is the BCP 47 tag pages and emails use for the user, such as de: the locale they registered in, or one they chose; None for a user who predates it or was provisioned without one.

pub type User {
  User(
    id: String,
    email: String,
    group_id: String,
    created_at: timestamp.Timestamp,
    updated_at: timestamp.Timestamp,
    locale: option.Option(String),
  )
}

Constructors

Values

pub fn to_json(user: User) -> json.Json
✨ Search Document