Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPDX originator is not always populated #2632

Closed
wagoodman opened this issue Feb 13, 2024 · 0 comments · Fixed by #2822
Closed

SPDX originator is not always populated #2632

wagoodman opened this issue Feb 13, 2024 · 0 comments · Fixed by #2822
Assignees
Labels
bug Something isn't working format:spdx SPDX related enhancement or bug

Comments

@wagoodman
Copy link
Contributor

When determining originator we only consider select ecosystems:

switch metadata := p.Metadata.(type) {
case pkg.ApkDBEntry:
author = metadata.Maintainer
case pkg.NpmPackage:
author = metadata.Author
case pkg.PythonPackage:
author = metadata.Author
if author == "" {
author = metadata.AuthorEmail
} else if metadata.AuthorEmail != "" {
author = fmt.Sprintf("%s (%s)", author, metadata.AuthorEmail)
}
case pkg.RubyGemspec:
if len(metadata.Authors) > 0 {
author = metadata.Authors[0]
}
case pkg.RpmDBEntry:
typ = "Organization"
author = metadata.Vendor
case pkg.DpkgDBEntry:
author = metadata.Maintainer
}
if typ == "" && author != "" {
typ = "Person"

Ideally we should expand this to fill in an answer in as many ecosystems as possible. There have been suggestions to at least add Java under consideration, looking specifically at the Specification-Vendor followed by Implementation-Vendor for non-empty values to use as an originator.

We should probably add a completion-test for this, which exhaustively covers all metadata types (use this). This way we can ensure that as new metadata types are added we can fail if there isn't an explicit test to cover originator functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working format:spdx SPDX related enhancement or bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant