mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
* improved parsing of vendor from github url Signed-off-by: Weston Steimel <weston.steimel@anchore.com> * stop generating wildcard vendors Add logic for parsing javascript and ruby package vendor candidates from url and author fields and stop generating wildcard vendor candidates Signed-off-by: Weston Steimel <weston.steimel@anchore.com> --------- Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
27 lines
568 B
Go
27 lines
568 B
Go
package cpe
|
|
|
|
import "github.com/anchore/syft/syft/pkg"
|
|
|
|
func candidateVendorsForRuby(p pkg.Package) fieldCandidateSet {
|
|
metadata, ok := p.Metadata.(pkg.GemMetadata)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
|
|
vendors := newFieldCandidateSet()
|
|
|
|
for _, author := range metadata.Authors {
|
|
// author could be a name or an email
|
|
vendors.add(fieldCandidate{
|
|
value: normalizePersonName(stripEmailSuffix(author)),
|
|
disallowSubSelections: true,
|
|
})
|
|
}
|
|
|
|
if metadata.Homepage != "" {
|
|
vendors.union(candidateVendorsFromURL(metadata.Homepage))
|
|
}
|
|
|
|
return vendors
|
|
}
|