Value object representing the actor who performed an audited operation.
Implements Ecto.ParameterizedType for use as a JSONB field in Ecto schemas.
Stored as %{"type" => "user", "id" => "123"} in PostgreSQL; loaded back
as %ActorRef{type: :user, id: "123"} in Elixir.
Actor types
:user— end user with a non-empty id:admin— administrator with a non-empty id:service_account— service account with a non-empty id:job— background job with a non-empty id:system— system process with a non-empty id:anonymous— unauthenticated actor; id is nil
Summary
Functions
Deserializes an ActorRef from a plain map. Returns {:ok, ref} or {:error, reason}.
Constructs a validated ActorRef.
Serializes an ActorRef to a plain map for JSONB storage.
Functions
Deserializes an ActorRef from a plain map. Returns {:ok, ref} or {:error, reason}.
Constructs a validated ActorRef.
Returns {:ok, %ActorRef{}} or {:error, reason} where reason is one of:
:unknown_actor_type— type not in the supported list:missing_actor_id— non-anonymous actor with nil or empty id
Serializes an ActorRef to a plain map for JSONB storage.