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

Generated PURLs may contain invalid PURL types #8

Open
aried3r opened this issue May 3, 2024 · 0 comments
Open

Generated PURLs may contain invalid PURL types #8

aried3r opened this issue May 3, 2024 · 0 comments

Comments

@aried3r
Copy link

aried3r commented May 3, 2024

When generating an SPDX file for a Python project, the resulting PURL might be pkg:PIP/[email protected] using this GitHub Action which contains an invalid PURL type, "PIP". This seems to be because the GraphQL response contains uses the packageManager string directly and does not convert it to a valid PURL type, if it exists.

// Returns the PURL for the given dependency.
function getPurl(dependency) {
let version = getPackageVersion(dependency.requirements);
return `pkg:${dependency.packageManager}/${dependency.packageName}@${version}`;
}

The PURL type is case insensitive, but it's canonical form is lowercase, so perhaps calling .toLowerCase() on it might make sense as well.

Observed behavior

pkg:PIP/[email protected]

Expected behavior

pkg:pypi/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant