Skip to content

Commit 4ac8a7b

Browse files
authored
Add strict SBOM validation flag.
* trustier will only validate an SBOM with the CycloneDX Bom validator if strict is set to true.
1 parent e833dd7 commit 4ac8a7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ struct Args {
3333
//Optional file name to write json output to
3434
#[arg(short, long, required = false)]
3535
output_file: Option<String>,
36+
37+
//Optional flag to enable strict SBOM validation
38+
#[arg(short, long, default_value_t = false)]
39+
strict: bool,
3640
}
3741

3842
fn main() {
@@ -67,7 +71,7 @@ fn main() {
6771
}
6872
};
6973

70-
if !bom.validate().passed() {
74+
if args.strict && !bom.validate().passed() {
7175
eprintln!("* Provided input is not a valid SBOM");
7276
return;
7377
}

0 commit comments

Comments
 (0)