1pub mod allowlist;
10pub mod banner;
11pub mod config;
13mod dedup;
14mod finding;
15pub mod report;
16mod source;
17mod spec;
18use std::borrow::Cow;
19
20pub mod registry;
21
22pub use allowlist::*;
23pub use config::*;
24pub use dedup::*;
25pub use finding::*;
26pub use report::*;
27pub use source::*;
28pub use spec::*;
29
30mod embedded {
33 include!(concat!(env!("OUT_DIR"), "/embedded_detectors.rs"));
34}
35
36pub fn embedded_detector_tomls() -> &'static [(&'static str, &'static str)] {
39 embedded::EMBEDDED_DETECTORS
40}
41
42pub fn redact(s: &str) -> Cow<'static, str> {
44 let char_count = s.chars().count();
45
46 if char_count <= 8 {
47 return Cow::Borrowed("****");
48 }
49
50 let first_four: String = s.chars().take(4).collect();
51 let last_four: String = s.chars().skip(char_count.saturating_sub(4)).collect();
52
53 Cow::Owned(format!("{}...{}", first_four, last_four))
54}