Karta.Audit (Karta v1.0.0)

The record of what people and API keys did to the records of a server: the actions on messages (Karta.Outbound.Actions) so far. An event says who acted (actor/2), what they did, to which record, and the particulars; it is written in the transaction of the action, so an action that did not happen leaves no event, and one that happened always does. Events are never changed; they go with their server.

Summary

Functions

The actor of a signed-in user (:user) or an API key (:api_key).

The events about a record, oldest first, at most limit (default 100).

Records that actor did action to the record subject of type ("message"), with details (a map of text and numbers), at now.

Types

actor()

@type actor() :: %{kind: String.t(), id: Ecto.UUID.t() | nil, label: String.t() | nil}

Functions

actor(atom, arg2)

@spec actor(
  :user | :api_key,
  Karta.Accounts.User.t() | Karta.Credentials.Credential.t()
) :: actor()

The actor of a signed-in user (:user) or an API key (:api_key).

for_subject(subject_id, limit \\ 100)

@spec for_subject(Ecto.UUID.t(), pos_integer()) :: [Karta.Audit.Event.t()]

The events about a record, oldest first, at most limit (default 100).

record(server, actor, action, type, subject_id, details, now)

Records that actor did action to the record subject of type ("message"), with details (a map of text and numbers), at now.