dd-sensitive-data-scanner 0.0.0

Core Sensitive Data Scanner library for detecting and redacting sensitive information.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::RuleMatch;
use crate::scanner::RootCompiledRule;
use rayon::{ThreadPool, ThreadPoolBuilder};
use std::sync::LazyLock;
use std::vec::Vec;

/// A locally configured thread pool is used for Rayon to prevent conflicts with other libraries
/// that might override the (default) global thread pool with different (potentially undesirable) settings
pub static RAYON_THREAD_POOL: LazyLock<ThreadPool> =
    LazyLock::new(|| ThreadPoolBuilder::new().build().unwrap());

pub trait MatchValidator: Send + Sync {
    // Trait use to validate the matches and update the match status
    // It requires the matches found by the scans and the scanner rules to retrieve the match validation type
    fn validate(&self, matches: &mut Vec<RuleMatch>, scanner_rules: &[RootCompiledRule]);
}