Skip to main content

Crate pgroles_cli

Crate pgroles_cli 

Source
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§

PlanSummary
Summary statistics for a plan.
ValidatedManifest
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 current state to desired state.
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.