feat: update licenses to including license content when SPDX expressions are unable to be determined (#3366)

---------
Signed-off-by: HeyeOpenSource <opensource@heye-international.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Co-authored-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
HeyeOpenSource
2025-01-28 18:05:27 +00:00
committed by GitHub
co-authored by Christopher Phillips
parent 58dc43de86
commit f7e767fc25
21 changed files with 3291 additions and 43 deletions
+1
View File
@@ -51,6 +51,7 @@ type License struct {
Type license.Type `json:"type"`
URLs []string `json:"urls"`
Locations []file.Location `json:"locations"`
Contents string `json:"contents,omitempty"`
}
func newModelLicensesFromValues(licenses []string) (ml []License) {
+1
View File
@@ -234,6 +234,7 @@ func toLicenseModel(pkgLicenses []pkg.License) (modelLicenses []model.License) {
Type: l.Type,
URLs: urls,
Locations: locations,
Contents: l.Contents,
})
}
return
+1
View File
@@ -164,6 +164,7 @@ func toSyftLicenses(m []model.License) (p []pkg.License) {
Type: l.Type,
URLs: l.URLs,
Locations: file.NewLocationSet(l.Locations...),
Contents: l.Contents,
})
}
return