feat: detect when full license text has been provided and preserve as separate field (#3450)

* feat: add full text field to syft license struct
---------
Signed-off-by: Christopher Angelo Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
Christopher Angelo Phillips
2025-05-01 15:00:46 -04:00
committed by GitHub
parent 4999de4114
commit 94e63eb367
23 changed files with 3282 additions and 426 deletions
+1
View File
@@ -47,6 +47,7 @@ type licenses []License
type License struct {
Value string `json:"value"`
FullText string `json:"fullText"`
SPDXExpression string `json:"spdxExpression"`
Type license.Type `json:"type"`
URLs []string `json:"urls"`
@@ -1,7 +1,7 @@
{
"artifacts": [
{
"id": "5a2b1ae000fcb51e",
"id": "cf21bacaa74c8c08",
"name": "package-1",
"version": "1.0.1",
"type": "python",
@@ -15,6 +15,7 @@
"licenses": [
{
"value": "MIT",
"fullText": "",
"spdxExpression": "MIT",
"type": "declared",
"urls": [],
@@ -1,7 +1,7 @@
{
"artifacts": [
{
"id": "ad3ecac55fe1c30f",
"id": "783177db0211edb6",
"name": "package-1",
"version": "1.0.1",
"type": "python",
@@ -15,6 +15,7 @@
"licenses": [
{
"value": "MIT",
"fullText": "",
"spdxExpression": "MIT",
"type": "declared",
"urls": [],
@@ -1,7 +1,7 @@
{
"artifacts": [
{
"id": "c5cf7ac34cbca450",
"id": "2d8996d6f81313df",
"name": "package-1",
"version": "1.0.1",
"type": "python",
@@ -16,6 +16,7 @@
"licenses": [
{
"value": "MIT",
"fullText": "",
"spdxExpression": "MIT",
"type": "declared",
"urls": [],
+1
View File
@@ -230,6 +230,7 @@ func toLicenseModel(pkgLicenses []pkg.License) (modelLicenses []model.License) {
modelLicenses = append(modelLicenses, model.License{
Value: l.Value,
FullText: l.FullText,
SPDXExpression: l.SPDXExpression,
Type: l.Type,
URLs: urls,