pub struct AllowConfig {
pub schema_version: String,
pub policy: String,
pub owner: Option<String>,
pub status: Option<String>,
pub workspace: WorkspaceConfig,
pub requirements: Requirements,
pub lanes: BTreeMap<String, LaneConfig>,
pub allow: Vec<AllowEntry>,
}Fields§
§schema_version: String§policy: String§owner: Option<String>§status: Option<String>§workspace: WorkspaceConfig§requirements: Requirements§lanes: BTreeMap<String, LaneConfig>§allow: Vec<AllowEntry>Implementations§
Source§impl AllowConfig
impl AllowConfig
pub fn empty() -> Self
pub fn lane_enforcement_mode_for_kind( &self, kind: FindingKind, ) -> LaneEnforcementMode
Sourcepub fn validate(&self) -> CargoAllowResult<()>
pub fn validate(&self) -> CargoAllowResult<()>
Validate the core invariants of this config: a non-empty, supported
schema_version; a non-empty, recognized policy name; an optional
but recognized status; and a workspace.default_mode that parses as a
known WorkspaceMode.
This is the core-level validation entrypoint so that programmatic
consumers of allow-core (building an AllowConfig directly, not via
the TOML loader) get the same fail-closed feedback as a loaded policy.
It codifies only the invariants the core data model owns; the
allow-policy layer extends this with scope/glob/entry checks.
Aggregates every problem into one error (rather than short-circuiting on the first), so an adopter sees the full list in a single run.
Sourcepub fn validation_errors(&self) -> Vec<CargoAllowError>
pub fn validation_errors(&self) -> Vec<CargoAllowError>
Collect every core-level validation error for this config. Public to the
crate family so allow-policy can fold core invariants into its own
aggregated validation without re-implementing them.
Trait Implementations§
Source§impl Clone for AllowConfig
impl Clone for AllowConfig
Source§fn clone(&self) -> AllowConfig
fn clone(&self) -> AllowConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more