PhoenixKit.API.Actor (phoenix_kit v2.63.0)

Copy Markdown View Source

Who is calling the API: a key (with its owner and effective scopes) or an anonymous public caller.

  • kind - :key for a verified bearer key, :anonymous for a public caller.
  • key_uuid, key_prefix - the key, when there is one.
  • user_uuid - the key's owner.
  • scopes - the key's effective scopes (its own, filtered by the owner's live permissions).
  • requires_approval - the key's dangerous operations wait for a human.
  • cart_token_hash - the hashed cart token of an anonymous public caller.
  • ip - the address the request came from, as a string.

The default is the least-privileged value: anonymous, no scopes, no approval.

Summary

Types

t()

@type t() :: %PhoenixKit.API.Actor{
  cart_token_hash: String.t() | nil,
  ip: String.t() | nil,
  key_prefix: String.t() | nil,
  key_uuid: String.t() | nil,
  kind: :key | :anonymous,
  requires_approval: boolean(),
  scopes: [String.t()],
  user_uuid: String.t() | nil
}