Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ pub fn run(
.format("%Y-%m-%d %H:%M:%S")
.to_string();
print_section("Created At", &created_at);
if let Ok(counts) =
scanners::blast::fetch_and_group_scan_issues(&config.get_url(), &scan_details.project)
{
if let Ok(counts) = scanners::blast::fetch_and_group_scan_issues(
&config.get_url(),
&scan_details.project,
&scan_details.id,
) {
let total_issues = counts.values().sum::<usize>();
let order = vec!["CR", "HI", "ME", "LO"];
for urgency in order {
Expand Down
8 changes: 5 additions & 3 deletions src/scanners/blast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ pub fn run(
);
});

let classifications = match report_scan_status(&config.get_url(), &project_name) {
let classifications = match report_scan_status(&config.get_url(), &project_name, &scan_id) {
Ok(issues_classes) => {
*stop_signal.lock().unwrap() = true;
let _ = results_thread.join();
Expand Down Expand Up @@ -507,8 +507,9 @@ pub fn check_scan_status(scan_id: &str, url: &str) -> Result<bool, Box<dyn Error
pub fn fetch_and_group_scan_issues(
url: &str,
project: &str,
scan_id: &str,
) -> Result<HashMap<String, usize>, Box<dyn std::error::Error>> {
let issues = match utils::api::get_all_issues(url, project, None) {
let issues = match utils::api::get_all_issues(url, project, Some(scan_id.to_string())) {
Ok(issues) => issues,
Err(err) => {
return Err(format!("Failed to fetch scan issues: {}", err).into());
Expand All @@ -528,8 +529,9 @@ pub fn fetch_and_group_scan_issues(
pub fn report_scan_status(
url: &str,
project: &str,
scan_id: &str,
) -> Result<HashMap<String, usize>, Box<dyn std::error::Error>> {
let classification_counts = match fetch_and_group_scan_issues(url, project) {
let classification_counts = match fetch_and_group_scan_issues(url, project, scan_id) {
Ok(counts) => counts,
Err(e) => {
return Err(e);
Expand Down
2 changes: 1 addition & 1 deletion src/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub fn run(config: &Config, scan_id: Option<String>, project_id: Option<String>)
println!("Scan has been processed successfully!");
}

match blast::report_scan_status(&config.get_url(), &project_name) {
match blast::report_scan_status(&config.get_url(), &project_name, &scan_id) {
Ok(_) => {
println!(
"\n\nYou can view the scan results at the following link:\n{}",
Expand Down
Loading