Expand description
Testable CLI logic for pgroles.
All pure functions that don’t require a live database connection live here.
The binary (main.rs) delegates to these, making validation, plan formatting,
and output rendering fully unit-testable.
Structs§
- Plan
Summary - Summary statistics for a plan.
- Validated
Manifest - The result of successfully validating a manifest.
Functions§
- apply_
role_ retirements - Insert explicit retirement actions before any matching role drops.
- compute_
plan - Compute the list of changes needed to bring
currentstate todesiredstate. - format_
plan_ json - Format a plan as JSON for machine consumption.
- format_
plan_ sql - Format a plan as SQL statements.
- format_
plan_ sql_ with_ context - Format a plan as SQL statements using an explicit SQL context.
- format_
role_ graph_ summary - Format a RoleGraph as a human-readable summary.
- format_
validation_ result - Format validation results for human-readable output.
- parse
- Parse and validate a YAML string into a
PolicyManifest. - parse_
and_ expand - Parse, validate, and expand a manifest YAML string into an
ExpandedManifest. - planned_
role_ drops - Collect the role names that the current plan intends to drop.
- read_
manifest_ file - Read a manifest file from disk and return the raw YAML string.
- validate_
manifest - Full validation: parse, expand, and build a RoleGraph from a manifest string. Returns the expanded manifest and the desired RoleGraph.