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 capped_read;
9mod date;
10mod error;
11mod finding;
12mod fingerprint;
13mod json;
14mod lane_posture;
15mod ledger_posture;
16mod ledger_provenance;
17mod policy;
18mod source_tree_path;
19pub use capped_read::{
20    CappedReadError, SOURCE_FILE_READ_MAX_BYTES, read_text_file_capped,
21    read_text_file_capped_with_limit,
22};
23pub use date::SimpleDate;
24pub use error::{
25    CargoAllowDiagnostic, CargoAllowDiagnosticSeverity, CargoAllowError, CargoAllowErrorKind,
26    CargoAllowErrorLocation, CargoAllowResult,
27};
28pub use finding::{
29    Finding, FindingKind, MAX_IDENTITY_FIELD_LEN, STRUCTURAL_IDENTITY_SCHEMA_ID, Span,
30    StructuralIdentity, finding_identity_key,
31};
32pub use fingerprint::{allow_entry_content_fingerprint, normalize_snippet, stable_hash_hex};
33pub use json::json_escape;
34pub use lane_posture::{
35    LaneConfig, LaneEnforcementMode, effective_lane_posture_for_findings,
36    lane_enforcement_mode_for_kind,
37};
38pub use ledger_posture::{LedgerPosture, NetPosture, PostureDelta, PresenceMovement};
39pub use ledger_provenance::LedgerProvenance;
40pub use policy::{
41    AllowConfig, AllowEntry, LastSeen, Lifecycle, MatchOutcome, MatchStatus, POLICY_NAME,
42    Requirements, SUPPORTED_SCHEMA_VERSION, SUPPORTED_SCHEMA_VERSION_ALIAS, Selector,
43    WorkspaceConfig, WorkspaceMode,
44};
45pub use source_tree_path::{
46    GLOB_MATCH_MAX_STEPS, allow_entry_broad_scope, glob_matches, glob_matches_str, normalize_path,
47    source_tree_path_is_ignored, source_tree_path_matches_filter, source_tree_scope_has_wildcard,
48};
49
50#[cfg(test)]
51mod tests;