forked from mirrors/kingfisher
Kingfisher can now generate an auditor-friendly HTML report
This commit is contained in:
parent
470120369b
commit
39a4e217e3
23 changed files with 958 additions and 30 deletions
|
|
@ -52,6 +52,9 @@ pub enum ReportOutputFormat {
|
|||
|
||||
/// SARIF format (experimental)
|
||||
Sarif,
|
||||
|
||||
/// Standalone HTML audit report
|
||||
Html,
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue