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
//! Minimal gqlprobe library example. //! //! Run: `cargo run --example quick_scan -- https://api.example.com/graphql` use gqlprobe::Scanner; #[tokio::main] async fn main() -> anyhow::Result<()> { let url = std::env::args() .nth(1) .unwrap_or_else(|| "https://countries.trevorblades.com/graphql".to_string()); eprintln!("Scanning {url} (authorized targets only)…"); let scanner = Scanner::new(&url)?; let findings = scanner.scan().await?; if findings.is_empty() { println!("No issues reported."); } else { for f in &findings { println!("[{:?}] {} - {}", f.severity(), f.title(), f.detail()); } } Ok(()) }