-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19cca70
commit 56d0bc2
Showing
9 changed files
with
78 additions
and
101 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,10 @@ async fn ingest_sboms(ctx: &TrustifyContext) -> Result<(), anyhow::Error> { | |
|
||
let sbom_v1 = system | ||
.ingest_sbom( | ||
("source", "http://sbom.com/test.json"), | ||
( | ||
"sour// TODO: Is this right ?ce", | ||
"http://sbom.com/test.json", | ||
), | ||
&Digests::digest("8"), | ||
Some("a".to_string()), | ||
(), | ||
|
@@ -208,52 +211,52 @@ async fn transitive_dependency_of(ctx: &TrustifyContext) -> Result<(), anyhow::E | |
|
||
sbom1 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
||
sbom1 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
||
sbom1 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
||
sbom1 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
||
sbom1 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
||
let _results = sbom1 | ||
.related_packages_transitively( | ||
&[Relationship::DependencyOf], | ||
&[Relationship::Dependency], | ||
&"pkg:maven/io.quarkus/[email protected]".try_into()?, | ||
&ctx.db, | ||
) | ||
|
@@ -282,9 +285,9 @@ async fn ingest_package_relates_to_package_dependency_of( | |
|
||
sbom1 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
@@ -301,17 +304,17 @@ async fn ingest_package_relates_to_package_dependency_of( | |
|
||
sbom2 | ||
.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
||
let dependencies = fetch | ||
.related_packages( | ||
sbom1.sbom.sbom_id, | ||
Relationship::DependencyOf, | ||
Relationship::Dependency, | ||
"pkg:maven/io.quarkus/[email protected]", | ||
&ctx.db, | ||
) | ||
|
@@ -334,7 +337,7 @@ async fn ingest_package_relates_to_package_dependency_of( | |
let dependencies = fetch | ||
.related_packages( | ||
sbom2.sbom.sbom_id, | ||
Relationship::DependencyOf, | ||
Relationship::Dependency, | ||
"pkg:maven/io.quarkus/[email protected]", | ||
&ctx.db, | ||
) | ||
|
@@ -381,27 +384,27 @@ async fn sbom_vulnerabilities(ctx: &TrustifyContext) -> Result<(), anyhow::Error | |
log::debug!("-------------------- B"); | ||
|
||
sbom.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:oci/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
log::debug!("-------------------- C"); | ||
|
||
sbom.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
log::debug!("-------------------- D"); | ||
|
||
sbom.ingest_package_relates_to_package( | ||
Purl::from_str("pkg:maven/postgres/[email protected]")?, | ||
Relationship::DependencyOf, | ||
Purl::from_str("pkg:maven/io.quarkus/[email protected]")?, | ||
Relationship::Dependency, | ||
Purl::from_str("pkg:maven/postgres/[email protected]")?, | ||
&ctx.db, | ||
) | ||
.await?; | ||
|
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.