feat: add fullText as optional field to syft model

Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
Christopher Phillips 2024-09-17 12:29:20 -04:00
parent 2f7bacd6bc
commit 30d6eb53ac
No known key found for this signature in database
4 changed files with 6 additions and 2 deletions

View file

@ -1,9 +1,10 @@
package file
import (
"strings"
"github.com/anchore/syft/internal/log"
licensepkg "github.com/anchore/syft/syft/license"
"strings"
)
type License struct {

View file

@ -48,6 +48,7 @@ type licenses []License
type License struct {
Value string `json:"value"`
SPDXExpression string `json:"spdxExpression"`
FullText string `json:"fullText,omitempty"`
Type license.Type `json:"type"`
URLs []string `json:"urls"`
Locations []file.Location `json:"locations"`

View file

@ -225,6 +225,7 @@ func toLicenseModel(pkgLicenses []pkg.License) (modelLicenses []model.License) {
modelLicenses = append(modelLicenses, model.License{
Value: l.Value,
SPDXExpression: l.SPDXExpression,
FullText: l.FullText,
Type: l.Type,
URLs: urls,
Locations: locations,

View file

@ -3,11 +3,12 @@ package ocaml
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/anchore/syft/syft/artifact"
"github.com/anchore/syft/syft/file"
"github.com/anchore/syft/syft/pkg"
"github.com/anchore/syft/syft/pkg/cataloger/internal/pkgtest"
"github.com/stretchr/testify/assert"
)
func TestParseOpamPackage(t *testing.T) {