Skip to content

Commit 9b4326a

Browse files
authored
Add new CSAF validation rules and optimize test structure (#38)
* Add new CSAF validation rules and optimize test structure Introduced additional validation rules (6.1.37 - 6.1.42) for CSAF 2.1, including checks for sharing group names, TLP consistency, and PURLs. Refactored test structure to use a centralized helper function for streamlined testing and reduced redundancy. * Enhance datetime validation with chrono-based parsing checks Added a chrono-based plausibility check to ensure RFC3339 date-time strings are valid beyond regex matching. This improvement catches invalid cases like out-of-range dates, providing more accurate validation error messages. * Refactor product tree traversal and validation logic Introduced a unified product tree traversal API via `visit_all_products` and `visit_branches_rec`, simplifying branch recursion and validation. Replaced specific `gather_product_definitions` and custom traversal functions with reusable logic, ensuring consistency and reducing code duplication. Additionally, improved modularity by renaming traits and refining parameterized implementations for better clarity.
1 parent cd14128 commit 9b4326a

23 files changed

+1234
-307
lines changed

Cargo.lock

Lines changed: 183 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

csaf

Submodule csaf updated 120 files

csaf-lib/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ serde = { version = "1", features = ["derive"] }
99
serde_json = "1"
1010
chrono = { version = "0.4", features = ["serde"] }
1111
regex = "1"
12+
glob = "0.3.2"
13+
purl = "0.1"
1214

1315
[build-dependencies]
1416
schemars = "0.8"

0 commit comments

Comments
 (0)