-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.scan/licenseIssues relating to license scanningIssues relating to license scanning
Milestone
Description
Description
To create unique IDs, we started using the snapshot instead of the Trivy ID — #9330.
But package.json files (from the node_modules directory) don’t have peer dependencies in the package name.
So we can’t match the pkg.ID with the peer dependencies and license.
e.g.:
found package:
{
"ID": "@vue/[email protected]([email protected])",
"Name": "@vue/server-renderer",
"Identifier": {
"PURL": "pkg:npm/%40vue/[email protected]",
"UID": "d42cdcee2561bb3d"
},
"Version": "3.5.22",
"Indirect": true,
"Relationship": "indirect",
"DependsOn": [
"@vue/[email protected]",
"@vue/[email protected]",
"[email protected]"
]
},node_modules/@vue/server-renderer/package.json:
Solution
We use dependency.ID for package.json files:
| id = dependency.ID(ftypes.NodePkg, pkgJSON.Name, pkgJSON.Version) |
So we need to use the same logic to match packages when finding licenses.
Discussed in #9658
twwd
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.scan/licenseIssues relating to license scanningIssues relating to license scanning