feat: SPDX 3 (#4269)

Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
Keith Zantow
2026-06-22 10:59:34 -04:00
committed by GitHub
parent 0e8d6deabe
commit 9c321691d4
23 changed files with 2063 additions and 100 deletions
+7 -3
View File
@@ -4,9 +4,10 @@ import (
"github.com/anchore/syft/syft/sbom"
)
const DefaultVersion = "2.3"
const (
DefaultVersion = "2.3"
V3_0 = "3.0"
JSONFormatID sbom.FormatID = "spdx-json"
TagValueFormatID sbom.FormatID = "spdx-tag-value"
)
@@ -19,7 +20,10 @@ func SupportedVersions(id sbom.FormatID) []string {
if id != JSONFormatID {
// JSON format is not supported in v2.1
return append([]string{"2.1"}, versions...)
versions = append([]string{"2.1"}, versions...)
} else {
// is JSON, v3 only supported in JSON format:
versions = append(versions, V3_0)
}
return versions