feat(PackageURL):add package URL for library scan result (#1862)

* add: package url in model.Library

* feat(trivy-to-vuls): add purl for library scan result

* feat(scanner/library): add purl for lockfile scan result

* fix: model.Library test

* fix: trivy-to-vuls test data

* fix: panic case to generate purl

* fix: add blank line

* fix: trivy-to-vuls for using Trivy version 0.49.0 or earlier

* fix: remove comment

* fix: remove print

* fix: testcase for Package.Identifier does not exist version

* fix: add blank line

* fix: expected libs

* fix: PackageURL -> PURL

* fix: blank line
This commit is contained in:
tk007
2024-03-06 23:21:15 -08:00
committed by GitHub
parent bf14b5f61f
commit be7b9114cc
5 changed files with 67 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ func TestLibraryScanners_Find(t *testing.T) {
{
Name: "libA",
Version: "1.0.0",
PURL: "scheme/type/namespace/libA@1.0.0?qualifiers#subpath",
},
},
},
@@ -34,6 +35,7 @@ func TestLibraryScanners_Find(t *testing.T) {
"/pathA": {
Name: "libA",
Version: "1.0.0",
PURL: "scheme/type/namespace/libA@1.0.0?qualifiers#subpath",
},
},
},
@@ -46,6 +48,7 @@ func TestLibraryScanners_Find(t *testing.T) {
{
Name: "libA",
Version: "1.0.0",
PURL: "scheme/type/namespace/libA@1.0.0?qualifiers#subpath",
},
},
},
@@ -55,6 +58,7 @@ func TestLibraryScanners_Find(t *testing.T) {
{
Name: "libA",
Version: "1.0.5",
PURL: "scheme/type/namespace/libA@1.0.5?qualifiers#subpath",
},
},
},
@@ -64,6 +68,7 @@ func TestLibraryScanners_Find(t *testing.T) {
"/pathA": {
Name: "libA",
Version: "1.0.0",
PURL: "scheme/type/namespace/libA@1.0.0?qualifiers#subpath",
},
},
},
@@ -76,6 +81,7 @@ func TestLibraryScanners_Find(t *testing.T) {
{
Name: "libA",
Version: "1.0.0",
PURL: "scheme/type/namespace/libA@1.0.0?qualifiers#subpath",
},
},
},