Skip to content

Commit 90764aa

Browse files
committed
Merge branch 'main' into license-file
2 parents 4f05065 + 3a583fd commit 90764aa

File tree

434 files changed

+31901
-581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+31901
-581
lines changed

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Install Nix
16-
uses: DeterminateSystems/nix-installer-action@v7
16+
uses: DeterminateSystems/nix-installer-action@v9
1717
- name: Run the Magic Nix Cache
1818
uses: DeterminateSystems/magic-nix-cache-action@v2
1919

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
# SBOM documents
55
**/bom.xml
66
**/*.cdx.xml
7+
!cyclonedx-bom/tests/examples/**/*.cdx.xml
78
**/bom.json
89
**/*.cdx.json
10+
!cyclonedx-bom/tests/examples/**/*.cdx.json
911

1012
# Nix Flake
1113
/.direnv/

CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing
2+
3+
Contributions are welcome!
4+
5+
But please read the
6+
[CycloneDX contributing guidelines](https://github.com/CycloneDX/.github/blob/master/CONTRIBUTING.md)
7+
first.
8+
9+
## Reporting an issue
10+
11+
This project uses GitHub issues to manage the issues. Open an issue directly in GitHub.
12+
13+
If you believe you found a bug, and it's likely possible, please indicate a way to reproduce it, what you are seeing and what you would expect to see.
14+
15+
## Asking questions
16+
17+
We have a `#rust-cargo` Channel in the CycloneDX Slack (link in the [`README.md`](README.md)).
18+
19+
## Pull Requests
20+
21+
Pull requests are welcome.
22+
Please follow the steps outlined below and make sure to check clippy, format the code and check test output.
23+
24+
### Sign off your commits
25+
26+
Please sign off your commits,
27+
to show that you agree to publish your changes under the current terms and licenses of the project.
28+
29+
```shell
30+
git commit --signoff ...
31+
```
32+
33+
## Building and developing the project
34+
35+
### Build
36+
37+
```shell
38+
cargo +stable build --verbose
39+
```
40+
41+
### Test
42+
43+
Run the tests:
44+
45+
```shell
46+
cargo test
47+
```
48+
49+
### Coding standards
50+
51+
Check for deviations from coding standards:
52+
53+
```shell
54+
cargo fmt -- --check
55+
cargo clippy --all-targets
56+
```
57+
58+
Apply coding standards via:
59+
60+
```shell
61+
cargo fmt
62+
```

Cargo.lock

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

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88

99
# CycloneDX Rust (Cargo) Plugin
1010

11-
The CycloneDX module for Rust (Cargo) creates a valid CycloneDX Software Bill-of-Material (SBOM) containing an
12-
aggregate of all project dependencies. OWASP CycloneDX is a full-stack Bill of Materials (BOM) standard that
13-
provides advanced supply chain capabilities for cyber risk reduction
11+
The CycloneDX module for Rust (Cargo) creates a valid CycloneDX Software Bill of Materials (SBOM) containing an
12+
aggregate of all project dependencies.
13+
OWASP CycloneDX is a full-stack Bill of Materials (BOM) standard providing advanced supply chain capabilities for cyber risk reduction.
14+
15+
## Structure
16+
17+
This repository contains two separate projects:
18+
19+
- [`cyclonedx-bom`](./cyclonedx-bom/README.md) is a Rust library to read and write CycloneDX SBOMs to and from Rust structs.
20+
- [`cargo-cyclonedx`](./cargo-cyclonedx/README.md) is a Rust application, which generates CycloneDX SBOMs for Cargo based Rust projects (it uses `cyclonedx-bom` for that purpose).
1421

1522
## Usage
1623

17-
Execute CycloneDX from within a Rust project directory containing Cargo.toml.
24+
Execute `cargo-cyclonedx` from within a Rust project directory containing Cargo.toml.
1825

1926
### Installing
2027

@@ -34,6 +41,11 @@ cargo install cargo-cyclonedx
3441
cargo cyclonedx
3542
```
3643

44+
## Contributing
45+
46+
Contributions are welcome.
47+
See our [`CONTRIBUTING.md`](CONTRIBUTING.md) for details.
48+
3749
## Copyright & License
3850

3951
CycloneDX Rust Cargo is Copyright (c) OWASP Foundation. All Rights Reserved.

cargo-cyclonedx/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ lto = "thin"
2323
[dependencies]
2424
anyhow = "1.0.75"
2525
cargo_metadata = "0.18.1"
26-
clap = { version = "4.4.8", features = ["derive"] }
26+
clap = { version = "4.4.11", features = ["derive"] }
2727
cyclonedx-bom = { version = "0.4.3", path = "../cyclonedx-bom" }
2828
env_logger = "0.10.0"
2929
log = "0.4.20"
3030
once_cell = "1.18.0"
3131
pathdiff = { version = "0.2.1", features = ["camino"] }
32-
percent-encoding = "2.3.0"
32+
percent-encoding = "2.3.1"
3333
purl = { version = "0.1.2", default-features = false, features = ["package-type"] }
3434
regex = "1.9.3"
35-
serde = { version = "1.0.192", features = ["derive"] }
35+
serde = { version = "1.0.193", features = ["derive"] }
3636
thiserror = "1.0.48"
3737
validator = { version = "0.16.1" }
3838

cargo-cyclonedx/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
# `cargo-cyclonedx`
1010

11-
The [CycloneDX](https://cyclonedx.org/) plugin for `cargo` creates a [custom `cargo` subcommand](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands) that generates a Software Bill-of-Materials (SBOM) file that describes the `cargo` project.
11+
This [CycloneDX](https://cyclonedx.org/) plugin for `cargo` creates a [custom `cargo` subcommand](https://doc.rust-lang.org/cargo/reference/external-tools.html#custom-subcommands) that generates a Software Bill of Materials (SBOM) file that describes the `cargo` project.
1212

13-
CycloneDX is a lightweight SBOM specification that is easily created, human and machine readable, and simple to parse.
13+
CycloneDX is a lightweight SBOM specification that is easily created, human and machine-readable, and simple to parse.
1414

1515
## Usage
1616

@@ -88,6 +88,10 @@ This produces a `bom.xml` file adjacent to every `Cargo.toml` file that exists i
8888
Print version
8989
```
9090

91+
## Contributing
92+
93+
See [CONTRIBUTING](../CONTRIBUTING.md) for details.
94+
9195
## Copyright & License
9296

9397
CycloneDX Rust Cargo is Copyright (c) OWASP Foundation. All Rights Reserved.

cargo-cyclonedx/src/generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ impl SbomGenerator {
369369
license,
370370
err,
371371
);
372-
licenses.push(LicenseChoice::License(License::named_license(license)));
372+
licenses.push(LicenseChoice::License(License::named_license(license)))
373373
}
374374
}
375375
}

cyclonedx-bom/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ rust-version.workspace = true
1515

1616
[dependencies]
1717
base64 = "0.21.2"
18-
http = "1.0.0"
18+
fluent-uri = "0.1.4"
1919
once_cell = "1.18.0"
20+
ordered-float = { version = "4.2.0", default-features = false }
2021
packageurl = "0.3.0"
2122
regex = "1.9.3"
22-
serde = { version = "1.0.192", features = ["derive"] }
23+
serde = { version = "1.0.193", features = ["derive"] }
2324
serde_json = "1.0.108"
2425
spdx = "0.10.2"
2526
thiserror = "1.0.48"

cyclonedx-bom/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@
1010

1111
The [CycloneDX](https://cyclonedx.org/) library provides JSON and XML serialization and derserialization of Software Bill-of-Materials (SBOM) files.
1212

13-
CycloneDX is a lightweight SBOM specification that is easily created, human and machine readable, and simple to parse.
13+
CycloneDX is a lightweight SBOM specification that is easily created, human and machine-readable, and simple to parse.
1414

1515
The library is intended to enable developers to:
1616

1717
- Construct SBOM documents that conform the CycloneDX specification
1818
- Parse and validate JSON and XML SBOM documents
1919
- Perform modifications to BOM documents (e.g. merging multiple BOMs using a variety of algorithms)
20+
21+
## Supported CycloneDX versions
22+
23+
This library currently supports CycloneDX 1.3 and 1.4.
2024

2125
## Usage
2226

@@ -83,6 +87,14 @@ assert_eq!(
8387
);
8488
```
8589

90+
## Verification and Validation
91+
92+
See [README](./tests/README.md) for details.
93+
94+
## Contributing
95+
96+
See [CONTRIBUTING](../CONTRIBUTING.md) for details.
97+
8698
## Copyright & License
8799

88100
CycloneDX Rust Cargo is Copyright (c) OWASP Foundation. All Rights Reserved.

0 commit comments

Comments
 (0)