//! Where an uploaded file is in the malware scan. use super::str_enum::impl_str_enum; use serde::{Deserialize, Serialize}; // --- File scanning --- /// Status of an uploaded file in the scan pipeline. /// /// `Pending`, accepted, waiting in `scan_jobs` queue for a worker. /// `Scanning`, worker has claimed the job and is running the pipeline. /// `Clean`, pipeline completed, no Fail verdicts, no fail-closed Errors. /// `HeldForReview`, pipeline completed with a fail-closed Error, OR the /// uploader is untrusted (every untrusted upload routes to admin review). /// `Quarantined`, pipeline returned a Fail verdict on at least one layer. /// `Error`, pipeline itself crashed (worker exception, S3 fetch failed, etc.). /// /// Transitions are driven by `crate::scanning::final_status` and applied by /// `crate::scanning::worker`; `Pending` is the only entry state. #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum FileScanStatus { Pending, Scanning, Clean, Quarantined, HeldForReview, Error, } impl_str_enum!(FileScanStatus { Pending => "pending", Scanning => "scanning", Clean => "clean", Quarantined => "quarantined", HeldForReview => "held_for_review", Error => "error", });