feat: SPDX 2.3 support (#1311)

This commit is contained in:
Keith Zantow
2022-11-18 08:54:39 -05:00
committed by GitHub
parent 0c4b99c1c2
commit 42cb0a47a4
71 changed files with 892 additions and 1339 deletions
+3 -3
View File
@@ -40,7 +40,7 @@ import (
"github.com/anchore/syft/syft"
"github.com/anchore/syft/syft/event"
"github.com/anchore/syft/syft/formats/cyclonedxjson"
"github.com/anchore/syft/syft/formats/spdx22json"
"github.com/anchore/syft/syft/formats/spdxjson"
"github.com/anchore/syft/syft/formats/syftjson"
"github.com/anchore/syft/syft/sbom"
"github.com/anchore/syft/syft/source"
@@ -49,7 +49,7 @@ import (
var (
allowedAttestFormats = []sbom.FormatID{
syftjson.ID,
spdx22json.ID,
spdxjson.ID,
cyclonedxjson.ID,
}
@@ -356,7 +356,7 @@ func uploadAttestation(app *config.Application, signedPayload []byte, digest nam
func formatPredicateType(format sbom.Format) string {
switch format.ID() {
case spdx22json.ID:
case spdxjson.ID:
return in_toto.PredicateSPDX
case cyclonedxjson.ID:
return in_toto.PredicateCycloneDX
+4 -4
View File
@@ -4,8 +4,8 @@ import (
"github.com/anchore/syft/syft/formats/cyclonedxjson"
"github.com/anchore/syft/syft/formats/cyclonedxxml"
"github.com/anchore/syft/syft/formats/github"
"github.com/anchore/syft/syft/formats/spdx22json"
"github.com/anchore/syft/syft/formats/spdx22tagvalue"
"github.com/anchore/syft/syft/formats/spdxjson"
"github.com/anchore/syft/syft/formats/spdxtagvalue"
"github.com/anchore/syft/syft/formats/syftjson"
"github.com/anchore/syft/syft/formats/table"
"github.com/anchore/syft/syft/formats/text"
@@ -21,9 +21,9 @@ func FormatAliases(ids ...sbom.FormatID) (aliases []string) {
aliases = append(aliases, "text")
case table.ID:
aliases = append(aliases, "table")
case spdx22json.ID:
case spdxjson.ID:
aliases = append(aliases, "spdx-json")
case spdx22tagvalue.ID:
case spdxtagvalue.ID:
aliases = append(aliases, "spdx-tag-value")
case cyclonedxxml.ID:
aliases = append(aliases, "cyclonedx-xml")