A preprocessing step in a Parc.Pipeline. A preparer reads a Parc.Request
and either continues with a (possibly transformed) request or aborts the whole
evaluation with an error. It runs before the decider and cannot decide; only
Parc.PolicyDecider returns a verdict.
A preparer may add context facts, emit telemetry, validate inputs, or trace:
anything that prepares (or observes) the request ahead of the decision.
Steps run in declaration order; declare them with prepare (see Parc.Pipeline).
Return values:
{:cont, request}: continue with this request. Fail-soft belongs here. A preparer that cannot resolve a fact leaves the key absent and continues, so the decider denies on the missing fact.{:error, reason}: abort, fail-hard. The preparer was unable to complete its security-required processing. The pipeline short-circuits, the decider is never consulted, andreasonsurfaces a genuine failure, distinct from a deny.
Summary
Types
@type result() :: {:cont, Parc.Request.t()} | {:error, term()}
Callbacks
@callback call(request :: Parc.Request.t(), opts :: keyword()) :: result()