Chronicle.Identity (cratis_chronicle v0.2.0)

Copy Markdown View Source

Represents the identity that caused a state change.

Summary

Functions

Returns the sentinel identity for explicitly unset identity values.

Returns the default system identity.

Returns the sentinel identity for unknown identity values.

Removes duplicate subjects from an on-behalf-of identity chain.

Types

t()

@type t() :: %Chronicle.Identity{
  name: String.t(),
  on_behalf_of: t() | nil,
  subject: String.t(),
  user_name: String.t()
}

Functions

new(subject, name, user_name \\ "", on_behalf_of \\ nil)

@spec new(String.t(), String.t(), String.t(), t() | nil) :: t()

Creates a new identity.

not_set()

@spec not_set() :: t()

Returns the sentinel identity for explicitly unset identity values.

system()

@spec system() :: t()

Returns the default system identity.

unknown()

@spec unknown() :: t()

Returns the sentinel identity for unknown identity values.

without_duplicates(identity)

@spec without_duplicates(t()) :: t()

Removes duplicate subjects from an on-behalf-of identity chain.

Keeps the first occurrence of each subject.