-
Keith Zantow committed with GitHub 1 year ago1 parent e3d6ffd3
Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
-
-
-
-
-
-
-
syft/pkg/test-fixtures/cpe-data.json syft/cpe/test-fixtures/cpe-data.jsonContent is identical
-
-
-
-
-
-
-
skipped 15 lines 16 16 "github.com/anchore/stereoscope/pkg/image" 17 17 "github.com/anchore/stereoscope/pkg/imagetest" 18 18 "github.com/anchore/syft/syft/artifact" 19 + "github.com/anchore/syft/syft/cpe" 19 20 "github.com/anchore/syft/syft/linux" 20 21 "github.com/anchore/syft/syft/pkg" 21 22 "github.com/anchore/syft/syft/sbom" skipped 157 lines 179 180 Version: "1.0.1", 180 181 }, 181 182 PURL: "a-purl-1", // intentionally a bad pURL for test fixtures 182 - CPEs: []pkg.CPE{ 183 - pkg.MustCPE("cpe:2.3:*:some:package:1:*:*:*:*:*:*:*"), 183 + CPEs: []cpe.CPE{ 184 + cpe.Must("cpe:2.3:*:some:package:1:*:*:*:*:*:*:*"), 184 185 }, 185 186 }) 186 187 catalog.Add(pkg.Package{ skipped 10 lines 197 198 Version: "2.0.1", 198 199 }, 199 200 PURL: "pkg:deb/debian/[email protected]", 200 - CPEs: []pkg.CPE{ 201 - pkg.MustCPE("cpe:2.3:*:some:package:2:*:*:*:*:*:*:*"), 201 + CPEs: []cpe.CPE{ 202 + cpe.Must("cpe:2.3:*:some:package:2:*:*:*:*:*:*:*"), 202 203 }, 203 204 }) 204 205 } skipped 54 lines 259 260 }, 260 261 }, 261 262 PURL: "a-purl-2", // intentionally a bad pURL for test fixtures 262 - CPEs: []pkg.CPE{ 263 - pkg.MustCPE("cpe:2.3:*:some:package:2:*:*:*:*:*:*:*"), 263 + CPEs: []cpe.CPE{ 264 + cpe.Must("cpe:2.3:*:some:package:2:*:*:*:*:*:*:*"), 264 265 }, 265 266 }) 266 267 catalog.Add(pkg.Package{ skipped 10 lines 277 278 Version: "2.0.1", 278 279 }, 279 280 PURL: "pkg:deb/debian/[email protected]", 280 - CPEs: []pkg.CPE{ 281 - pkg.MustCPE("cpe:2.3:*:some:package:2:*:*:*:*:*:*:*"), 281 + CPEs: []cpe.CPE{ 282 + cpe.Must("cpe:2.3:*:some:package:2:*:*:*:*:*:*:*"), 282 283 }, 283 284 }) 284 285 skipped 25 lines -
-
-
-
-
-
-
-
-
-
-
-
-
-
skipped 7 lines 8 8 "github.com/stretchr/testify/require" 9 9 10 10 "github.com/anchore/stereoscope/pkg/file" 11 + "github.com/anchore/syft/syft/cpe" 11 12 "github.com/anchore/syft/syft/source" 12 13 ) 13 14 skipped 18 lines 32 33 }, 33 34 Language: "math", 34 35 Type: PythonPkg, 35 - CPEs: []CPE{ 36 - must(NewCPE(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`)), 36 + CPEs: []cpe.CPE{ 37 + cpe.Must(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`), 37 38 }, 38 39 PURL: "pkg:pypi/[email protected]", 39 40 MetadataType: PythonPackageMetadataType, skipped 129 lines 169 170 { 170 171 name: "CPEs is ignored", 171 172 transform: func(pkg Package) Package { 172 - pkg.CPEs = []CPE{} 173 + pkg.CPEs = []cpe.CPE{} 173 174 return pkg 174 175 }, 175 176 expectedIDComparison: assert.Equal, skipped 93 lines 269 270 }, 270 271 Language: "math", 271 272 Type: PythonPkg, 272 - CPEs: []CPE{ 273 - must(NewCPE(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`)), 273 + CPEs: []cpe.CPE{ 274 + cpe.Must(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`), 274 275 }, 275 276 PURL: "pkg:pypi/[email protected]", 276 277 MetadataType: PythonPackageMetadataType, skipped 20 lines 297 298 }, 298 299 Language: "math", 299 300 Type: PythonPkg, 300 - CPEs: []CPE{ 301 - must(NewCPE(`cpe:2.3:a:DIFFERENT:pi:3.14:*:*:*:*:math:*:*`)), // NOTE: difference 301 + CPEs: []cpe.CPE{ 302 + cpe.Must(`cpe:2.3:a:DIFFERENT:pi:3.14:*:*:*:*:math:*:*`), // NOTE: difference 302 303 }, 303 304 PURL: "pkg:pypi/[email protected]", 304 305 MetadataType: PythonPackageMetadataType, skipped 21 lines 326 327 }, 327 328 Language: "math", 328 329 Type: PythonPkg, 329 - CPEs: []CPE{ 330 - must(NewCPE(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`)), 331 - must(NewCPE(`cpe:2.3:a:DIFFERENT:pi:3.14:*:*:*:*:math:*:*`)), // NOTE: merge! 330 + CPEs: []cpe.CPE{ 331 + cpe.Must(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`), 332 + cpe.Must(`cpe:2.3:a:DIFFERENT:pi:3.14:*:*:*:*:math:*:*`), // NOTE: merge! 332 333 }, 333 334 PURL: "pkg:pypi/[email protected]", 334 335 MetadataType: PythonPackageMetadataType, skipped 23 lines 358 359 }, 359 360 Language: "math", 360 361 Type: PythonPkg, 361 - CPEs: []CPE{ 362 - must(NewCPE(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`)), 362 + CPEs: []cpe.CPE{ 363 + cpe.Must(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`), 363 364 }, 364 365 PURL: "pkg:pypi/[email protected]", 365 366 MetadataType: PythonPackageMetadataType, skipped 20 lines 386 387 }, 387 388 Language: "math", 388 389 Type: PythonPkg, 389 - CPEs: []CPE{ 390 - must(NewCPE(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`)), 390 + CPEs: []cpe.CPE{ 391 + cpe.Must(`cpe:2.3:a:Archimedes:pi:3.14:*:*:*:*:math:*:*`), 391 392 }, 392 393 PURL: "pkg:pypi/[email protected]", 393 394 MetadataType: PythonPackageMetadataType, skipped 73 lines