#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum GuardAction {
Allow,
Redact,
Warn,
ReRoute,
Block,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Finding {
pub kind: String,
pub action: GuardAction,
pub preview: String,
}
#[derive(Debug, Clone, Default)]
pub struct ScanReport {
pub findings: Vec<Finding>,
pub redacted_body: Option<Vec<u8>>,
pub images_stripped: usize,
}
pub trait ContentScanner {
fn scan(&self, body: &[u8], content_type: &str) -> ScanReport;
}
pub trait GuardPolicy {
fn action_for(&self, provider_id: &str, finding_kind: &str) -> GuardAction;
fn is_trusted(&self, provider_id: &str) -> bool;
}