1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # Dalfox-RS
//!
//! A type-safe, asynchronous Rust wrapper for the [Dalfox](https://github.com/hahwul/dalfox)
//! XSS Scanner.
//!
//! This crate orchestrates the Dalfox XSS scanner binary, streaming its JSON output directly into
//! heavily typed Rust structs, making XSS scanning inside Rust projects
//! highly composable with typed results and explicit error handling.
//!
//! ## Features
//!
//! - **Dalfox v3 CLI**: scan, file, and pipe modes with typed builder configuration.
//! - **JSON envelope parsing**: batch scans deserialize `findings` from one JSON document.
//! - **Streaming callbacks**: `*_streaming` methods use `--format jsonl` for per-finding lines.
//! - **Stored XSS**: `--sxss` / `--sxss-url` support on `dalfox scan`.
//! - **Multi-format output**: JSON, CSV, Markdown, and plain text.
//! - **Diagnostic capture**: stderr, parse errors, exit codes all preserved.
//!
//! ## Example
//!
//! ```rust,no_run
//! use dalfox_rs::{Dalfox, DalfoxResult};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let runner = Dalfox::builder()
//! .request_timeout(10)
//! .scan_deadline(300)
//! .workers(50)
//! .build();
//!
//! let result: DalfoxResult = runner.scan_url("http://example.com?q=test").await?;
//!
//! for finding in &result.findings {
//! println!("Found XSS! {}", finding);
//! }
//!
//! // Check for parse issues (schema changed?)
//! if result.has_parse_errors() {
//! eprintln!("Warning: {} lines failed to parse", result.parse_errors.len());
//! }
//!
//! Ok(())
//! }
//! ```
/// Builder configuration for Dalfox scanning.
/// Error variants specific to Dalfox execution.
/// The core asynchronous executor and scan modes.
/// Strictly-typed structs for Dalfox's JSON response, enums, and output formatting.
pub use DalfoxBuilder;
pub use DalfoxError;
pub use DalfoxRunner;
pub use ;
/// Entry point to configure a Dalfox scan.
///
/// # Examples
///
/// ```rust
/// use dalfox_rs::Dalfox;
///
/// let runner = Dalfox::builder()
/// .request_timeout(10)
/// .workers(50)
/// .build();
/// ```
;