Internalize majority of cmd package (#2533)

* internalize majority of cmd package and migrate integration tests

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* add internal api encoder

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* create internal representation of all formats

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* export capability to get default encoders

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* restore test fixtures

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2024-01-24 13:29:51 -05:00
committed by GitHub
parent bf3cd9ed3b
commit e0e1c4ba0a
232 changed files with 809 additions and 661 deletions
@@ -0,0 +1,3 @@
FROM scratch
COPY go.mod /
COPY test.spdx.json /
@@ -0,0 +1,8 @@
module github.com/anchore/syft
go 1.14
require (
github.com/anchore/packageurl-go v0.1.1-0.20220428202044-a072fa3cb6d7
github.com/bmatcuk/doublestar v1.3.1
)
@@ -0,0 +1,39 @@
{
"SPDXID": "SPDXRef-DOCUMENT",
"name": "test/integration/test-fixtures/image-sbom-cataloger",
"spdxVersion": "SPDX-2.2",
"creationInfo": {
"created": "2022-08-18T05:23:38.066146511Z",
"creators": [
"Organization: Anchore, Inc",
"Tool: syft-0.53.0"
],
"licenseListVersion": "3.17"
},
"dataLicense": "CC0-1.0",
"documentNamespace": "https://anchore.com/syft/dir/test/integration/test-fixtures/image-sbom-cataloger-057e7aa2-332c-4b50-bbd1-a17dd62ddce4",
"packages": [
{
"SPDXID": "SPDXRef-45209ca0cdcbafa",
"name": "github.com/bmatcuk/doublestar",
"licenseConcluded": "NONE",
"downloadLocation": "NOASSERTION",
"externalRefs": [
{
"referenceCategory": "SECURITY",
"referenceLocator": "cpe:2.3:a:bmatcuk:doublestar:v1.3.1:*:*:*:*:*:*:*",
"referenceType": "cpe23Type"
},
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceLocator": "pkg:golang/github.com/bmatcuk/doublestar@v1.3.1",
"referenceType": "purl"
}
],
"filesAnalyzed": false,
"licenseDeclared": "NONE",
"sourceInfo": "acquired package info from go module information: go.mod",
"versionInfo": "v1.3.1"
}
]
}