Skip to content

Commit fd87c29

Browse files
Minor experience improvement (#36)
1 parent d53df99 commit fd87c29

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ enum Commands {
7272
#[arg(
7373
short,
7474
long,
75-
help = "Specify the scan type. By default, a full scan is run, which includes all scan types. You can choose to run a partial scan by specifying one or more of the following types: base AI blast (base), malicious code detection (malicious), policy checks (policy), secret detection (secrets), and PII scan (pii). Use comma-separated values to run multiple types, e.g., 'policy,secrets,pii'."
75+
help = "Specify the scan type. By default, a full scan is run, which includes all scan types. You can choose to run a partial scan by specifying one or more of the following types: base AI blast (blast), malicious code detection (malicious), policy checks (policy), secret detection (secrets), and PII scan (pii). Use comma-separated values to run multiple types, e.g., 'policy,secrets,pii'."
7676
)]
7777
scan_type: Option<String>,
7878
},
@@ -229,11 +229,11 @@ fn main() {
229229
eprintln!("scan_type cannot be empty.");
230230
std::process::exit(1);
231231
}
232-
let supported_scan_types = ["base", "malicious", "policy", "secrets", "pii"];
232+
let supported_scan_types = ["blast", "malicious", "policy", "secrets", "pii"];
233233
let scan_types: Vec<_> = scan_type.split(',').map(|t| t.trim()).collect();
234234
for scan in scan_types {
235235
if !supported_scan_types.contains(&scan) {
236-
eprintln!("Invalid scan_type: {}. Supported types are: base, malicious, policy, secrets, pii.", scan);
236+
eprintln!("Invalid scan_type: {}. Supported types are: blast, malicious, policy, secrets, pii.", scan);
237237
std::process::exit(1);
238238
}
239239
}

src/scanners/blast.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,16 @@ pub fn run(
1919
policy: Option<String>,
2020
) {
2121
println!(
22-
"\nScanning with BLAST 🚀🚀🚀\n\n"
22+
"\nScanning with BLAST 🚀🚀🚀"
2323
);
24+
25+
if let Some(scan_type) = &scan_type {
26+
println!("Running Scan Type: {}", scan_type);
27+
}
28+
if let Some(policy) = &policy {
29+
println!("Including only specified policies for policy scan: {}", policy);
30+
}
31+
println!("\n\n");
2432
let temp_dir = env::temp_dir().join(format!("corgea/tmp/{}", Uuid::new_v4()));
2533
fs::create_dir_all(&temp_dir).expect("Failed to create temp directory");
2634
let project_name = utils::generic::get_current_working_directory().unwrap_or("unknown".to_string());

src/utils/api.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ pub fn upload_zip(
126126
}
127127
}
128128
if let Some(scan_type) = scan_type.clone() {
129+
let scan_type = if scan_type.contains("blast") {
130+
"base".to_string()
131+
} else {
132+
scan_type
133+
};
129134
form = form.part("scan_configs", multipart::Part::text(scan_type.to_string()));
130135
}
131136
if let Some(policy) = policy.clone() {

0 commit comments

Comments
 (0)