mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
fix: use organization for package supplier when reading Java vendor fields (#3093)
Signed-off-by: Harippriya Sivapatham <harippriyasivapatham@gmail.com>
This commit is contained in:
parent
623532e3ed
commit
cc15edca62
@ -56,6 +56,10 @@ func Originator(p pkg.Package) (typ string, author string) { // nolint: funlen
|
|||||||
if author == "" {
|
if author == "" {
|
||||||
author = metadata.Manifest.Main.MustGet("Implementation-Vendor")
|
author = metadata.Manifest.Main.MustGet("Implementation-Vendor")
|
||||||
}
|
}
|
||||||
|
// Vendor is specified, hence set 'Organization' as the PackageSupplier
|
||||||
|
if author != "" {
|
||||||
|
typ = orgType
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case pkg.LinuxKernelModule:
|
case pkg.LinuxKernelModule:
|
||||||
|
|||||||
@ -138,8 +138,8 @@ func Test_OriginatorSupplier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
originator: "Person: auth-spec",
|
originator: "Organization: auth-spec",
|
||||||
supplier: "Person: auth-spec",
|
supplier: "Organization: auth-spec",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "from java -- fallback to impl vendor in main manifest section",
|
name: "from java -- fallback to impl vendor in main manifest section",
|
||||||
@ -155,8 +155,8 @@ func Test_OriginatorSupplier(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
originator: "Person: auth-impl",
|
originator: "Organization: auth-impl",
|
||||||
supplier: "Person: auth-impl",
|
supplier: "Organization: auth-impl",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "from java -- non-main manifest sections ignored",
|
name: "from java -- non-main manifest sections ignored",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user