mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +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>
20 lines
356 B
Go
20 lines
356 B
Go
package cyclonedxhelpers
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/pkg"
|
|
)
|
|
|
|
func Publisher(p pkg.Package) string {
|
|
if hasMetadata(p) {
|
|
switch metadata := p.Metadata.(type) {
|
|
case pkg.ApkMetadata:
|
|
return metadata.Maintainer
|
|
case pkg.RpmdbMetadata:
|
|
return metadata.Vendor
|
|
case pkg.DpkgMetadata:
|
|
return metadata.Maintainer
|
|
}
|
|
}
|
|
return ""
|
|
}
|