Spectre.Reflection.Policy (Spectre v0.3.0)

Copy Markdown View Source

Host-owned authorization policy for the Reflection operation.

Policies are compiled configuration. Runtime Skill data can request an inspection, but cannot supply or weaken this policy.

Summary

Functions

Authorizes one exact actor and purpose. Empty allowlists deny all.

Builds a closed Reflection policy.

Builds a policy or raises with its stable validation reason.

Types

t()

@type t() :: %Spectre.Reflection.Policy{
  actor_refs: [String.t()],
  max_evidence: pos_integer(),
  purposes: [String.t()]
}

Functions

authorize(policy, actor_ref, purpose)

@spec authorize(t(), term(), term()) :: :ok | {:error, term()}

Authorizes one exact actor and purpose. Empty allowlists deny all.

new(policy)

@spec new(t() | map() | keyword()) :: {:ok, t()} | {:error, term()}

Builds a closed Reflection policy.

new!(attrs)

@spec new!(map() | keyword()) :: t()

Builds a policy or raises with its stable validation reason.