Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spdx: allow specifying custom license #1127

Merged
merged 3 commits into from
May 16, 2024
Merged
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion pkg/sbom/generator/spdx/spdx.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022, 2023 Chainguard, Inc.
// Copyright 2022-2024 Chainguard, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -459,6 +459,7 @@
Packages []Package `json:"packages"`
Relationships []Relationship `json:"relationships"`
ExternalDocumentRefs []ExternalDocumentRef `json:"externalDocumentRefs,omitempty"`
LicensingInfos []LicensingInfo `json:"hasExtractedLicensingInfos,omitempty"`
}

type ExternalDocumentRef struct {
Expand All @@ -467,6 +468,12 @@
SPDXDocument string `json:"spdxDocument"`
}

// Can also contain name, comment, seeAlso
type LicensingInfo struct {
LicenseId string `json:"licenseId"`

Check failure on line 473 in pkg/sbom/generator/spdx/spdx.go

View workflow job for this annotation

GitHub Actions / lint

ST1003: struct field LicenseId should be LicenseID (stylecheck)
xnox marked this conversation as resolved.
Show resolved Hide resolved
ExtractedText string `json:"extractedText"`
}

type CreationInfo struct {
Created string `json:"created"` // Date
Creators []string `json:"creators"`
Expand Down
Loading