Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
csaf-rust
This repository is a reference implementation for the CSAF standard in Rust that relies on automatically generating CSAF document structs from the JSON schema.
This is work-in-progress.
Structure
csaf-validatorcontains a command line tool to validate CSAF documents.csaf-rscontains the actual validator library which currently publishes a crate to crates.io. In the future there will be a WASM version published to NPM and also bindings to other languages via UniFFI.
Minimum required Rust version (MSRV)
1.85.1
Build
If you want to build csaf-validator on your own, please install Rust (see https://rustup.rs) and then run
# make sure submodules are up-to-date
# make sure that local assets are in sync with git submodules
# run the tests
# build for release
The final binary will be in target/release and can then be installed, for example, in a system-wide folder.
Build WASM Bindings
If you want to build the WASM bindings locally, install wasm-pack (make sure ~/.cargo/bin is in
the path) and execute it:
This will create a JavaScript/TypeScript package in csaf-rs/pkg.
Usage
After building or downloading csaf-validator from the available releases, the usage is quite simple and additional help can be display using --help.
A validator for CSAF documents
Usage: csaf-validator [OPTIONS] <PATH>
Arguments:
<PATH>
Options:
-c, --csaf-version <CSAF_VERSION> Version of CSAF to use [default: 2.0]
-p, --preset <PRESET> The validation preset to use [default: basic]
-t, --test-id <TEST_ID> Run only the selected tests, may be specified multiple times
-h, --help Print help
-V, --version Print version
Some examples to use are included below. Please note that the validation is not yet fully implemented!
# validate a CSAF 2.0 document with profile basic (the default)
# validate a CSAF 2.0 document with profile full
# validate a CSAF 2.1 document with one specific test