Skip to main content

allow_core/
lib.rs

1//! Core data model for cargo-allow source-tree exception governance.
2//!
3//! This crate defines the shared finding, policy-entry, selector, lifecycle,
4//! match-outcome, path-normalization, and stable fingerprint primitives used by
5//! the cargo-allow crate family. It does not scan source files, invoke Cargo,
6//! compile code, or execute repository artifacts.
7
8mod date;
9mod error;
10mod finding;
11mod fingerprint;
12mod json;
13mod policy;
14mod source_tree_path;
15pub use date::SimpleDate;
16pub use error::{CargoAllowError, CargoAllowResult};
17pub use finding::{
18    Finding, FindingKind, STRUCTURAL_IDENTITY_SCHEMA_ID, Span, StructuralIdentity,
19    finding_identity_key,
20};
21pub use fingerprint::{maybe_line_distance_score, normalize_snippet, stable_hash_hex};
22pub use json::json_escape;
23pub use policy::{
24    AllowConfig, AllowEntry, LastSeen, Lifecycle, MatchOutcome, MatchStatus, Requirements,
25    Selector, WorkspaceConfig,
26};
27pub use source_tree_path::{
28    allow_entry_broad_scope, glob_matches, glob_matches_str, normalize_path,
29    source_tree_path_is_ignored, source_tree_path_matches_filter, source_tree_scope_has_wildcard,
30};
31
32#[cfg(test)]
33mod tests;