forked from trustification/trustify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add RH processing for SPDX as well
- Loading branch information
Showing
10 changed files
with
2,053 additions
and
47 deletions.
There are no files selected for viewing
1,749 changes: 1,749 additions & 0 deletions
1,749
etc/test-data/spdx/rh/product_component/openssl-3.0.7-18.el9_2.spdx.json
Large diffs are not rendered by default.
Oops, something went wrong.
141 changes: 141 additions & 0 deletions
141
etc/test-data/spdx/rh/product_component/rhel-9.2-eus.spdx.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
{ | ||
"spdxVersion": "SPDX-2.3", | ||
"dataLicense": "CC0-1.0", | ||
"SPDXID": "SPDXRef-DOCUMENT", | ||
"creationInfo": { | ||
"created": "2006-08-14T02:34:56Z", | ||
"creators": [ | ||
"Tool: example SPDX document only", | ||
"Organization: Red Hat" | ||
] | ||
}, | ||
"name": "Red Hat Enterprise Linux 9.2 EUS", | ||
"documentNamespace": "https://www.redhat.com/rhel-9.2-eus.spdx.json", | ||
"packages": [ | ||
{ | ||
"SPDXID": "SPDXRef-RHEL-9.2-EUS", | ||
"name": "Red Hat Enterprise Linux", | ||
"versionInfo": "9.2 EUS", | ||
"supplier": "Organization: Red Hat", | ||
"downloadLocation": "NOASSERTION", | ||
"licenseConcluded": "NOASSERTION", | ||
"externalRefs": [ | ||
{ | ||
"referenceCategory": "SECURITY", | ||
"referenceLocator": "cpe:/a:redhat:rhel_eus:9.2::appstream", | ||
"referenceType": "cpe22Type" | ||
}, | ||
{ | ||
"referenceCategory": "SECURITY", | ||
"referenceLocator": "cpe:/a:redhat:rhel_eus:9.2::baseos", | ||
"referenceType": "cpe22Type" | ||
} | ||
] | ||
}, | ||
{ | ||
"SPDXID": "SPDXRef-openssl-3.0.7-18.el9-2", | ||
"name": "openssl", | ||
"versionInfo": "3.0.7-18.el9_2", | ||
"supplier": "Organization: Red Hat", | ||
"downloadLocation": "NOASSERTION", | ||
"packageFileName": "openssl-3.0.7-18.el9_2.src.rpm", | ||
"licenseConcluded": "Apache-2.0", | ||
"externalRefs": [ | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-aarch64-baseos-eus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-s390x-baseos-eus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-ppc64le-baseos-eus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-i686-baseos-eus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-x86_64-baseos-eus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-aarch64-baseos-aus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-s390x-baseos-aus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-ppc64le-baseos-aus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-i686-baseos-aus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-x86_64-baseos-aus-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-aarch64-baseos-e4s-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-s390x-baseos-e4s-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-ppc64le-baseos-e4s-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-i686-baseos-e4s-source-rpms" | ||
}, | ||
{ | ||
"referenceCategory": "PACKAGE-MANAGER", | ||
"referenceType": "purl", | ||
"referenceLocator": "pkg:rpm/redhat/[email protected]_2?arch=src&repository_id=rhel-9-for-x86_64-baseos-e4s-source-rpms" | ||
} | ||
], | ||
"checksums": [ | ||
{ | ||
"algorithm": "SHA256", | ||
"checksumValue": "31b5079268339cff7ba65a0aee77930560c5adef4b1b3f8f5927a43ee468dag0" | ||
} | ||
] | ||
} | ||
], | ||
"files": [], | ||
"relationships": [ | ||
{ | ||
"spdxElementId": "SPDXRef-DOCUMENT", | ||
"relationshipType": "DESCRIBES", | ||
"relatedSpdxElement": "SPDXRef-RHEL-9.2-EUS" | ||
}, | ||
{ | ||
"spdxElementId": "SPDXRef-openssl-3.0.7-18.el9-2", | ||
"relationshipType": "PACKAGE_OF", | ||
"relatedSpdxElement": "SPDXRef-RHEL-9.2-EUS" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...s/fundamental/tests/sbom/spdx/external.rs → ...ndamental/tests/sbom/spdx/external/mod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#![allow(clippy::expect_used)] | ||
#![allow(clippy::unwrap_used)] | ||
|
||
use test_context::test_context; | ||
use test_log::test; | ||
use trustify_module_fundamental::sbom::service::SbomService; | ||
use trustify_test_context::TrustifyContext; | ||
|
||
#[test_context(TrustifyContext)] | ||
#[test(tokio::test)] | ||
async fn prod_comp(ctx: &TrustifyContext) -> Result<(), anyhow::Error> { | ||
let mut result = ctx | ||
.ingest_documents([ | ||
"spdx/rh/product_component/rhel-9.2-eus.spdx.json", | ||
"spdx/rh/product_component/openssl-3.0.7-18.el9_2.spdx.json", | ||
]) | ||
.await?; | ||
|
||
let _prod = result | ||
.pop() | ||
.unwrap() | ||
.id | ||
.try_as_uid() | ||
.expect("must have a uid"); | ||
let _comp = result | ||
.pop() | ||
.unwrap() | ||
.id | ||
.try_as_uid() | ||
.expect("must have a uid"); | ||
|
||
let _service = SbomService::new(ctx.db.clone()); | ||
|
||
// TODO: implement when we have the tools | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.