mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
* Improve CycloneDX format output ## Additions to CycloneDX output * CPEs * Authors * Publishers * External References (Website, Distribution, VCS) * Description Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
27 lines
666 B
Go
27 lines
666 B
Go
package cyclonedxhelpers
|
|
|
|
import (
|
|
"github.com/CycloneDX/cyclonedx-go"
|
|
"github.com/anchore/syft/syft/pkg"
|
|
)
|
|
|
|
func Component(p pkg.Package) cyclonedx.Component {
|
|
return cyclonedx.Component{
|
|
Type: cyclonedx.ComponentTypeLibrary,
|
|
Name: p.Name,
|
|
Version: p.Version,
|
|
PackageURL: p.PURL,
|
|
Licenses: Licenses(p),
|
|
CPE: CPE(p),
|
|
Author: Author(p),
|
|
Publisher: Publisher(p),
|
|
Description: Description(p),
|
|
ExternalReferences: ExternalReferences(p),
|
|
Properties: Properties(p),
|
|
}
|
|
}
|
|
|
|
func hasMetadata(p pkg.Package) bool {
|
|
return p.Metadata != nil
|
|
}
|