Skip to main content

truman_core/
lib.rs

1//! `truman-core`: core types, traits, filters, and scanner.
2//!
3//! This crate holds everything detector-agnostic: findings with exact
4//! positions, the [`Detector`] trait + [`DetectorRegistry`], file-type
5//! detection, the staged [`FilterSet`] pipeline, entropy helpers, and the
6//! parallel [`Scanner`]
7
8pub mod detector;
9pub mod entropy;
10pub mod error;
11pub mod filetype;
12pub mod filter;
13pub mod finding;
14mod prefilter;
15pub mod scanner;
16
17pub use detector::{Detector, DetectorContext, DetectorRegistry, RawFinding};
18pub use entropy::{
19    base64_shannon_entropy, hex_shannon_entropy, shannon_entropy, shannon_entropy_bytes,
20};
21pub use error::{Result, TrumanError};
22pub use filetype::{determine_file_type, FileType};
23pub use filter::{
24    is_allowlisted, is_indirect_reference, is_invalid_file, is_likely_id_string,
25    is_likely_id_string_at, is_lock_file, is_non_text_file, is_not_alphanumeric_string,
26    is_potential_uuid, is_prefixed_with_dollar_sign, is_regex_based_detector, is_sequential_string,
27    is_swagger_file, is_templated_secret, should_exclude_due_to_verification_policy,
28    should_exclude_file, should_exclude_line, should_exclude_secret, FileFilter, FilterConfig,
29    FilterSet, LineFilter, SecretFilter,
30};
31pub use finding::{Finding, Location, Span, VerifiedResult};
32pub use scanner::{hash_secret, scan_paths_streaming, FileStats, ScanConfig, ScanEvent, Scanner};
33
34/// Crate version (mirrors workspace version).
35pub const VERSION: &str = env!("CARGO_PKG_VERSION");