Kingfisher can now generate an auditor-friendly HTML report

This commit is contained in:
Mick Grove 2026-02-15 14:29:42 -08:00
commit 39a4e217e3
23 changed files with 958 additions and 30 deletions

View file

@ -52,6 +52,9 @@ pub enum ReportOutputFormat {
/// SARIF format (experimental)
Sarif,
/// Standalone HTML audit report
Html,
}
// -----------------------------------------------------------------------------

View file

@ -1,5 +1,6 @@
use std::{
net::SocketAddr,
net::TcpListener as StdTcpListener,
path::{Path, PathBuf},
sync::Arc,
};
@ -44,6 +45,17 @@ struct AppState {
report: Option<Vec<u8>>,
}
pub fn ensure_port_available(port: u16) -> Result<()> {
StdTcpListener::bind(("127.0.0.1", port)).map_err(|err| match err.kind() {
std::io::ErrorKind::AddrInUse => anyhow!(
"Port {} is already in use. Re-run with --port <PORT> to choose a different port.",
port
),
_ => err.into(),
})?;
Ok(())
}
/// Run the `kingfisher view` subcommand.
pub async fn run(args: ViewArgs) -> Result<()> {
let report = if let Some(report_bytes) = args.report_bytes.as_ref() {