mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 06:26:30 +01:00
feat: Add the origin field to the output format of syftjson (#1327)
* moved the relevant fields to the Metadata field Signed-off-by: Asaf Greenholts <asaf@cidersecurity.io> * added metadata types Signed-off-by: Asaf Greenholts <asaf@cidersecurity.io> * Added hashes to metadata of packge-lock.json and Pipfile.lock Signed-off-by: Asaf Greenholts <asaf@cidersecurity.io> * move package metadata types to "pkg" package Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * re-generate json schema to include new npm, python, and binary metadatas Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Asaf Greenholts <asaf@cidersecurity.io> Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
co-authored by
Alex Goodman
parent
85bddaa43d
commit
260cb4c72d
@@ -23,6 +23,23 @@ func newPackageForIndex(name, version string, locations ...source.Location) pkg.
|
||||
return p
|
||||
}
|
||||
|
||||
func newPackageForIndexWithMetadata(name, version string, metadata pkg.PythonPipfileLockMetadata, locations ...source.Location) pkg.Package {
|
||||
p := pkg.Package{
|
||||
Name: name,
|
||||
Version: version,
|
||||
Locations: source.NewLocationSet(locations...),
|
||||
PURL: packageURL(name, version, nil),
|
||||
Language: pkg.Python,
|
||||
Type: pkg.PythonPkg,
|
||||
MetadataType: pkg.PythonPipfileLockMetadataType,
|
||||
Metadata: metadata,
|
||||
}
|
||||
|
||||
p.SetID()
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
func newPackageForPackage(m pkg.PythonPackageMetadata, sources ...source.Location) pkg.Package {
|
||||
var licenses []string
|
||||
if m.License != "" {
|
||||
|
||||
Reference in New Issue
Block a user