Skip to content

Commit

Permalink
fix: use organization for package supplier when reading Java vendor f…
Browse files Browse the repository at this point in the history
…ields (#3093)

Signed-off-by: Harippriya Sivapatham <[email protected]>
  • Loading branch information
harippriyas authored Aug 3, 2024
1 parent 623532e commit cc15edc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions syft/format/internal/spdxutil/helpers/originator_supplier.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func Originator(p pkg.Package) (typ string, author string) { // nolint: funlen
if author == "" {
author = metadata.Manifest.Main.MustGet("Implementation-Vendor")
}
// Vendor is specified, hence set 'Organization' as the PackageSupplier
if author != "" {
typ = orgType
}
}

case pkg.LinuxKernelModule:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func Test_OriginatorSupplier(t *testing.T) {
},
},
},
originator: "Person: auth-spec",
supplier: "Person: auth-spec",
originator: "Organization: auth-spec",
supplier: "Organization: auth-spec",
},
{
name: "from java -- fallback to impl vendor in main manifest section",
Expand All @@ -155,8 +155,8 @@ func Test_OriginatorSupplier(t *testing.T) {
},
},
},
originator: "Person: auth-impl",
supplier: "Person: auth-impl",
originator: "Organization: auth-impl",
supplier: "Organization: auth-impl",
},
{
name: "from java -- non-main manifest sections ignored",
Expand Down

0 comments on commit cc15edc

Please sign in to comment.