Expand description
Privilege and authorization model for PL/SQL analysis.
Models authorization-relevant semantics by combining source-code annotations
(AUTHID, ACCESSIBLE BY) with catalog-derived grants and roles.
This crate is Layer 2 of the dependency graph — it depends on plsql-core
and plsql-catalog.
Structs§
- Access
Control Entry - Whether a unit is accessible by specific callers.
- Ambiguity
Feed Entry - One downstream-consumable ambiguity record.
- Authid
Distribution - Bucketed
AUTHIDdistribution. Pre-populated with zeros so consumers can rely on every bucket existing even when the count is 0. - Authorization
Ambiguity - An authorization that cannot be resolved statically because it depends on runtime role state.
- Cross
Schema Write - Cross-schema write — a unit writes to an object in a different schema.
- Doctor
Reason Row - Per-reason count row. Sorted by
reasonfor stable serialization. - Privilege
Config - Configuration for privilege resolution.
- Privilege
Doctor Report - Aggregated diagnostic counts for a single
PrivilegeModel. The shape is stable across versions — new fields are added behind#[serde(default)]so older snapshots keep deserializing. - Privilege
Model - Aggregated privilege model for an analysis run.
- Resolved
Privilege - Resolved privilege for a specific principal (user/role/public) on a specific object.
- Synonym
Privilege Path - A resolved privilege that was inferred through a synonym chain.
Enums§
- Authorization
Mode - Authorization mode for a PL/SQL compilation unit.
- Grant
Option - Whether a privilege grant can be further delegated.
- Privilege
Posture - Overall posture for the privilege model. Three-state by design —
Cautionis for anything that an agent should investigate;Unknownis reserved for cases where the model itself is suspect (e.g.runtime_ambiguitiesoutnumberprivileges).
Constants§
- AMBIGUITY_
EVIDENCE_ CODE - Stable evidence code so SAST rules / golden tests can match on it.
Functions§
- ambiguity_
feed - Build the flat ambiguity feed from a resolved
PrivilegeModel. - authorization_
mode_ for_ object - Determine the authorization mode for a PL/SQL unit from its catalog metadata.
- confidence_
ceiling_ for - The strongest confidence a result may claim when its authorization
hinges on
reason. Runtime role/grant state and invoker-rights resolution are genuinely undecidable without a live session, so they cap atLow; anything else we treat asOpaque(we don’t even know enough to call itLow). - doctor_
report - Build a
PrivilegeDoctorReportfrom aPrivilegeModel. - downgrade_
confidence - Cap
priorat the ceiling implied byreason. Never raises confidence — if the prior is already at/under the ceiling it is returned unchanged (only the explanation is appended). Ordering usesConfidenceLevel’s derivedOrdwhereHigh < Medium < Low < Opaque(a larger discriminant == less confident), so the capped level ismax(prior, ceiling). - resolve_
privileges - Resolve a privilege model from a catalog snapshot and configuration.