Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,11 @@ imports only `purlkit`, `spdxkit`, the standard library, and the two format
libraries whose vocabularies it cites by constant (cyclonedx-go,
spdx/tools-golang); `httpkit` is a leaf that `plugin` reaches for
`HostContext`; `scan` imports `model`, `plugin` and `graphview`, and nothing
imports `scan`. Nothing imports upward. The
imports `scan`. Nothing imports upward. `sbom` is the only importer of
`spdx/tools-golang/spdx/v3`: the SPDX 3 reader panics on some untrusted
graphs and the converter and serializer are nondeterministic, and
`sbom/spdx3*.go` is where both are contained (`repo_guards_test.go`
enforces it). The
module root holds `doc.go` (the map) and `repo_guards_test.go` (the import
boundary and the single-guidance-file rule, both keyed on the root
directory) and nothing else; do not add code there.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ an SBOM cannot say.

## The SBOM codec

- `sbom` — the SBOM codec: projects a graph into SPDX 2.3 or CycloneDX JSON and reads such a document back into a graph, with the document model, the strict ingest preflight, and the assertions a document carries about itself.
- `sbom` — the SBOM codec: projects a graph into SPDX 2.3, SPDX 3.0 (JSON-LD) or CycloneDX JSON and reads such a document back into a graph, with the document model, the strict ingest preflight, and the assertions a document carries about itself.
- `graphview` — what a document may say about a node: the package URL it publishes, which of its children a document can name, and which nodes count as top-level parents.

Both come from the CLI's `internal/sbom` and `internal/graphview`
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ require (
github.com/aquasecurity/go-version v0.0.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/piprate/json-gold v0.7.0 // indirect
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
go.uber.org/multierr v1.10.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/text v0.43.0 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
github.com/hashicorp/go-plugin v1.8.0 h1:ie8S6RRY8RvB2usYZv+AAZ/wBvx2AU5p5QeP5j/FORs=
Expand All @@ -38,8 +40,12 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/package-url/packageurl-go v0.1.7 h1:iFWg6tzAjLA6F/qX3M5nZaiMHJgc+p2zxVyr/fY+sZY=
github.com/package-url/packageurl-go v0.1.7/go.mod h1:nKAWB8E6uk1MHqiS/lQb9pYBGH2+mdJ2PJc2s50dQY0=
github.com/piprate/json-gold v0.7.0 h1:bEMirgA5y8Z2loTQfxyIFfY+EflxH1CTP6r/KIlcJNw=
github.com/piprate/json-gold v0.7.0/go.mod h1:RVhE35veDX19r5gfUAR+IYHkAUuPwJO8Ie/qVeFaIzw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU=
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA=
github.com/spdx/tools-golang v0.6.0-rc4 h1:2GkvNr0DcnJHY9BDm3OYHo229jZS/h4qYDK+tHYXPOo=
github.com/spdx/tools-golang v0.6.0-rc4/go.mod h1:ruCHu3shgy7bVbZ7gtEU4Gq4fI08n2SdXtgV5PoN/OM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
12 changes: 12 additions & 0 deletions repo_guards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ var boundedImports = []struct {
kitDir: "spdxkit",
allowed: map[string]string{},
},
{
// The SPDX 3 model, its JSON-LD reader and its 2.3 converter. The
// reader panics on some untrusted graphs, the converter and the
// serializer are nondeterministic, and the library's shared license
// values are mutated by its serializer: sbom/spdx3*.go contains all
// of that, so no other package may reach the library directly.
// The 2.3 package stays importable from model, which cites its
// vocabulary by constant.
module: "github.com/spdx/tools-golang/spdx/v3",
kitDir: "sbom",
allowed: map[string]string{},
},
{
module: "encoding/json/v2",
kitDir: "sbom",
Expand Down
44 changes: 44 additions & 0 deletions sbom/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type codec interface {

var codecs = map[Target]codec{
TargetSPDX23JSON: spdx23Codec{},
TargetSPDX30JSON: spdx30Codec{},
TargetCycloneDX14JSON: cycloneDXCodec{version: TargetCycloneDX14JSON},
TargetCycloneDX15JSON: cycloneDXCodec{version: TargetCycloneDX15JSON},
TargetCycloneDX16JSON: cycloneDXCodec{version: TargetCycloneDX16JSON},
Expand Down Expand Up @@ -200,6 +201,10 @@ func DetectJSONTarget(data []byte) (Target, error) {
Schema struct {
URL string `json:"url"`
} `json:"schema"`
// Raw, so a document whose @context or @graph has an unexpected
// shape is an unsupported format rather than malformed JSON.
Context json.RawMessage `json:"@context"`
Graph json.RawMessage `json:"@graph"`
}
if err := json.Unmarshal(trimmed, &sniff); err != nil {
return "", ErrMalformedJSON
Expand All @@ -212,6 +217,8 @@ func DetectJSONTarget(data []byte) (Target, error) {
switch {
case sniff.SPDXVersion == "SPDX-2.3":
return TargetSPDX23JSON, nil
case spdx3ContextNamed(sniff.Context) && nonEmptyJSONArray(sniff.Graph):
return TargetSPDX30JSON, nil
case sniff.BOMFormat == "CycloneDX":
switch sniff.SpecVersion {
case "1.4":
Expand All @@ -229,6 +236,43 @@ func DetectJSONTarget(data []byte) (Target, error) {
return "", ErrUnsupportedFormat
}

// spdx3ContextMarker is what makes a JSON-LD document an SPDX 3.0 one: the
// specification publishes its JSON-LD context under
// https://spdx.org/rdf/3.0.<patch>/spdx-context.jsonld (3.0.1 today), and a
// document names it in @context, as a string or as one entry of a list. SPDX
// 3 has no other discriminator -- no version member like 2.3's spdxVersion --
// so the context is the format's own declaration of what it is. Which patch
// release is readable is the library's decision: its reader resolves the
// context offline and refuses one it does not carry.
const spdx3ContextMarker = "spdx.org/rdf/3.0."

// spdx3ContextNamed reports whether a JSON-LD @context names an SPDX 3.0
// context.
func spdx3ContextNamed(raw json.RawMessage) bool {
if len(raw) == 0 {
return false
}
var single string
if json.Unmarshal(raw, &single) == nil {
return strings.Contains(single, spdx3ContextMarker)
}
var list []json.RawMessage
if json.Unmarshal(raw, &list) != nil {
return false
}
for _, entry := range list {
if json.Unmarshal(entry, &single) == nil && strings.Contains(single, spdx3ContextMarker) {
return true
}
}
return false
}

func nonEmptyJSONArray(raw json.RawMessage) bool {
var list []json.RawMessage
return json.Unmarshal(raw, &list) == nil && len(list) > 0
}

// UnmarshalAutoJSON parses a supported SBOM JSON payload without requiring the caller to preselect a target.
func UnmarshalAutoJSON(data []byte) (*Document, Target, error) {
// Before sniffing, not after. The format is read out of the document, so
Expand Down
11 changes: 11 additions & 0 deletions sbom/codec_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ func FuzzUnmarshalAutoJSON(f *testing.F) {
`{"spdxVersion":"SPDX-2.3","SPDXID":"SPDXRef-DOCUMENT","name":"demo","documentNamespace":"https://example.com/spdx/demo","externalDocumentRefs":[{"externalDocumentId":"DocumentRef-a","spdxDocument":"../../etc/passwd","checksum":{"algorithm":"NOPE","checksumValue":""}}],"packages":[]}`,
`{"bomFormat":"CycloneDX","specVersion":"1.6","version":1,"serialNumber":"urn:uuid:3e671687-395b-41f5-a30f-a58921a69b79","externalReferences":[{"type":"bom","url":"urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/2","hashes":[{"alg":"SHA-256","content":"0000000000000000000000000000000000000000000000000000000000000000"}]}],"components":[]}`,
`{"bomFormat":"CycloneDX","specVersion":"1.6","version":1,"externalReferences":[{"type":"bom","url":"file:///etc/passwd"}],"components":[{"bom-ref":"a","name":"a","version":"1","purl":"pkg:npm/a@1","scope":"optional","properties":[{"name":"bomly:scopes","value":"runtime,future"}]}]}`,
// SPDX 3.0 JSON-LD: a minimal document, one naming a listed license
// by its License List IRI (which ingest defines before the library
// reads it), one whose context is a list, one with no SpdxDocument,
// and the vocabulary-as-element shape that panicked the library's
// reader.
`{"@context":"https://spdx.org/rdf/3.0.1/spdx-context.jsonld","@graph":[{"type":"CreationInfo","@id":"_:c","specVersion":"3.0.1","created":"2026-01-01T00:00:00Z","createdBy":["https://example.com/a"]},{"type":"Organization","spdxId":"https://example.com/a","name":"a","creationInfo":"_:c"},{"type":"SpdxDocument","spdxId":"https://example.com/d","creationInfo":"_:c","rootElement":["https://example.com/p"]},{"type":"software_Package","spdxId":"https://example.com/p","name":"p","software_packageVersion":"1","software_packageUrl":"pkg:npm/p@1","creationInfo":"_:c"}]}`,
`{"@context":"https://spdx.org/rdf/3.0.1/spdx-context.jsonld","@graph":[{"type":"CreationInfo","@id":"_:c","specVersion":"3.0.1","created":"2026-01-01T00:00:00Z","createdBy":[]},{"type":"SpdxDocument","spdxId":"https://example.com/d","creationInfo":"_:c"},{"type":"software_Package","spdxId":"https://example.com/p","name":"p","creationInfo":"_:c"},{"type":"Relationship","spdxId":"https://example.com/r","from":"https://example.com/p","to":["https://spdx.org/licenses/MIT"],"relationshipType":"hasDeclaredLicense","creationInfo":"_:c"}]}`,
`{"@context":["https://spdx.org/rdf/3.0.1/spdx-context.jsonld"],"@graph":[{"type":"SpdxDocument","spdxId":"https://example.com/d"}]}`,
`{"@context":"https://spdx.org/rdf/3.0.1/spdx-context.jsonld","@graph":[{"type":"software_Package","spdxId":"https://example.com/p","name":"p"}]}`,
`{"@context":"https://spdx.org/rdf/3.0.1/spdx-context.jsonld","@graph":[{"type":"SpdxDocument","spdxId":"https://example.com/d"},{"type":"software_Package","spdxId":"https://example.com/p","verifiedUsing":[{"type":"Hash","algorithm":"https://example.com/h","hashValue":"00"}]},{"type":"HashAlgorithm","spdxId":"https://example.com/h"}]}`,
`{"@context":"https://spdx.org/rdf/3.0.1/spdx-context.jsonld","@graph":[{"type":"SpdxDocument","spdxId":"https://exa`,
// Malformed inputs: rejection paths must be deterministic, never panic.
``,
`{}`,
Expand Down
5 changes: 3 additions & 2 deletions sbom/doc.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Package sbom is the SBOM codec: it projects a dependency graph into an
// SPDX 2.3 or CycloneDX document and reads such a document back into a graph.
// SPDX 2.3, SPDX 3.0 or CycloneDX document and reads such a document back
// into a graph.
//
// It owns the document model (Document, Component, Dependency and the
// assertions they carry), the two format codecs, the strict preflight that
// assertions they carry), the format codecs, the strict preflight that
// refuses a document without one unambiguous reading (bomly-cli ADR-0026),
// and the projection in both directions: FromDepGraph and FromGraphEntries
// build a Document from a graph, ToGraph builds a graph from a Document, and
Expand Down
2 changes: 1 addition & 1 deletion sbom/document_assertions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestDocumentClaimsSurviveTheGraphHop(t *testing.T) {
// byte difference. Pinning them would have made this test pass over exactly
// the defects it exists to catch.
func TestSingleSourceExportIsAFixedPoint(t *testing.T) {
for _, target := range []Target{TargetSPDX23JSON, TargetCycloneDX16JSON} {
for _, target := range []Target{TargetSPDX23JSON, TargetSPDX30JSON, TargetCycloneDX16JSON} {
t.Run(string(target), func(t *testing.T) {
opts := BuildOptions{ToolVersion: "0.0.0-test", RestatesSource: true}

Expand Down
12 changes: 10 additions & 2 deletions sbom/document_sources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func TestSourceLinkChecksumCoversTheSourceBytes(t *testing.T) {
// be built from nothing (bomly-dev/bomly-sdk#61). Provenance now survives more
// than one hop, which is the SDK's declared merge class for the source set.
func TestMergedSourceLinksSurviveASecondConversion(t *testing.T) {
for _, target := range []Target{TargetSPDX23JSON, TargetCycloneDX16JSON} {
for _, target := range []Target{TargetSPDX23JSON, TargetSPDX30JSON, TargetCycloneDX16JSON} {
t.Run(string(target), func(t *testing.T) {
first, _ := mergedExport(t, target, documentRichSPDX, serialCycloneDX)

Expand All @@ -196,6 +196,10 @@ func TestMergedSourceLinksSurviveASecondConversion(t *testing.T) {
for _, ref := range spdxExternalDocumentRefs(t, second) {
named = append(named, ref.URI)
}
case TargetSPDX30JSON:
for _, imported := range spdx3DocumentImports(t, second) {
named = append(named, imported.LocationHint)
}
default:
for _, ref := range cycloneDXSourceRefs(t, second) {
named = append(named, ref.URL)
Expand Down Expand Up @@ -245,7 +249,7 @@ func TestCycloneDXSourceLinksCarryTheirChecksum(t *testing.T) {
// A native scan names no sources: there were none.
func TestNativeExportNamesNoSources(t *testing.T) {
g := scopedGraph(t, model.ScopeRuntime)
for _, target := range []Target{TargetSPDX23JSON, TargetCycloneDX16JSON} {
for _, target := range []Target{TargetSPDX23JSON, TargetSPDX30JSON, TargetCycloneDX16JSON} {
t.Run(string(target), func(t *testing.T) {
raw, err := MarshalDepGraphJSON(g, target, BuildOptions{Created: fixedExportTime()}, EncodeOptions{Pretty: true})
if err != nil {
Expand All @@ -256,6 +260,10 @@ func TestNativeExportNamesNoSources(t *testing.T) {
if refs := spdxExternalDocumentRefs(t, raw); len(refs) != 0 {
t.Errorf("externalDocumentRefs = %+v, want none", refs)
}
case TargetSPDX30JSON:
if imports := spdx3DocumentImports(t, raw); len(imports) != 0 {
t.Errorf("imports = %+v, want none", imports)
}
default:
if refs := cycloneDXSourceRefs(t, raw); len(refs) != 0 {
t.Errorf("bom references = %+v, want none", refs)
Expand Down
2 changes: 1 addition & 1 deletion sbom/eol_round_trip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// defect 4). Each format keeps exactly what it can write: SPDX has no cycle
// field in its package comment, CycloneDX does.
func TestEOLSurvivesADocumentRoundTrip(t *testing.T) {
for _, target := range []Target{TargetSPDX23JSON, TargetCycloneDX16JSON} {
for _, target := range []Target{TargetSPDX23JSON, TargetSPDX30JSON, TargetCycloneDX16JSON} {
t.Run(string(target), func(t *testing.T) {
doc := &Document{
Name: "eol",
Expand Down
1 change: 1 addition & 0 deletions sbom/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type Target string

const (
TargetSPDX23JSON Target = "spdx-2.3+json"
TargetSPDX30JSON Target = "spdx-3.0+json"
TargetCycloneDX14JSON Target = "cyclonedx-1.4+json"
TargetCycloneDX15JSON Target = "cyclonedx-1.5+json"
TargetCycloneDX16JSON Target = "cyclonedx-1.6+json"
Expand Down
2 changes: 1 addition & 1 deletion sbom/origin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ func TestExportKeepsEveryFoldedOrigin(t *testing.T) {
t.Fatalf("graph holds %d dependency nodes; want the fixture's two", got)
}

for _, target := range []Target{TargetCycloneDX16JSON, TargetSPDX23JSON} {
for _, target := range []Target{TargetCycloneDX16JSON, TargetSPDX23JSON, TargetSPDX30JSON} {
out, err := MarshalDepGraphJSON(g, target, BuildOptions{}, EncodeOptions{})
if err != nil {
t.Fatalf("marshal %v: %v", target, err)
Expand Down
4 changes: 2 additions & 2 deletions sbom/scope_round_trip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func componentScopes(t *testing.T, doc *Document, name string) []model.Scope {
// formats. Before this, export wrote the single merged precedence value and
// the union PR #406 established stopped at the SBOM boundary.
func TestScopeSetSurvivesTheExportBoundary(t *testing.T) {
for _, target := range []Target{TargetSPDX23JSON, TargetCycloneDX16JSON} {
for _, target := range []Target{TargetSPDX23JSON, TargetSPDX30JSON, TargetCycloneDX16JSON} {
t.Run(string(target), func(t *testing.T) {
g := scopedGraph(t, model.ScopeRuntime, model.ScopeDevelopment)
raw, err := MarshalDepGraphJSON(g, target, BuildOptions{}, EncodeOptions{Pretty: true})
Expand Down Expand Up @@ -441,7 +441,7 @@ func TestUnknownScopeTokenKeepsTheKnownScopes(t *testing.T) {
// A document Bomly wrote names no unknown tokens, so the warning stays quiet
// on the ordinary path.
func TestAKnownCarrierReportsNoUnknownTokens(t *testing.T) {
for _, target := range []Target{TargetSPDX23JSON, TargetCycloneDX16JSON} {
for _, target := range []Target{TargetSPDX23JSON, TargetSPDX30JSON, TargetCycloneDX16JSON} {
t.Run(string(target), func(t *testing.T) {
g := scopedGraph(t, model.ScopeRuntime, model.ScopeDevelopment)
raw, err := MarshalDepGraphJSON(g, target, BuildOptions{}, EncodeOptions{Pretty: true})
Expand Down
21 changes: 17 additions & 4 deletions sbom/spdx23.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ import (
type spdx23Codec struct{}

func (spdx23Codec) encodeJSON(doc *Document, opts EncodeOptions) ([]byte, error) {
return marshalJSON(buildSPDX23Document(doc), opts.Pretty)
}

// buildSPDX23Document projects the intermediate document onto SPDX 2.3's
// model. It is shared with the SPDX 3 encoder, which converts this document
// with the specification library rather than projecting a second time, so
// the two SPDX encodings of one scan cannot disagree about what they say.
func buildSPDX23Document(doc *Document) *v23.Document {
idByComponent := make(map[string]common.ElementID, len(doc.Components))
ids := newSPDXIDAllocator(len(doc.Components))
packages := make([]*v23.Package, 0, len(doc.Components))
Expand Down Expand Up @@ -133,16 +141,21 @@ func (spdx23Codec) encodeJSON(doc *Document, opts EncodeOptions) ([]byte, error)
Relationships: relationships,
OtherLicenses: spdxOtherLicenses(extractedLicenses),
}

return marshalJSON(spdxDoc, opts.Pretty)
return spdxDoc
}

func (spdx23Codec) decodeJSON(data []byte) (*Document, error) {
var spdxDoc v23.Document
if err := json.Unmarshal(data, &spdxDoc); err != nil {
return nil, err
}
return documentFromSPDX23(&spdxDoc), nil
}

// documentFromSPDX23 reads an SPDX 2.3 model into the intermediate document.
// It is shared with the SPDX 3 decoder, which lowers its document to this
// model first, so both SPDX versions are read by one set of rules.
func documentFromSPDX23(spdxDoc *v23.Document) *Document {
extractedByRef := spdxExtractedTexts(spdxDoc.OtherLicenses)

components := make([]Component, 0, len(spdxDoc.Packages))
Expand Down Expand Up @@ -225,7 +238,7 @@ func (spdx23Codec) decodeJSON(data []byte) (*Document, error) {
return &Document{
Name: spdxDoc.DocumentName,
Namespace: spdxDoc.DocumentNamespace,
Assertions: spdxDocumentAssertions(&spdxDoc),
Assertions: spdxDocumentAssertions(spdxDoc),
Tool: extractSPDXToolName(spdxDoc.CreationInfo),
Tools: extractSPDXToolNames(spdxDoc.CreationInfo),
Created: parseSPDXCreated(spdxDoc.CreationInfo),
Expand All @@ -236,7 +249,7 @@ func (spdx23Codec) decodeJSON(data []byte) (*Document, error) {
Roots: roots,
Described: roots,
UnknownScopeTokens: unknownScopes,
}, nil
}
}

func sanitizeSPDXID(raw string) string {
Expand Down
Loading
Loading