simple-waf-scanner 0.1.6

Production-ready WAF scanner with OWASP Top 10:2025 Web & LLM support. 360+ payloads including LLM/GenAI testing (prompt injection, jailbreaks, system prompt leakage). HTTP/2, 11+ WAF fingerprints, 13 evasion techniques.
Documentation
use thiserror::Error;

/// Errors that can occur during WAF scanning operations
#[derive(Error, Debug)]
pub enum ScanError {
    /// HTTP request failed
    #[error("HTTP request failed: {0}")]
    HttpError(#[from] reqwest::Error),

    /// Failed to parse JSON data
    #[error("Failed to parse JSON: {0}")]
    ParseError(#[from] serde_json::Error),

    /// Invalid configuration
    #[error("Invalid configuration: {0}")]
    ConfigError(String),

    /// IO operation failed
    #[error("IO error: {0}")]
    IoError(#[from] std::io::Error),

    /// Invalid payload format
    #[error("Invalid payload format: {0}")]
    InvalidPayload(String),

    /// No payloads loaded
    #[error("No payloads available for scanning")]
    NoPayloads,

    /// URL parsing error
    #[error("Invalid URL: {0}")]
    UrlError(String),
}

/// Result type for scanner operations
pub type Result<T> = std::result::Result<T, ScanError>;