From 248023baafdf2a74f8bdaf98beaee3f40584bb7d Mon Sep 17 00:00:00 2001 From: Keith Zantow Date: Fri, 15 Apr 2022 13:00:06 -0400 Subject: [PATCH] Update GitHub format package_url and correlator (#961) --- internal/formats/github/encoder.go | 2 +- internal/formats/github/encoder_test.go | 6 +++--- internal/formats/github/github_dependency_api.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/formats/github/encoder.go b/internal/formats/github/encoder.go index 2e39f7c102a..9dfc6890d44 100644 --- a/internal/formats/github/encoder.go +++ b/internal/formats/github/encoder.go @@ -130,7 +130,7 @@ func toGithubManifests(s *sbom.SBOM) Manifests { name := dependencyName(p) manifest.Resolved[name] = DependencyNode{ - Purl: p.PURL, + PackageURL: p.PURL, Metadata: toDependencyMetadata(p), Relationship: toDependencyRelationshipType(p), Scope: toDependencyScope(p), diff --git a/internal/formats/github/encoder_test.go b/internal/formats/github/encoder_test.go index 91ac837692c..3eb58c75571 100644 --- a/internal/formats/github/encoder_test.go +++ b/internal/formats/github/encoder_test.go @@ -104,12 +104,12 @@ func Test_toGithubModel(t *testing.T) { }, Resolved: DependencyGraph{ "pkg:generic/pkg-1@1.0.1": DependencyNode{ - Purl: "pkg:generic/pkg-1@1.0.1", + PackageURL: "pkg:generic/pkg-1@1.0.1", Scope: DependencyScopeRuntime, Relationship: DependencyRelationshipDirect, }, "pkg:generic/pkg-2@2.0.2": DependencyNode{ - Purl: "pkg:generic/pkg-2@2.0.2", + PackageURL: "pkg:generic/pkg-2@2.0.2", Scope: DependencyScopeRuntime, Relationship: DependencyRelationshipDirect, }, @@ -125,7 +125,7 @@ func Test_toGithubModel(t *testing.T) { }, Resolved: DependencyGraph{ "pkg:generic/pkg-3@3.0.3": DependencyNode{ - Purl: "pkg:generic/pkg-3@3.0.3", + PackageURL: "pkg:generic/pkg-3@3.0.3", Scope: DependencyScopeRuntime, Relationship: DependencyRelationshipDirect, }, diff --git a/internal/formats/github/github_dependency_api.go b/internal/formats/github/github_dependency_api.go index 86743419005..fe873d41809 100644 --- a/internal/formats/github/github_dependency_api.go +++ b/internal/formats/github/github_dependency_api.go @@ -14,9 +14,9 @@ type DependencySnapshot struct { } type Job struct { - Name string `json:"name,omitempty"` // !omitempty - ID string `json:"id,omitempty"` // !omitempty - HTMLURL string `json:"html_url,omitempty"` + Correlator string `json:"correlator,omitempty"` // !omitempty + ID string `json:"id,omitempty"` // !omitempty + HTMLURL string `json:"html_url,omitempty"` } type DetectorMetadata struct { @@ -62,7 +62,7 @@ const ( ) type DependencyNode struct { - Purl string `json:"purl,omitempty"` + PackageURL string `json:"package_url,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Relationship DependencyRelationship `json:"relationship,omitempty"` Scope DependencyScope `json:"scope,omitempty"`