Validated policy matcher decision shared by user text and trusted hosts.
source identifies who supplied the evidence; lifecycle semantics depend
only on kind and label.
Summary
Functions
Validates and builds an accept or reject resolution.
Returns the compact {kind, label} representation accepted by lifecycle
policy commands.
Types
Functions
Validates and builds an accept or reject resolution.
kind must be :accept or :reject; label and source must be atoms;
metadata must be a map. The constructor returns an error tuple instead of
raising so host-supplied policy decisions can be rejected without mutating
state.
{:ok, resolution} =
Spectre.Policy.Resolution.new(
:accept,
:terms_accepted,
:host,
%{actor_id: "admin-1"}
)
Returns the compact {kind, label} representation accepted by lifecycle
policy commands.
{:accept, :terms_accepted} =
Spectre.Policy.Resolution.to_tuple(resolution)