Services.Approvals.Gate (fnord v0.8.82)
View SourceMinimal in-memory approvals gate for sensitive "finalize" steps (M4).
Provides a tiny API:
require/2requests approval (:approvedor{:pending, ref})approve/1anddeny/2control a pending referencestatus/1andlist/0allow inspection
Policy:
- Reads
"approvals" -> "mcp_auth_finalize"fromSettings. - Default:
"auto_approve"."require_approval"returns pending.
Usage:
- Insert a single checkpoint before writing sensitive data (e.g., tokens).
- Return pending +
refand instruct operators to use the CLI to approve.
Introduced: M4.
Summary
Functions
Approve a pending reference.
Returns a specification to start this module under a supervisor.
Deny a pending reference with a reason.
List all current approvals tracked in memory.
Require approval for a resource. Returns :approved immediately when policy is auto_approve; otherwise returns {:pending, ref}.
Get status of a reference.
Types
Functions
@spec approve(ref()) :: :ok | {:error, :not_found}
Approve a pending reference.
Returns a specification to start this module under a supervisor.
See Supervisor.
Deny a pending reference with a reason.
@spec list() :: [map()]
List all current approvals tracked in memory.
Require approval for a resource. Returns :approved immediately when policy is auto_approve; otherwise returns {:pending, ref}.
Get status of a reference.