pub struct SuggestOptions {
pub min_schemas: usize,
pub full_inventory: Option<Inventory>,
}Expand description
Knobs for the suggester. The defaults are conservative.
Fields§
§min_schemas: usizeMinimum number of distinct schemas a candidate cluster must span before
it becomes a profile. Below this, the original flat roles are kept.
Default 2 — a profile with one schema is just an indirection.
full_inventory: Option<Inventory>Complete object inventory (schema, object_type) → set of names,
as observed in the live database (i.e. from
[pgroles_inspect::fetch_object_inventory]). When provided, the
suggester collapses per-name grants into wildcards (name: "*") for
(schema, object_type) buckets where a role covers every object,
which is what makes profile clustering across schemas useful for
pgroles generate output (Postgres expands GRANT … ON ALL TABLES
into per-relation rows).
Why required: a grant-derived inventory would treat ungranted
objects as nonexistent. A role granted on every currently-granted
table would collapse to name: "*", and applying the suggested
manifest would silently grant on previously-ungranted tables —
broadening privileges beyond the original manifest’s intent. With a
real introspected inventory we know what exists vs what’s
granted, so the collapse is sound.
None (default) disables wildcard collapse entirely. Roles only
cluster when their grants reference identical literal names.
Trait Implementations§
Source§impl Clone for SuggestOptions
impl Clone for SuggestOptions
Source§fn clone(&self) -> SuggestOptions
fn clone(&self) -> SuggestOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more