-
Christopher Angelo Phillips committed with GitHub 12 months ago1 parent 8046f095
Showing first 75 files as there are too many
-
-
-
-
-
-
-
-
-
skipped 35 lines 36 36 OriginPackage: "libc-dev", 37 37 Maintainer: "Natanael Copa <[email protected]>", 38 38 Version: "0.7.2-r0", 39 - License: "BSD", 40 39 Architecture: "x86_64", 41 40 URL: "http://alpinelinux.org", 42 41 Description: "Meta package to pull in correct libc", skipped 97 lines 140 139 Version: "0.9.2", 141 140 SourceRpm: "dive-0.9.2-1.src.rpm", 142 141 Size: 12406784, 143 - License: "MIT", 144 142 Vendor: "", 145 143 Files: []pkg.RpmdbFileRecord{}, 146 144 }, skipped 203 lines -
-
-
-
-
-
-
-
skipped 1 lines 2 2 "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", 3 3 "bomFormat": "CycloneDX", 4 4 "specVersion": "1.4", 5 - "serialNumber": "urn:uuid:redacted", 5 + "serialNumber": "urn:uuid:1b71a5b4-4bc5-4548-a51a-212e631976cd", 6 6 "version": 1, 7 7 "metadata": { 8 - "timestamp": "timestamp:redacted", 8 + "timestamp": "2023-05-08T14:40:32-04:00", 9 9 "tools": [ 10 10 { 11 11 "vendor": "anchore", skipped 2 lines 14 14 } 15 15 ], 16 16 "component": { 17 - "bom-ref": "redacted", 17 + "bom-ref": "163686ac6e30c752", 18 18 "type": "file", 19 19 "name": "/some/path" 20 20 } 21 21 }, 22 22 "components": [ 23 23 { 24 - "bom-ref": "redacted", 24 + "bom-ref": "8c7e1242588c971a", 25 25 "type": "library", 26 26 "name": "package-1", 27 27 "version": "1.0.1", skipped 30 lines 58 58 ] 59 59 }, 60 60 { 61 - "bom-ref": "redacted", 61 + "bom-ref": "pkg:deb/debian/[email protected]?package-id=db4abfe497c180d3", 62 62 "type": "library", 63 63 "name": "package-2", 64 64 "version": "2.0.1", skipped 57 lines -
skipped 1 lines 2 2 "$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json", 3 3 "bomFormat": "CycloneDX", 4 4 "specVersion": "1.4", 5 - "serialNumber": "urn:uuid:redacted", 5 + "serialNumber": "urn:uuid:1695d6ae-0ddf-4e77-9c9d-74df1bdd8d5b", 6 6 "version": 1, 7 7 "metadata": { 8 - "timestamp": "timestamp:redacted", 8 + "timestamp": "2023-05-08T14:40:32-04:00", 9 9 "tools": [ 10 10 { 11 11 "vendor": "anchore", skipped 2 lines 14 14 } 15 15 ], 16 16 "component": { 17 - "bom-ref": "redacted", 17 + "bom-ref": "38160ebc2a6876e8", 18 18 "type": "container", 19 19 "name": "user-image-input", 20 - "version": "sha256:redacted" 20 + "version": "sha256:2731251dc34951c0e50fcc643b4c5f74922dad1a5d98f302b504cf46cd5d9368" 21 21 } 22 22 }, 23 23 "components": [ 24 24 { 25 - "bom-ref": "redacted", 25 + "bom-ref": "ec2e0c93617507ef", 26 26 "type": "library", 27 27 "name": "package-1", 28 28 "version": "1.0.1", skipped 25 lines 54 54 }, 55 55 { 56 56 "name": "syft:location:0:layerID", 57 - "value": "sha256:redacted" 57 + "value": "sha256:ab62016f9bec7286af65604081564cadeeb364a48faca2346c3f5a5a1f5ef777" 58 58 }, 59 59 { 60 60 "name": "syft:location:0:path", skipped 2 lines 63 63 ] 64 64 }, 65 65 { 66 - "bom-ref": "redacted", 66 + "bom-ref": "pkg:deb/debian/[email protected]?package-id=958443e2d9304af4", 67 67 "type": "library", 68 68 "name": "package-2", 69 69 "version": "2.0.1", skipped 14 lines 84 84 }, 85 85 { 86 86 "name": "syft:location:0:layerID", 87 - "value": "sha256:redacted" 87 + "value": "sha256:f1803845b6747d94d6e4ecce2331457e5f1c4fb97de5216f392a76f4582f63b2" 88 88 }, 89 89 { 90 90 "name": "syft:location:0:path", skipped 40 lines -
syft/formats/cyclonedxjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.goldenBinary file.
-
-
-
-
syft/formats/cyclonedxxml/test-fixtures/snapshot/stereoscope-fixture-image-simple.goldenBinary file.
-
-
-
-
-
syft/formats/spdxjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.goldenBinary file.
-
-
skipped 1 lines 2 2 DataLicense: CC0-1.0 3 3 SPDXID: SPDXRef-DOCUMENT 4 4 DocumentName: user-image-input 5 - DocumentNamespace: https://anchore.com/syft/image/user-image-input-5be37b11-b99a-47ff-8725-3984e323d129 5 + DocumentNamespace: https://anchore.com/syft/image/user-image-input-96ea886a-3297-4847-b211-6da405ff1f8f 6 6 LicenseListVersion: 3.20 7 7 Creator: Organization: Anchore, Inc 8 8 Creator: Tool: syft-v0.42.0-bogus 9 - Created: 2023-05-02T18:24:33Z 9 + Created: 2023-05-09T17:11:49Z 10 10 11 11 ##### Unpackaged files 12 12 skipped 41 lines 54 54 PackageDownloadLocation: NOASSERTION 55 55 FilesAnalyzed: false 56 56 PackageSourceInfo: acquired package info from DPKG DB: /somefile-2.txt 57 - PackageLicenseConcluded: NONE 58 - PackageLicenseDeclared: NONE 57 + PackageLicenseConcluded: NOASSERTION 58 + PackageLicenseDeclared: NOASSERTION 59 59 PackageCopyrightText: NOASSERTION 60 60 ExternalRef: SECURITY cpe23Type cpe:2.3:*:some:package:2:*:*:*:*:*:*:* 61 61 ExternalRef: PACKAGE-MANAGER purl pkg:deb/debian/[email protected] skipped 1 lines 63 63 ##### Package: package-1 64 64 65 65 PackageName: package-1 66 - SPDXID: SPDXRef-Package-python-package-1-66ba429119b8bec6 66 + SPDXID: SPDXRef-Package-python-package-1-125840abc1c66dd7 67 67 PackageVersion: 1.0.1 68 68 PackageDownloadLocation: NOASSERTION 69 69 FilesAnalyzed: false 70 70 PackageSourceInfo: acquired package info from installed python package manifest file: /somefile-1.txt 71 - PackageLicenseConcluded: MIT 71 + PackageLicenseConcluded: NOASSERTION 72 72 PackageLicenseDeclared: MIT 73 73 PackageCopyrightText: NOASSERTION 74 74 ExternalRef: SECURITY cpe23Type cpe:2.3:*:some:package:1:*:*:*:*:*:*:* skipped 1 lines 76 76 77 77 ##### Relationships 78 78 79 - Relationship: SPDXRef-Package-python-package-1-66ba429119b8bec6 CONTAINS SPDXRef-File-f1-5265a4dde3edbf7c 80 - Relationship: SPDXRef-Package-python-package-1-66ba429119b8bec6 CONTAINS SPDXRef-File-z1-f5-839d99ee67d9d174 81 - Relationship: SPDXRef-Package-python-package-1-66ba429119b8bec6 CONTAINS SPDXRef-File-a1-f6-9c2f7510199b17f6 82 - Relationship: SPDXRef-Package-python-package-1-66ba429119b8bec6 CONTAINS SPDXRef-File-d2-f4-c641caa71518099f 83 - Relationship: SPDXRef-Package-python-package-1-66ba429119b8bec6 CONTAINS SPDXRef-File-d1-f3-c6f5b29dca12661f 84 - Relationship: SPDXRef-Package-python-package-1-66ba429119b8bec6 CONTAINS SPDXRef-File-f2-f9e49132a4b96ccd 79 + Relationship: SPDXRef-Package-python-package-1-125840abc1c66dd7 CONTAINS SPDXRef-File-f1-5265a4dde3edbf7c 80 + Relationship: SPDXRef-Package-python-package-1-125840abc1c66dd7 CONTAINS SPDXRef-File-z1-f5-839d99ee67d9d174 81 + Relationship: SPDXRef-Package-python-package-1-125840abc1c66dd7 CONTAINS SPDXRef-File-a1-f6-9c2f7510199b17f6 82 + Relationship: SPDXRef-Package-python-package-1-125840abc1c66dd7 CONTAINS SPDXRef-File-d2-f4-c641caa71518099f 83 + Relationship: SPDXRef-Package-python-package-1-125840abc1c66dd7 CONTAINS SPDXRef-File-d1-f3-c6f5b29dca12661f 84 + Relationship: SPDXRef-Package-python-package-1-125840abc1c66dd7 CONTAINS SPDXRef-File-f2-f9e49132a4b96ccd 85 85 Relationship: SPDXRef-DOCUMENT DESCRIBES SPDXRef-DOCUMENT 86 86 87 87 -
skipped 1 lines 2 2 DataLicense: CC0-1.0 3 3 SPDXID: SPDXRef-DOCUMENT 4 4 DocumentName: /some/path 5 - DocumentNamespace: https://anchore.com/syft/dir/some/path-0f346656-6d10-4dec-b549-a256468cbd35 5 + DocumentNamespace: https://anchore.com/syft/dir/some/path-f7bdb1ee-7fef-48e7-a386-6ee3836d4a28 6 6 LicenseListVersion: 3.20 7 7 Creator: Organization: Anchore, Inc 8 8 Creator: Tool: syft-v0.42.0-bogus 9 - Created: 2023-05-02T18:24:33Z 9 + Created: 2023-05-09T17:11:49Z 10 10 11 11 ##### Package: package-2 12 12 skipped 3 lines 16 16 PackageDownloadLocation: NOASSERTION 17 17 FilesAnalyzed: false 18 18 PackageSourceInfo: acquired package info from DPKG DB: /some/path/pkg1 19 - PackageLicenseConcluded: NONE 20 - PackageLicenseDeclared: NONE 19 + PackageLicenseConcluded: NOASSERTION 20 + PackageLicenseDeclared: NOASSERTION 21 21 PackageCopyrightText: NOASSERTION 22 22 ExternalRef: SECURITY cpe23Type cpe:2.3:*:some:package:2:*:*:*:*:*:*:* 23 23 ExternalRef: PACKAGE-MANAGER purl pkg:deb/debian/[email protected] skipped 1 lines 25 25 ##### Package: package-1 26 26 27 27 PackageName: package-1 28 - SPDXID: SPDXRef-Package-python-package-1-1b1d0be59ac59d2c 28 + SPDXID: SPDXRef-Package-python-package-1-9265397e5e15168a 29 29 PackageVersion: 1.0.1 30 30 PackageDownloadLocation: NOASSERTION 31 31 FilesAnalyzed: false 32 32 PackageSourceInfo: acquired package info from installed python package manifest file: /some/path/pkg1 33 - PackageLicenseConcluded: MIT 33 + PackageLicenseConcluded: NOASSERTION 34 34 PackageLicenseDeclared: MIT 35 35 PackageCopyrightText: NOASSERTION 36 36 ExternalRef: SECURITY cpe23Type cpe:2.3:*:some:package:2:*:*:*:*:*:*:* skipped 7 lines -
skipped 1 lines 2 2 DataLicense: CC0-1.0 3 3 SPDXID: SPDXRef-DOCUMENT 4 4 DocumentName: user-image-input 5 - DocumentNamespace: https://anchore.com/syft/image/user-image-input-4ce1e7c7-642f-4428-bb44-1b48b8edf74d 5 + DocumentNamespace: https://anchore.com/syft/image/user-image-input-44d44a85-2207-4b51-bd73-d0c7b080f6d3 6 6 LicenseListVersion: 3.20 7 7 Creator: Organization: Anchore, Inc 8 8 Creator: Tool: syft-v0.42.0-bogus 9 - Created: 2023-05-02T18:24:33Z 9 + Created: 2023-05-09T17:11:49Z 10 10 11 11 ##### Package: package-2 12 12 skipped 3 lines 16 16 PackageDownloadLocation: NOASSERTION 17 17 FilesAnalyzed: false 18 18 PackageSourceInfo: acquired package info from DPKG DB: /somefile-2.txt 19 - PackageLicenseConcluded: NONE 20 - PackageLicenseDeclared: NONE 19 + PackageLicenseConcluded: NOASSERTION 20 + PackageLicenseDeclared: NOASSERTION 21 21 PackageCopyrightText: NOASSERTION 22 22 ExternalRef: SECURITY cpe23Type cpe:2.3:*:some:package:2:*:*:*:*:*:*:* 23 23 ExternalRef: PACKAGE-MANAGER purl pkg:deb/debian/[email protected] skipped 1 lines 25 25 ##### Package: package-1 26 26 27 27 PackageName: package-1 28 - SPDXID: SPDXRef-Package-python-package-1-66ba429119b8bec6 28 + SPDXID: SPDXRef-Package-python-package-1-125840abc1c66dd7 29 29 PackageVersion: 1.0.1 30 30 PackageDownloadLocation: NOASSERTION 31 31 FilesAnalyzed: false 32 32 PackageSourceInfo: acquired package info from installed python package manifest file: /somefile-1.txt 33 - PackageLicenseConcluded: MIT 33 + PackageLicenseConcluded: NOASSERTION 34 34 PackageLicenseDeclared: MIT 35 35 PackageCopyrightText: NOASSERTION 36 36 ExternalRef: SECURITY cpe23Type cpe:2.3:*:some:package:1:*:*:*:*:*:*:* skipped 7 lines -
syft/formats/spdxtagvalue/test-fixtures/snapshot/stereoscope-fixture-image-simple.goldenBinary file.
-
-
-
skipped 7 lines 8 8 "github.com/stretchr/testify/assert" 9 9 "github.com/stretchr/testify/require" 10 10 11 + "github.com/anchore/syft/syft/license" 11 12 "github.com/anchore/syft/syft/pkg" 12 13 ) 13 14 skipped 16 lines 30 31 "path": "/Users/hal/go/bin/syft" 31 32 } 32 33 ], 33 - "licenses": [], 34 + "licenses": [ 35 + { 36 + "value": "MIT", 37 + "spdxExpression": "MIT", 38 + "type": "declared", 39 + "url": [] 40 + } 41 + ], 34 42 "language": "go", 35 43 "cpes": [], 36 44 "purl": "pkg:golang/gopkg.in/square/[email protected]", skipped 24 lines 61 69 "path": "/Users/hal/go/bin/syft" 62 70 } 63 71 ], 64 - "licenses": [], 72 + "licenses": [ 73 + { 74 + "value": "MIT", 75 + "spdxExpression": "MIT", 76 + "type": "declared", 77 + "url": ["https://www.github.com"] 78 + }, 79 + { 80 + "value": "MIT", 81 + "spdxExpression": "MIT", 82 + "type": "declared", 83 + "locations": [{"path": "/Users/hal/go/bin/syft"}] 84 + } 85 + ], 65 86 "language": "go", 66 87 "cpes": [], 67 88 "purl": "pkg:golang/gopkg.in/square/[email protected]" skipped 3 lines 71 92 assert.Empty(t, p.Metadata) 72 93 }, 73 94 }, 95 + { 96 + name: "can handle package with []string licenses", 97 + packageData: []byte(`{ 98 + "id": "8b594519bc23da50", 99 + "name": "gopkg.in/square/go-jose.v2", 100 + "version": "v2.6.0", 101 + "type": "go-module", 102 + "foundBy": "go-mod-cataloger", 103 + "locations": [ 104 + { 105 + "path": "/Users/hal/go/bin/syft" 106 + } 107 + ], 108 + "licenses": ["MIT", "Apache-2.0"], 109 + "language": "go", 110 + "cpes": [], 111 + "purl": "pkg:golang/gopkg.in/square/[email protected]" 112 + }`), 113 + assert: func(p *Package) { 114 + assert.Equal(t, licenses{ 115 + { 116 + Value: "MIT", 117 + SPDXExpression: "MIT", 118 + Type: license.Declared, 119 + }, 120 + { 121 + Value: "Apache-2.0", 122 + SPDXExpression: "Apache-2.0", 123 + Type: license.Declared, 124 + }, 125 + }, p.Licenses) 126 + }, 127 + }, 128 + { 129 + name: "can handle package with []pkg.License licenses", 130 + packageData: []byte(`{ 131 + "id": "8b594519bc23da50", 132 + "name": "gopkg.in/square/go-jose.v2", 133 + "version": "v2.6.0", 134 + "type": "go-module", 135 + "foundBy": "go-mod-cataloger", 136 + "locations": [ 137 + { 138 + "path": "/Users/hal/go/bin/syft" 139 + } 140 + ], 141 + "licenses": [ 142 + { 143 + "value": "MIT", 144 + "spdxExpression": "MIT", 145 + "type": "declared" 146 + }, 147 + { 148 + "value": "Apache-2.0", 149 + "spdxExpression": "Apache-2.0", 150 + "type": "declared" 151 + } 152 + ], 153 + "language": "go", 154 + "cpes": [], 155 + "purl": "pkg:golang/gopkg.in/square/[email protected]" 156 + }`), 157 + assert: func(p *Package) { 158 + assert.Equal(t, licenses{ 159 + { 160 + Value: "MIT", 161 + SPDXExpression: "MIT", 162 + Type: license.Declared, 163 + }, 164 + { 165 + Value: "Apache-2.0", 166 + SPDXExpression: "Apache-2.0", 167 + Type: license.Declared, 168 + }, 169 + }, p.Licenses) 170 + }, 171 + }, 74 172 } 75 173 76 174 for _, test := range tests { skipped 74 lines 151 249 "path": "/var/lib/rpm/Packages", 152 250 "layerID": "sha256:74ddd0ec08fa43d09f32636ba91a0a3053b02cb4627c35051aff89f853606b59" 153 251 } 154 - ], 155 - "licenses": [ 156 - "GPLv2+" 157 252 ], 158 253 "language": "", 159 254 "cpes": [ skipped 121 lines -
-
-
-
syft/formats/syftjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.goldenBinary file.
-
-
-
-
-
-
-
skipped 46 lines 47 47 OriginPackage: "pax-utils", 48 48 Maintainer: "Natanael Copa <[email protected]>", 49 49 Version: "1.3.4-r0", 50 - License: "GPL-2.0-only", 51 50 Architecture: "x86_64", 52 51 URL: "https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities", 53 52 Description: "Scan ELF binaries for stuff", skipped 32 lines 86 85 OriginPackage: "pax-utils", 87 86 Maintainer: "Natanael Copa <[email protected]>", 88 87 Version: "1.3.4-r0", 89 - License: "GPL-2.0-only", 90 88 Architecture: "x86_64", 91 89 URL: "https://wiki.gentoo.org/wiki/Hardened/PaX_Utilities", 92 90 Description: "Scan ELF binaries for stuff", skipped 74 lines -
-
skipped 12 lines 13 13 ) 14 14 15 15 func TestAlpmCataloger(t *testing.T) { 16 - 16 + dbLocation := source.NewLocation("var/lib/pacman/local/gmp-6.2.1-2/desc") 17 17 expectedPkgs := []pkg.Package{ 18 18 { 19 - Name: "gmp", 20 - Version: "6.2.1-2", 21 - Type: pkg.AlpmPkg, 22 - FoundBy: "alpmdb-cataloger", 23 - Licenses: []string{"LGPL3", "GPL"}, 24 - Locations: source.NewLocationSet(source.NewLocation("var/lib/pacman/local/gmp-6.2.1-2/desc")), 19 + Name: "gmp", 20 + Version: "6.2.1-2", 21 + Type: pkg.AlpmPkg, 22 + FoundBy: "alpmdb-cataloger", 23 + Licenses: pkg.NewLicenseSet( 24 + pkg.NewLicenseFromLocations("LGPL3", dbLocation), 25 + pkg.NewLicenseFromLocations("GPL", dbLocation), 26 + ), 27 + Locations: source.NewLocationSet(dbLocation), 25 28 CPEs: nil, 26 29 PURL: "", 27 30 MetadataType: "AlpmMetadata", skipped 5 lines 33 36 Architecture: "x86_64", 34 37 Size: 1044438, 35 38 Packager: "Antonio Rojas <[email protected]>", 36 - License: "LGPL3\nGPL", 37 39 URL: "https://gmplib.org/", 38 40 Validation: "pgp", 39 41 Reason: 1, skipped 171 lines -
-
skipped 12 lines 13 13 func Test_PackageURL(t *testing.T) { 14 14 tests := []struct { 15 15 name string 16 - metadata pkg.AlpmMetadata 16 + metadata *parsedData 17 17 distro linux.Release 18 18 expected string 19 19 }{ 20 20 { 21 21 name: "bad distro id", 22 - metadata: pkg.AlpmMetadata{ 23 - Package: "p", 24 - Version: "v", 25 - Architecture: "a", 22 + metadata: &parsedData{ 23 + Licenses: "", 24 + AlpmMetadata: pkg.AlpmMetadata{ 25 + Package: "p", 26 + Version: "v", 27 + Architecture: "a", 28 + }, 26 29 }, 27 30 distro: linux.Release{ 28 31 ID: "something-else", skipped 3 lines 32 35 }, 33 36 { 34 37 name: "gocase", 35 - metadata: pkg.AlpmMetadata{ 36 - Package: "p", 37 - Version: "v", 38 - Architecture: "a", 38 + metadata: &parsedData{ 39 + Licenses: "", 40 + AlpmMetadata: pkg.AlpmMetadata{ 41 + Package: "p", 42 + Version: "v", 43 + Architecture: "a", 44 + }, 39 45 }, 40 46 distro: linux.Release{ 41 47 ID: "arch", skipped 3 lines 45 51 }, 46 52 { 47 53 name: "missing architecture", 48 - metadata: pkg.AlpmMetadata{ 49 - Package: "p", 50 - Version: "v", 54 + metadata: &parsedData{ 55 + Licenses: "", 56 + AlpmMetadata: pkg.AlpmMetadata{ 57 + Package: "p", 58 + Version: "v", 59 + }, 51 60 }, 52 61 distro: linux.Release{ 53 62 ID: "arch", skipped 1 lines 55 64 expected: "pkg:alpm/arch/p@v?distro=arch", 56 65 }, 57 66 { 58 - metadata: pkg.AlpmMetadata{ 59 - Package: "python", 60 - Version: "3.10.0", 61 - Architecture: "any", 67 + metadata: &parsedData{ 68 + Licenses: "", 69 + AlpmMetadata: pkg.AlpmMetadata{ 70 + Package: "python", 71 + Version: "3.10.0", 72 + Architecture: "any", 73 + }, 62 74 }, 63 75 distro: linux.Release{ 64 76 ID: "arch", skipped 2 lines 67 79 expected: "pkg:alpm/arch/[email protected]?arch=any&distro=arch-rolling", 68 80 }, 69 81 { 70 - metadata: pkg.AlpmMetadata{ 71 - Package: "g plus plus", 72 - Version: "v84", 73 - Architecture: "x86_64", 82 + metadata: &parsedData{ 83 + Licenses: "", 84 + AlpmMetadata: pkg.AlpmMetadata{ 85 + Package: "g plus plus", 86 + Version: "v84", 87 + Architecture: "x86_64", 88 + }, 74 89 }, 75 90 distro: linux.Release{ 76 91 ID: "arch", skipped 3 lines 80 95 }, 81 96 { 82 97 name: "add source information as qualifier", 83 - metadata: pkg.AlpmMetadata{ 84 - Package: "p", 85 - Version: "v", 86 - Architecture: "a", 87 - BasePackage: "origin", 98 + metadata: &parsedData{ 99 + Licenses: "", 100 + AlpmMetadata: pkg.AlpmMetadata{ 101 + Package: "p", 102 + Version: "v", 103 + Architecture: "a", 104 + BasePackage: "origin", 105 + }, 88 106 }, 89 107 distro: linux.Release{ 90 108 ID: "arch", skipped 43 lines -
-
-
-
-
skipped 79 lines 80 80 func TestSinglePackageDetails(t *testing.T) { 81 81 tests := []struct { 82 82 fixture string 83 - expected pkg.ApkMetadata 83 + expected pkg.Package 84 84 }{ 85 85 { 86 86 fixture: "test-fixtures/single", 87 - expected: pkg.ApkMetadata{ 88 - Package: "musl-utils", 89 - OriginPackage: "musl", 90 - Version: "1.1.24-r2", 91 - Description: "the musl c library (libc) implementation", 92 - Maintainer: "Timo Teräs <[email protected]>", 93 - License: "MIT BSD GPL2+", 94 - Architecture: "x86_64", 95 - URL: "https://musl.libc.org/", 96 - Size: 37944, 97 - InstalledSize: 151552, 98 - Dependencies: []string{"scanelf", "so:libc.musl-x86_64.so.1"}, 99 - Provides: []string{"cmd:getconf", "cmd:getent", "cmd:iconv", "cmd:ldconfig", "cmd:ldd"}, 100 - Checksum: "Q1bTtF5526tETKfL+lnigzIDvm+2o=", 101 - GitCommit: "4024cc3b29ad4c65544ad068b8f59172b5494306", 102 - Files: []pkg.ApkFileRecord{ 103 - { 104 - Path: "/sbin", 105 - }, 106 - { 107 - Path: "/sbin/ldconfig", 108 - OwnerUID: "0", 109 - OwnerGID: "0", 110 - Permissions: "755", 111 - Digest: &file.Digest{ 112 - Algorithm: "'Q1'+base64(sha1)", 113 - Value: "Q1Kja2+POZKxEkUOZqwSjC6kmaED4=", 87 + expected: pkg.Package{ 88 + Name: "musl-utils", 89 + Version: "1.1.24-r2", 90 + Licenses: pkg.NewLicenseSet( 91 + pkg.NewLicense("MIT"), 92 + pkg.NewLicense("BSD"), 93 + pkg.NewLicense("GPL2+"), 94 + ), 95 + Type: pkg.ApkPkg, 96 + MetadataType: pkg.ApkMetadataType, 97 + Metadata: pkg.ApkMetadata{ 98 + Package: "musl-utils", 99 + OriginPackage: "musl", 100 + Version: "1.1.24-r2", 101 + Description: "the musl c library (libc) implementation", 102 + Maintainer: "Timo Teräs <[email protected]>", 103 + Architecture: "x86_64", 104 + URL: "https://musl.libc.org/", 105 + Size: 37944, 106 + InstalledSize: 151552, 107 + Dependencies: []string{"scanelf", "so:libc.musl-x86_64.so.1"}, 108 + Provides: []string{"cmd:getconf", "cmd:getent", "cmd:iconv", "cmd:ldconfig", "cmd:ldd"}, 109 + Checksum: "Q1bTtF5526tETKfL+lnigzIDvm+2o=", 110 + GitCommit: "4024cc3b29ad4c65544ad068b8f59172b5494306", 111 + Files: []pkg.ApkFileRecord{ 112 + { 113 + Path: "/sbin", 114 114 }, 115 - }, 116 - { 117 - Path: "/usr", 118 - }, 119 - { 120 - Path: "/usr/bin", 121 - }, 122 - { 123 - Path: "/usr/bin/iconv", 124 - OwnerUID: "0", 125 - OwnerGID: "0", 126 - Permissions: "755", 127 - Digest: &file.Digest{ 128 - Algorithm: "'Q1'+base64(sha1)", 129 - Value: "Q1CVmFbdY+Hv6/jAHl1gec2Kbx1EY=", 115 + { 116 + Path: "/sbin/ldconfig", 117 + OwnerUID: "0", 118 + OwnerGID: "0", 119 + Permissions: "755", 120 + Digest: &file.Digest{ 121 + Algorithm: "'Q1'+base64(sha1)", 122 + Value: "Q1Kja2+POZKxEkUOZqwSjC6kmaED4=", 123 + }, 124 + }, 125 + { 126 + Path: "/usr", 130 127 }, 131 - }, 132 - { 133 - Path: "/usr/bin/ldd", 134 - OwnerUID: "0", 135 - OwnerGID: "0", 136 - Permissions: "755", 137 - Digest: &file.Digest{ 138 - Algorithm: "'Q1'+base64(sha1)", 139 - Value: "Q1yFAhGggmL7ERgbIA7KQxyTzf3ks=", 128 + { 129 + Path: "/usr/bin", 140 130 }, 141 - }, 142 - { 143 - Path: "/usr/bin/getconf", 144 - OwnerUID: "0", 145 - OwnerGID: "0", 146 - Permissions: "755", 147 - Digest: &file.Digest{ 148 - Algorithm: "'Q1'+base64(sha1)", 149 - Value: "Q1dAdYK8M/INibRQF5B3Rw7cmNDDA=", 131 + { 132 + Path: "/usr/bin/iconv", 133 + OwnerUID: "0", 134 + OwnerGID: "0", 135 + Permissions: "755", 136 + Digest: &file.Digest{ 137 + Algorithm: "'Q1'+base64(sha1)", 138 + Value: "Q1CVmFbdY+Hv6/jAHl1gec2Kbx1EY=", 139 + }, 150 140 }, 151 - }, 152 - { 153 - Path: "/usr/bin/getent", 154 - OwnerUID: "0", 155 - OwnerGID: "0", 156 - Permissions: "755", 157 - Digest: &file.Digest{ 158 - Algorithm: "'Q1'+base64(sha1)", 159 - Value: "Q1eR2Dz/WylabgbWMTkd2+hGmEya4=", 141 + { 142 + Path: "/usr/bin/ldd", 143 + OwnerUID: "0", 144 + OwnerGID: "0", 145 + Permissions: "755", 146 + Digest: &file.Digest{ 147 + Algorithm: "'Q1'+base64(sha1)", 148 + Value: "Q1yFAhGggmL7ERgbIA7KQxyTzf3ks=", 149 + }, 150 + }, 151 + { 152 + Path: "/usr/bin/getconf", 153 + OwnerUID: "0", 154 + OwnerGID: "0", 155 + Permissions: "755", 156 + Digest: &file.Digest{ 157 + Algorithm: "'Q1'+base64(sha1)", 158 + Value: "Q1dAdYK8M/INibRQF5B3Rw7cmNDDA=", 159 + }, 160 + }, 161 + { 162 + Path: "/usr/bin/getent", 163 + OwnerUID: "0", 164 + OwnerGID: "0", 165 + Permissions: "755", 166 + Digest: &file.Digest{ 167 + Algorithm: "'Q1'+base64(sha1)", 168 + Value: "Q1eR2Dz/WylabgbWMTkd2+hGmEya4=", 169 + }, 160 170 }, 161 171 }, 162 172 }, skipped 1 lines 164 174 }, 165 175 { 166 176 fixture: "test-fixtures/empty-deps-and-provides", 167 - expected: pkg.ApkMetadata{ 168 - Package: "alpine-baselayout-data", 169 - OriginPackage: "alpine-baselayout", 170 - Version: "3.4.0-r0", 171 - Description: "Alpine base dir structure and init scripts", 172 - Maintainer: "Natanael Copa <[email protected]>", 173 - License: "GPL-2.0-only", 174 - Architecture: "x86_64", 175 - URL: "https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout", 176 - Size: 11664, 177 - InstalledSize: 77824, 178 - Dependencies: []string{}, 179 - Provides: []string{}, 180 - Checksum: "Q15ffjKT28lB7iSXjzpI/eDdYRCwM=", 181 - GitCommit: "bd965a7ebf7fd8f07d7a0cc0d7375bf3e4eb9b24", 182 - Files: []pkg.ApkFileRecord{ 183 - {Path: "/etc"}, 184 - {Path: "/etc/fstab"}, 185 - {Path: "/etc/group"}, 186 - {Path: "/etc/hostname"}, 187 - {Path: "/etc/hosts"}, 188 - {Path: "/etc/inittab"}, 189 - {Path: "/etc/modules"}, 190 - {Path: "/etc/mtab", OwnerUID: "0", OwnerGID: "0", Permissions: "0777"}, 191 - {Path: "/etc/nsswitch.conf"}, 192 - {Path: "/etc/passwd"}, 193 - {Path: "/etc/profile"}, 194 - {Path: "/etc/protocols"}, 195 - {Path: "/etc/services"}, 196 - {Path: "/etc/shadow", OwnerUID: "0", OwnerGID: "148", Permissions: "0640"}, 197 - {Path: "/etc/shells"}, 198 - {Path: "/etc/sysctl.conf"}, 177 + expected: pkg.Package{ 178 + Name: "alpine-baselayout-data", 179 + Version: "3.4.0-r0", 180 + Licenses: pkg.NewLicenseSet( 181 + pkg.NewLicense("GPL-2.0-only"), 182 + ), 183 + Type: pkg.ApkPkg, 184 + MetadataType: pkg.ApkMetadataType, 185 + Metadata: pkg.ApkMetadata{ 186 + Package: "alpine-baselayout-data", 187 + OriginPackage: "alpine-baselayout", 188 + Version: "3.4.0-r0", 189 + Description: "Alpine base dir structure and init scripts", 190 + Maintainer: "Natanael Copa <[email protected]>", 191 + Architecture: "x86_64", 192 + URL: "https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout", 193 + Size: 11664, 194 + InstalledSize: 77824, 195 + Dependencies: []string{}, 196 + Provides: []string{}, 197 + Checksum: "Q15ffjKT28lB7iSXjzpI/eDdYRCwM=", 198 + GitCommit: "bd965a7ebf7fd8f07d7a0cc0d7375bf3e4eb9b24", 199 + Files: []pkg.ApkFileRecord{ 200 + {Path: "/etc"}, 201 + {Path: "/etc/fstab"}, 202 + {Path: "/etc/group"}, 203 + {Path: "/etc/hostname"}, 204 + {Path: "/etc/hosts"}, 205 + {Path: "/etc/inittab"}, 206 + {Path: "/etc/modules"}, 207 + {Path: "/etc/mtab", OwnerUID: "0", OwnerGID: "0", Permissions: "0777"}, 208 + {Path: "/etc/nsswitch.conf"}, 209 + {Path: "/etc/passwd"}, 210 + {Path: "/etc/profile"}, 211 + {Path: "/etc/protocols"}, 212 + {Path: "/etc/services"}, 213 + {Path: "/etc/shadow", OwnerUID: "0", OwnerGID: "148", Permissions: "0640"}, 214 + {Path: "/etc/shells"}, 215 + {Path: "/etc/sysctl.conf"}, 216 + }, 199 217 }, 200 218 }, 201 219 }, 202 220 { 203 221 fixture: "test-fixtures/base", 204 - expected: pkg.ApkMetadata{ 205 - Package: "alpine-baselayout", 206 - OriginPackage: "alpine-baselayout", 207 - Version: "3.2.0-r6", 208 - Description: "Alpine base dir structure and init scripts", 209 - Maintainer: "Natanael Copa <[email protected]>", 210 - License: "GPL-2.0-only", 211 - Architecture: "x86_64", 212 - URL: "https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout", 213 - Size: 19917, 214 - InstalledSize: 409600, 215 - Dependencies: []string{"/bin/sh", "so:libc.musl-x86_64.so.1"}, 216 - Provides: []string{"cmd:mkmntdirs"}, 217 - Checksum: "Q1myMNfd7u5v5UTgNHeq1e31qTjZU=", 218 - GitCommit: "e1c51734fa96fa4bac92e9f14a474324c67916fc", 219 - Files: []pkg.ApkFileRecord{ 220 - { 221 - Path: "/dev", 222 - }, 223 - { 224 - Path: "/dev/pts", 225 - }, 226 - { 227 - Path: "/dev/shm", 228 - }, 229 - { 230 - Path: "/etc", 231 - }, 232 - { 233 - Path: "/etc/fstab", 234 - Digest: &file.Digest{ 235 - Algorithm: "'Q1'+base64(sha1)", 236 - Value: "Q11Q7hNe8QpDS531guqCdrXBzoA/o=", 222 + expected: pkg.Package{ 223 + Name: "alpine-baselayout", 224 + Version: "3.2.0-r6", 225 + Licenses: pkg.NewLicenseSet( 226 + pkg.NewLicense("GPL-2.0-only"), 227 + ), 228 + Type: pkg.ApkPkg, 229 + PURL: "", 230 + MetadataType: pkg.ApkMetadataType, 231 + Metadata: pkg.ApkMetadata{ 232 + Package: "alpine-baselayout", 233 + OriginPackage: "alpine-baselayout", 234 + Version: "3.2.0-r6", 235 + Description: "Alpine base dir structure and init scripts", 236 + Maintainer: "Natanael Copa <[email protected]>", 237 + Architecture: "x86_64", 238 + URL: "https://git.alpinelinux.org/cgit/aports/tree/main/alpine-baselayout", 239 + Size: 19917, 240 + InstalledSize: 409600, 241 + Dependencies: []string{"/bin/sh", "so:libc.musl-x86_64.so.1"}, 242 + Provides: []string{"cmd:mkmntdirs"}, 243 + Checksum: "Q1myMNfd7u5v5UTgNHeq1e31qTjZU=", 244 + GitCommit: "e1c51734fa96fa4bac92e9f14a474324c67916fc", 245 + Files: []pkg.ApkFileRecord{ 246 + { 247 + Path: "/dev", 237 248 }, 238 - }, 239 - { 240 - Path: "/etc/group", 241 - Digest: &file.Digest{ 242 - Algorithm: "'Q1'+base64(sha1)", 243 - Value: "Q1oJ16xWudgKOrXIEquEDzlF2Lsm4=", 249 + { 250 + Path: "/dev/pts", 244 251 }, 245 - }, 246 - { 247 - Path: "/etc/hostname", 248 - Digest: &file.Digest{ 249 - Algorithm: "'Q1'+base64(sha1)", 250 - Value: "Q16nVwYVXP/tChvUPdukVD2ifXOmc=", 252 + { 253 + Path: "/dev/shm", 251 254 }, 252 - }, 253 - { 254 - Path: "/etc/hosts", 255 - Digest: &file.Digest{ 256 - Algorithm: "'Q1'+base64(sha1)", 257 - Value: "Q1BD6zJKZTRWyqGnPi4tSfd3krsMU=", 255 + { 256 + Path: "/etc", 258 257 }, 259 - }, 260 - { 261 - Path: "/etc/inittab", 262 - Digest: &file.Digest{ 263 - Algorithm: "'Q1'+base64(sha1)", 264 - Value: "Q1TsthbhW7QzWRe1E/NKwTOuD4pHc=", 258 + { 259 + Path: "/etc/fstab", 260 + Digest: &file.Digest{ 261 + Algorithm: "'Q1'+base64(sha1)", 262 + Value: "Q11Q7hNe8QpDS531guqCdrXBzoA/o=", 263 + }, 265 264 }, 266 - }, 267 - { 268 - Path: "/etc/modules", 269 - Digest: &file.Digest{ 270 - Algorithm: "'Q1'+base64(sha1)", 271 - Value: "Q1toogjUipHGcMgECgPJX64SwUT1M=", 265 + { 266 + Path: "/etc/group", 267 + Digest: &file.Digest{ 268 + Algorithm: "'Q1'+base64(sha1)", 269 + Value: "Q1oJ16xWudgKOrXIEquEDzlF2Lsm4=", 270 + }, 272 271 }, 273 - }, 274 - { 275 - Path: "/etc/motd", 276 - Digest: &file.Digest{ 277 - Algorithm: "'Q1'+base64(sha1)", 278 - Value: "Q1XmduVVNURHQ27TvYp1Lr5TMtFcA=", 272 + { 273 + Path: "/etc/hostname", 274 + Digest: &file.Digest{ 275 + Algorithm: "'Q1'+base64(sha1)", 276 + Value: "Q16nVwYVXP/tChvUPdukVD2ifXOmc=", 277 + }, 279 278 }, 280 - }, 281 - { 282 - Path: "/etc/mtab", 283 - OwnerUID: "0", 284 - OwnerGID: "0", 285 - Permissions: "777", 286 - Digest: &file.Digest{ 287 - Algorithm: "'Q1'+base64(sha1)", 288 - Value: "Q1kiljhXXH1LlQroHsEJIkPZg2eiw=", 279 + { 280 + Path: "/etc/hosts", 281 + Digest: &file.Digest{ 282 + Algorithm: "'Q1'+base64(sha1)", 283 + Value: "Q1BD6zJKZTRWyqGnPi4tSfd3krsMU=", 284 + }, 289 285 }, 290 - }, 291 - { 292 - Path: "/etc/passwd", 293 - Digest: &file.Digest{ 294 - Algorithm: "'Q1'+base64(sha1)", 295 - Value: "Q1TchuuLUfur0izvfZQZxgN/LJhB8=", 286 + { 287 + Path: "/etc/inittab", 288 + Digest: &file.Digest{ 289 + Algorithm: "'Q1'+base64(sha1)", 290 + Value: "Q1TsthbhW7QzWRe1E/NKwTOuD4pHc=", 291 + }, 296 292 }, 297 - }, 298 - { 299 - Path: "/etc/profile", 300 - Digest: &file.Digest{ 301 - Algorithm: "'Q1'+base64(sha1)", 302 - Value: "Q1KpFb8kl5LvwXWlY3e58FNsjrI34=", 293 + { 294 + Path: "/etc/modules", 295 + Digest: &file.Digest{ 296 + Algorithm: "'Q1'+base64(sha1)", 297 + Value: "Q1toogjUipHGcMgECgPJX64SwUT1M=", 298 + }, 303 299 }, 304 - }, 305 - { 306 - Path: "/etc/protocols", 307 - Digest: &file.Digest{ 308 - Algorithm: "'Q1'+base64(sha1)", 309 - Value: "Q13FqXUnvuOpMDrH/6rehxuYAEE34=", 300 + { 301 + Path: "/etc/motd", 302 + Digest: &file.Digest{ 303 + Algorithm: "'Q1'+base64(sha1)", 304 + Value: "Q1XmduVVNURHQ27TvYp1Lr5TMtFcA=", 305 + }, 310 306 }, 311 - }, 312 - { 313 - Path: "/etc/services", 314 - Digest: &file.Digest{ 315 - Algorithm: "'Q1'+base64(sha1)", 316 - Value: "Q1C6HJNgQvLWqt5VY+n7MZJ1rsDuY=", 307 + { 308 + Path: "/etc/mtab", 309 + OwnerUID: "0", 310 + OwnerGID: "0", 311 + Permissions: "777", 312 + Digest: &file.Digest{ 313 + Algorithm: "'Q1'+base64(sha1)", 314 + Value: "Q1kiljhXXH1LlQroHsEJIkPZg2eiw=", 315 + }, 317 316 }, 318 - }, 319 - { 320 - Path: "/etc/shadow", 321 - OwnerUID: "0", 322 - OwnerGID: "42", 323 - Permissions: "640", 324 - Digest: &file.Digest{ 325 - Algorithm: "'Q1'+base64(sha1)", 326 - Value: "Q1ltrPIAW2zHeDiajsex2Bdmq3uqA=", 317 + { 318 + Path: "/etc/passwd", 319 + Digest: &file.Digest{ 320 + Algorithm: "'Q1'+base64(sha1)", 321 + Value: "Q1TchuuLUfur0izvfZQZxgN/LJhB8=", 322 + }, 327 323 }, 328 - }, 329 - { 330 - Path: "/etc/shells", 331 - Digest: &file.Digest{ 332 - Algorithm: "'Q1'+base64(sha1)", 333 - Value: "Q1ojm2YdpCJ6B/apGDaZ/Sdb2xJkA=", 324 + { 325 + Path: "/etc/profile", 326 + Digest: &file.Digest{ 327 + Algorithm: "'Q1'+base64(sha1)", 328 + Value: "Q1KpFb8kl5LvwXWlY3e58FNsjrI34=", 329 + }, 334 330 }, 335 - }, 336 - { 337 - Path: "/etc/sysctl.conf", 338 - Digest: &file.Digest{ 339 - Algorithm: "'Q1'+base64(sha1)", 340 - Value: "Q14upz3tfnNxZkIEsUhWn7Xoiw96g=", 331 + { 332 + Path: "/etc/protocols", 333 + Digest: &file.Digest{ 334 + Algorithm: "'Q1'+base64(sha1)", 335 + Value: "Q13FqXUnvuOpMDrH/6rehxuYAEE34=", 336 + }, 341 337 }, 342 - }, 343 - { 344 - Path: "/etc/apk", 345 - }, 346 - { 347 - Path: "/etc/conf.d", 348 - }, 349 - { 350 - Path: "/etc/crontabs", 351 - }, 352 - { 353 - Path: "/etc/crontabs/root", 354 - OwnerUID: "0", 355 - OwnerGID: "0", 356 - Permissions: "600", 357 - Digest: &file.Digest{ 358 - Algorithm: "'Q1'+base64(sha1)", 359 - Value: "Q1vfk1apUWI4yLJGhhNRd0kJixfvY=", 338 + { 339 + Path: "/etc/services", 340 + Digest: &file.Digest{ 341 + Algorithm: "'Q1'+base64(sha1)", 342 + Value: "Q1C6HJNgQvLWqt5VY+n7MZJ1rsDuY=", 343 + }, 360 344 }, 361 - }, 362 - { 363 - Path: "/etc/init.d", 364 - }, 365 - { 366 - Path: "/etc/modprobe.d", 367 - }, 368 - { 369 - Path: "/etc/modprobe.d/aliases.conf", 370 - Digest: &file.Digest{ 371 - Algorithm: "'Q1'+base64(sha1)", 372 - Value: "Q1WUbh6TBYNVK7e4Y+uUvLs/7viqk=", 345 + { 346 + Path: "/etc/shadow", 347 + OwnerUID: "0", 348 + OwnerGID: "42", 349 + Permissions: "640", 350 + Digest: &file.Digest{ 351 + Algorithm: "'Q1'+base64(sha1)", 352 + Value: "Q1ltrPIAW2zHeDiajsex2Bdmq3uqA=", 353 + }, 373 354 }, 374 - }, 375 - { 376 - Path: "/etc/modprobe.d/blacklist.conf", 377 - Digest: &file.Digest{ 378 - Algorithm: "'Q1'+base64(sha1)", 379 - Value: "Q1xxYGU6S6TLQvb7ervPrWWwAWqMg=", 355 + { 356 + Path: "/etc/shells", 357 + Digest: &file.Digest{ 358 + Algorithm: "'Q1'+base64(sha1)", 359 + Value: "Q1ojm2YdpCJ6B/apGDaZ/Sdb2xJkA=", 360 + }, 380 361 }, 381 - }, 382 - { 383 - Path: "/etc/modprobe.d/i386.conf", 384 - Digest: &file.Digest{ 385 - Algorithm: "'Q1'+base64(sha1)", 386 - Value: "Q1pnay/njn6ol9cCssL7KiZZ8etlc=", 362 + { 363 + Path: "/etc/sysctl.conf", 364 + Digest: &file.Digest{ 365 + Algorithm: "'Q1'+base64(sha1)", 366 + Value: "Q14upz3tfnNxZkIEsUhWn7Xoiw96g=", 367 + }, 387 368 }, 388 - }, 389 - { 390 - Path: "/etc/modprobe.d/kms.conf", 391 - Digest: &file.Digest{ 392 - Algorithm: "'Q1'+base64(sha1)", 393 - Value: "Q1ynbLn3GYDpvajba/ldp1niayeog=", 369 + { 370 + Path: "/etc/apk", 394 371 }, 395 - }, 396 - { 397 - Path: "/etc/modules-load.d", 398 - }, 399 - { 400 - Path: "/etc/network", 401 - }, 402 - { 403 - Path: "/etc/network/if-down.d", 404 - }, 405 - { 406 - Path: "/etc/network/if-post-down.d", 407 - }, 408 - { 409 - Path: "/etc/network/if-pre-up.d", 410 - }, 411 - { 412 - Path: "/etc/network/if-up.d", 413 - }, 414 - { 415 - Path: "/etc/opt", 416 - }, 417 - { 418 - Path: "/etc/periodic", 419 - }, 420 - { 421 - Path: "/etc/periodic/15min", 422 - }, 423 - { 424 - Path: "/etc/periodic/daily", 425 - }, 426 - { 427 - Path: "/etc/periodic/hourly", 428 - }, 429 - { 430 - Path: "/etc/periodic/monthly", 431 - }, 432 - { 433 - Path: "/etc/periodic/weekly", 434 - }, 435 - { 436 - Path: "/etc/profile.d", 437 - }, 438 - { 439 - Path: "/etc/profile.d/color_prompt", 440 - Digest: &file.Digest{ 441 - Algorithm: "'Q1'+base64(sha1)", 442 - Value: "Q10wL23GuSCVfumMRgakabUI6EsSk=", 372 + { 373 + Path: "/etc/conf.d", 443 374 }, 444 - }, 445 - { 446 - Path: "/etc/profile.d/locale", 447 - Digest: &file.Digest{ 448 - Algorithm: "'Q1'+base64(sha1)", 449 - Value: "Q1R4bIEpnKxxOSrlnZy9AoawqZ5DU=", 375 + { 376 + Path: "/etc/crontabs", 450 377 }, 451 - }, 452 - { 453 - Path: "/etc/sysctl.d", 454 - }, 455 - { 456 - Path: "/home", 457 - }, 458 - { 459 - Path: "/lib", 460 - }, 461 - { 462 - Path: "/lib/firmware", 463 - }, 464 - { 465 - Path: "/lib/mdev", 466 - }, 467 - { 468 - Path: "/lib/modules-load.d", 469 - }, 470 - { 471 - Path: "/lib/sysctl.d", 472 - }, 473 - { 474 - Path: "/lib/sysctl.d/00-alpine.conf", 475 - Digest: &file.Digest{ 476 - Algorithm: "'Q1'+base64(sha1)", 477 - Value: "Q1HpElzW1xEgmKfERtTy7oommnq6c=", 378 + { 379 + Path: "/etc/crontabs/root", 380 + OwnerUID: "0", 381 + OwnerGID: "0", 382 + Permissions: "600", 383 + Digest: &file.Digest{ 384 + Algorithm: "'Q1'+base64(sha1)", 385 + Value: "Q1vfk1apUWI4yLJGhhNRd0kJixfvY=", 386 + }, 478 387 }, 479 - }, 480 - { 481 - Path: "/media", 482 - }, 483 - { 484 - Path: "/media/cdrom", 485 - }, 486 - { 487 - Path: "/media/floppy", 488 - }, 489 - { 490 - Path: "/media/usb", 491 - }, 492 - { 493 - Path: "/mnt", 494 - }, 495 - { 496 - Path: "/opt", 497 - }, 498 - { 499 - Path: "/proc", 500 - }, 501 - { 502 - Path: "/root", 503 - OwnerUID: "0", 504 - OwnerGID: "0", 505 - Permissions: "700", 506 - }, 507 - { 508 - Path: "/run", 509 - }, 510 - { 511 - Path: "/sbin", 512 - }, 513 - { 514 - Path: "/sbin/mkmntdirs", 515 - OwnerUID: "0", 516 - OwnerGID: "0", 517 - Permissions: "755", 518 - Digest: &file.Digest{ 519 - Algorithm: "'Q1'+base64(sha1)", 520 - Value: "Q1YeuSmC7iDbEWrusPzA/zUQF6YSg=", 388 + { 389 + Path: "/etc/init.d", 521 390 }, 522 - }, 523 - { 524 - Path: "/srv", 525 - }, 526 - { 527 - Path: "/sys", 528 - }, 529 - { 530 - Path: "/tmp", 531 - OwnerUID: "0", 532 - OwnerGID: "0", 533 - Permissions: "1777", 534 - }, 535 - { 536 - Path: "/usr", 537 - }, 538 - { 539 - Path: "/usr/lib", 540 - }, 541 - { 542 - Path: "/usr/lib/modules-load.d", 543 - }, 544 - { 545 - Path: "/usr/local", 546 - }, 547 - { 548 - Path: "/usr/local/bin", 549 - }, 550 - { 551 - Path: "/usr/local/lib", 552 - }, 553 - { 554 - Path: "/usr/local/share", 555 - }, 556 - { 557 - Path: "/usr/sbin", 558 - }, 559 - { 560 - Path: "/usr/share", 561 - }, 562 - { 563 - Path: "/usr/share/man", 564 - }, 565 - { 566 - Path: "/usr/share/misc", 567 - }, 568 - { 569 - Path: "/var", 570 - }, 571 - { 572 - Path: "/var/run", 573 - OwnerUID: "0", 574 - OwnerGID: "0", 575 - Permissions: "777", 576 - Digest: &file.Digest{ 577 - Algorithm: "'Q1'+base64(sha1)", 578 - Value: "Q11/SNZz/8cK2dSKK+cJpVrZIuF4Q=", 391 + { 392 + Path: "/etc/modprobe.d", 393 + }, 394 + { 395 + Path: "/etc/modprobe.d/aliases.conf", 396 + Digest: &file.Digest{ 397 + Algorithm: "'Q1'+base64(sha1)", 398 + Value: "Q1WUbh6TBYNVK7e4Y+uUvLs/7viqk=", 399 + }, 579 400 }, 580 - }, 581 - { 582 - Path: "/var/cache", 583 - }, 584 - { 585 - Path: "/var/cache/misc", 586 - }, 587 - { 588 - Path: "/var/empty", 589 - OwnerUID: "0", 590 - OwnerGID: "0", 591 - Permissions: "555", 592 - }, 593 - { 594 - Path: "/var/lib", 595 - }, 596 - { 597 - Path: "/var/lib/misc", 598 - }, 599 - { 600 - Path: "/var/local", 601 - }, 602 - { 603 - Path: "/var/lock", 604 - }, 605 - { 606 - Path: "/var/lock/subsys", 607 - }, 608 - { 609 - Path: "/var/log", 610 - }, 611 - { 612 - Path: "/var/mail", 613 - }, 614 - { 615 - Path: "/var/opt", 616 - }, 617 - { 618 - Path: "/var/spool", 619 - }, 620 - { 621 - Path: "/var/spool/mail", 622 - OwnerUID: "0", 623 - OwnerGID: "0", 624 - Permissions: "777", 625 - Digest: &file.Digest{ 626 - Algorithm: "'Q1'+base64(sha1)", 627 - Value: "Q1dzbdazYZA2nTzSIG3YyNw7d4Juc=", 401 + { 402 + Path: "/etc/modprobe.d/blacklist.conf", 403 + Digest: &file.Digest{ 404 + Algorithm: "'Q1'+base64(sha1)", 405 + Value: "Q1xxYGU6S6TLQvb7ervPrWWwAWqMg=", 406 + }, 407 + }, 408 + { 409 + Path: "/etc/modprobe.d/i386.conf", 410 + Digest: &file.Digest{ 411 + Algorithm: "'Q1'+base64(sha1)", 412 + Value: "Q1pnay/njn6ol9cCssL7KiZZ8etlc=", 413 + }, 414 + }, 415 + { 416 + Path: "/etc/modprobe.d/kms.conf", 417 + Digest: &file.Digest{ 418 + Algorithm: "'Q1'+base64(sha1)", 419 + Value: "Q1ynbLn3GYDpvajba/ldp1niayeog=", 420 + }, 421 + }, 422 + { 423 + Path: "/etc/modules-load.d", 424 + }, 425 + { 426 + Path: "/etc/network", 427 + }, 428 + { 429 + Path: "/etc/network/if-down.d", 430 + }, 431 + { 432 + Path: "/etc/network/if-post-down.d", 433 + }, 434 + { 435 + Path: "/etc/network/if-pre-up.d", 436 + }, 437 + { 438 + Path: "/etc/network/if-up.d", 628 439 }, 629 - }, 630 - { 631 - Path: "/var/spool/cron", 632 - }, 633 - { 634 - Path: "/var/spool/cron/crontabs", 635 - OwnerUID: "0", 636 - OwnerGID: "0", 637 - Permissions: "777", 638 - Digest: &file.Digest{ 639 - Algorithm: "'Q1'+base64(sha1)", 640 - Value: "Q1OFZt+ZMp7j0Gny0rqSKuWJyqYmA=", 440 + { 441 + Path: "/etc/opt", 641 442 }, 642 - }, 643 - { 644 - Path: "/var/tmp", 645 - OwnerUID: "0", 646 - OwnerGID: "0", 647 - Permissions: "1777", 443 + { 444 + Path: "/etc/periodic", 445 + }, 446 + { 447 + Path: "/etc/periodic/15min", 448 + }, 449 + { 450 + Path: "/etc/periodic/daily", 451 + }, 452 + { 453 + Path: "/etc/periodic/hourly", 454 + }, 455 + { 456 + Path: "/etc/periodic/monthly", 457 + }, 458 + { 459 + Path: "/etc/periodic/weekly", 460 + }, 461 + { 462 + Path: "/etc/profile.d", 463 + }, 464 + { 465 + Path: "/etc/profile.d/color_prompt", 466 + Digest: &file.Digest{ 467 + Algorithm: "'Q1'+base64(sha1)", 468 + Value: "Q10wL23GuSCVfumMRgakabUI6EsSk=", 469 + }, 470 + }, 471 + { 472 + Path: "/etc/profile.d/locale", 473 + Digest: &file.Digest{ 474 + Algorithm: "'Q1'+base64(sha1)", 475 + Value: "Q1R4bIEpnKxxOSrlnZy9AoawqZ5DU=", 476 + }, 477 + }, 478 + { 479 + Path: "/etc/sysctl.d", 480 + }, 481 + { 482 + Path: "/home", 483 + }, 484 + { 485 + Path: "/lib", 486 + }, 487 + { 488 + Path: "/lib/firmware", 489 + }, 490 + { 491 + Path: "/lib/mdev", 492 + }, 493 + { 494 + Path: "/lib/modules-load.d", 495 + }, 496 + { 497 + Path: "/lib/sysctl.d", 498 + }, 499 + { 500 + Path: "/lib/sysctl.d/00-alpine.conf", 501 + Digest: &file.Digest{ 502 + Algorithm: "'Q1'+base64(sha1)", 503 + Value: "Q1HpElzW1xEgmKfERtTy7oommnq6c=", 504 + }, 505 + }, 506 + { 507 + Path: "/media", 508 + }, 509 + { 510 + Path: "/media/cdrom", 511 + }, 512 + { 513 + Path: "/media/floppy", 514 + }, 515 + { 516 + Path: "/media/usb", 517 + }, 518 + { 519 + Path: "/mnt", 520 + }, 521 + { 522 + Path: "/opt", 523 + }, 524 + { 525 + Path: "/proc", 526 + }, 527 + { 528 + Path: "/root", 529 + OwnerUID: "0", 530 + OwnerGID: "0", 531 + Permissions: "700", 532 + }, 533 + { 534 + Path: "/run", 535 + }, 536 + { 537 + Path: "/sbin", 538 + }, 539 + { 540 + Path: "/sbin/mkmntdirs", 541 + OwnerUID: "0", 542 + OwnerGID: "0", 543 + Permissions: "755", 544 + Digest: &file.Digest{ 545 + Algorithm: "'Q1'+base64(sha1)", 546 + Value: "Q1YeuSmC7iDbEWrusPzA/zUQF6YSg=", 547 + }, 548 + }, 549 + { 550 + Path: "/srv", 551 + }, 552 + { 553 + Path: "/sys", 554 + }, 555 + { 556 + Path: "/tmp", 557 + OwnerUID: "0", 558 + OwnerGID: "0", 559 + Permissions: "1777", 560 + }, 561 + { 562 + Path: "/usr", 563 + }, 564 + { 565 + Path: "/usr/lib", 566 + }, 567 + { 568 + Path: "/usr/lib/modules-load.d", 569 + }, 570 + { 571 + Path: "/usr/local", 572 + }, 573 + { 574 + Path: "/usr/local/bin", 575 + }, 576 + { 577 + Path: "/usr/local/lib", 578 + }, 579 + { 580 + Path: "/usr/local/share", 581 + }, 582 + { 583 + Path: "/usr/sbin", 584 + }, 585 + { 586 + Path: "/usr/share", 587 + }, 588 + { 589 + Path: "/usr/share/man", 590 + }, 591 + { 592 + Path: "/usr/share/misc", 593 + }, 594 + { 595 + Path: "/var", 596 + }, 597 + { 598 + Path: "/var/run", 599 + OwnerUID: "0", 600 + OwnerGID: "0", 601 + Permissions: "777", 602 + Digest: &file.Digest{ 603 + Algorithm: "'Q1'+base64(sha1)", 604 + Value: "Q11/SNZz/8cK2dSKK+cJpVrZIuF4Q=", 605 + }, 606 + }, 607 + { 608 + Path: "/var/cache", 609 + }, 610 + { 611 + Path: "/var/cache/misc", 612 + }, 613 + { 614 + Path: "/var/empty", 615 + OwnerUID: "0", 616 + OwnerGID: "0", 617 + Permissions: "555", 618 + }, 619 + { 620 + Path: "/var/lib", 621 + }, 622 + { 623 + Path: "/var/lib/misc", 624 + }, 625 + { 626 + Path: "/var/local", 627 + }, 628 + { 629 + Path: "/var/lock", 630 + }, 631 + { 632 + Path: "/var/lock/subsys", 633 + }, 634 + { 635 + Path: "/var/log", 636 + }, 637 + { 638 + Path: "/var/mail", 639 + }, 640 + { 641 + Path: "/var/opt", 642 + }, 643 + { 644 + Path: "/var/spool", 645 + }, 646 + { 647 + Path: "/var/spool/mail", 648 + OwnerUID: "0", 649 + OwnerGID: "0", 650 + Permissions: "777", 651 + Digest: &file.Digest{ 652 + Algorithm: "'Q1'+base64(sha1)", 653 + Value: "Q1dzbdazYZA2nTzSIG3YyNw7d4Juc=", 654 + }, 655 + }, 656 + { 657 + Path: "/var/spool/cron", 658 + }, 659 + { 660 + Path: "/var/spool/cron/crontabs", 661 + OwnerUID: "0", 662 + OwnerGID: "0", 663 + Permissions: "777", 664 + Digest: &file.Digest{ 665 + Algorithm: "'Q1'+base64(sha1)", 666 + Value: "Q1OFZt+ZMp7j0Gny0rqSKuWJyqYmA=", 667 + }, 668 + }, 669 + { 670 + Path: "/var/tmp", 671 + OwnerUID: "0", 672 + OwnerGID: "0", 673 + Permissions: "1777", 674 + }, 648 675 }, 649 676 }, 650 677 }, skipped 2 lines 653 680 654 681 for _, test := range tests { 655 682 t.Run(test.fixture, func(t *testing.T) { 656 - lrc := newLocationReadCloser(t, test.fixture) 657 - 658 - pkgs, _, err := parseApkDB(nil, new(generic.Environment), lrc) 659 - require.NoError(t, err) 660 - require.Len(t, pkgs, 1) 661 - metadata := pkgs[0].Metadata.(pkg.ApkMetadata) 662 - 663 - if diff := cmp.Diff(test.expected, metadata); diff != "" { 664 - t.Errorf("Entry mismatch (-want +got):\n%s", diff) 683 + fixtureLocation := source.NewLocation(test.fixture) 684 + test.expected.Locations = source.NewLocationSet(fixtureLocation) 685 + licenses := test.expected.Licenses.ToSlice() 686 + for i := range licenses { 687 + licenses[i].Location.Add(fixtureLocation) 665 688 } 689 + test.expected.Licenses = pkg.NewLicenseSet(licenses...) 690 + pkgtest.TestFileParser(t, test.fixture, parseApkDB, []pkg.Package{test.expected}, nil) 666 691 }) 667 692 } 668 693 } 669 694 670 695 func TestMultiplePackages(t *testing.T) { 671 696 fixture := "test-fixtures/multiple" 672 - fixtureLocationSet := source.NewLocationSet(source.NewLocation(fixture)) 697 + location := source.NewLocation(fixture) 698 + fixtureLocationSet := source.NewLocationSet(location) 673 699 expectedPkgs := []pkg.Package{ 674 700 { 675 - Name: "libc-utils", 676 - Version: "0.7.2-r0", 677 - Licenses: []string{"BSD"}, 701 + Name: "libc-utils", 702 + Version: "0.7.2-r0", 703 + Licenses: pkg.NewLicenseSet( 704 + pkg.NewLicenseFromLocations("BSD", location), 705 + ), 678 706 Type: pkg.ApkPkg, 679 707 PURL: "pkg:apk/alpine/[email protected]?arch=x86_64&upstream=libc-dev&distro=alpine-3.12", 680 708 Locations: fixtureLocationSet, skipped 3 lines 684 712 OriginPackage: "libc-dev", 685 713 Maintainer: "Natanael Copa <[email protected]>", 686 714 Version: "0.7.2-r0", 687 - License: "BSD", 688 715 Architecture: "x86_64", 689 716 URL: "http://alpinelinux.org", 690 717 Description: "Meta package to pull in correct libc", skipped 7 lines 698 725 }, 699 726 }, 700 727 { 701 - Name: "musl-utils", 702 - Version: "1.1.24-r2", 703 - Licenses: []string{"MIT", "BSD", "GPL2+"}, 704 - Type: pkg.ApkPkg, 705 - PURL: "pkg:apk/alpine/[email protected]?arch=x86_64&upstream=musl&distro=alpine-3.12", 706 - Locations: fixtureLocationSet, 728 + Name: "musl-utils", 729 + Version: "1.1.24-r2", 730 + Type: pkg.ApkPkg, 731 + PURL: "pkg:apk/alpine/[email protected]?arch=x86_64&upstream=musl&distro=alpine-3.12", 732 + Locations: fixtureLocationSet, 733 + Licenses: pkg.NewLicenseSet( 734 + pkg.NewLicenseFromLocations("MIT", location), 735 + pkg.NewLicenseFromLocations("BSD", location), 736 + pkg.NewLicenseFromLocations("GPL2+", location), 737 + ), 707 738 MetadataType: pkg.ApkMetadataType, 708 739 Metadata: pkg.ApkMetadata{ 709 740 Package: "musl-utils", skipped 1 lines 711 742 Version: "1.1.24-r2", 712 743 Description: "the musl c library (libc) implementation", 713 744 Maintainer: "Timo Teräs <[email protected]>", 714 - License: "MIT BSD GPL2+", 715 745 Architecture: "x86_64", 716 746 URL: "https://musl.libc.org/", 717 747 Size: 37944, skipped 276 lines 994 1024 t.Run(test.name, func(t *testing.T) { 995 1025 pkgs, wantRelationships := test.genFn() 996 1026 gotRelationships := discoverPackageDependencies(pkgs) 997 - d := cmp.Diff(wantRelationships, gotRelationships, cmpopts.IgnoreUnexported(pkg.Package{}, source.LocationSet{})) 1027 + d := cmp.Diff(wantRelationships, gotRelationships, cmpopts.IgnoreUnexported(pkg.Package{}, source.LocationSet{}, pkg.LicenseSet{})) 998 1028 if d != "" { 999 1029 t.Fail() 1000 1030 t.Log(d) skipped 237 lines -
-
-
-
-
skipped 12 lines 13 13 14 14 "github.com/stretchr/testify/require" 15 15 16 + "github.com/anchore/syft/internal" 17 + "github.com/anchore/syft/syft/license" 18 + "github.com/anchore/syft/syft/pkg" 16 19 "github.com/anchore/syft/syft/source" 17 20 ) 18 21 19 22 func Test_LocalLicenseSearch(t *testing.T) { 23 + loc1 := source.NewLocation("github.com/someorg/[email protected]/LICENSE") 24 + loc2 := source.NewLocation("github.com/!cap!o!r!g/[email protected]/LICENSE.txt") 25 + 20 26 tests := []struct { 21 27 name string 22 28 version string 23 - expected string 29 + expected pkg.License 24 30 }{ 25 31 { 26 - name: "github.com/someorg/somename", 27 - version: "v0.3.2", 28 - expected: "Apache-2.0", 32 + name: "github.com/someorg/somename", 33 + version: "v0.3.2", 34 + expected: pkg.License{ 35 + Value: "Apache-2.0", 36 + SPDXExpression: "Apache-2.0", 37 + Type: license.Concluded, 38 + Location: source.NewLocationSet(loc1), 39 + URL: internal.NewStringSet(), 40 + }, 29 41 }, 30 42 { 31 - name: "github.com/CapORG/CapProject", 32 - version: "v4.111.5", 33 - expected: "MIT", 43 + name: "github.com/CapORG/CapProject", 44 + version: "v4.111.5", 45 + expected: pkg.License{ 46 + Value: "MIT", 47 + SPDXExpression: "MIT", 48 + Type: license.Concluded, 49 + Location: source.NewLocationSet(loc2), 50 + URL: internal.NewStringSet(), 51 + }, 34 52 }, 35 53 } 36 54 skipped 2 lines 39 57 40 58 for _, test := range tests { 41 59 t.Run(test.name, func(t *testing.T) { 42 - l := newGoLicenses(GoCatalogerOpts{ 43 - searchLocalModCacheLicenses: true, 44 - localModCacheDir: path.Join(wd, "test-fixtures", "licenses", "pkg", "mod"), 45 - }) 60 + l := newGoLicenses( 61 + GoCatalogerOpts{ 62 + searchLocalModCacheLicenses: true, 63 + localModCacheDir: path.Join(wd, "test-fixtures", "licenses", "pkg", "mod"), 64 + }, 65 + ) 46 66 licenses, err := l.getLicenses(source.EmptyResolver{}, test.name, test.version) 47 67 require.NoError(t, err) 48 68 skipped 5 lines 54 74 } 55 75 56 76 func Test_RemoteProxyLicenseSearch(t *testing.T) { 77 + loc1 := source.NewLocation("github.com/someorg/[email protected]/LICENSE") 78 + loc2 := source.NewLocation("github.com/!cap!o!r!g/[email protected]/LICENSE.txt") 79 + 57 80 server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 58 81 buf := &bytes.Buffer{} 59 82 uri := strings.TrimPrefix(strings.TrimSuffix(r.RequestURI, ".zip"), "/") skipped 34 lines 94 117 tests := []struct { 95 118 name string 96 119 version string 97 - expected string 120 + expected pkg.License 98 121 }{ 99 122 { 100 - name: "github.com/someorg/somename", 101 - version: "v0.3.2", 102 - expected: "Apache-2.0", 123 + name: "github.com/someorg/somename", 124 + version: "v0.3.2", 125 + expected: pkg.License{ 126 + Value: "Apache-2.0", 127 + SPDXExpression: "Apache-2.0", 128 + Type: license.Concluded, 129 + Location: source.NewLocationSet(loc1), 130 + URL: internal.NewStringSet(), 131 + }, 103 132 }, 104 133 { 105 - name: "github.com/CapORG/CapProject", 106 - version: "v4.111.5", 107 - expected: "MIT", 134 + name: "github.com/CapORG/CapProject", 135 + version: "v4.111.5", 136 + expected: pkg.License{ 137 + Value: "MIT", 138 + SPDXExpression: "MIT", 139 + Type: license.Concluded, 140 + Location: source.NewLocationSet(loc2), 141 + URL: internal.NewStringSet(), 142 + }, 108 143 }, 109 144 } 110 145 skipped 87 lines -
-
-
-
-
skipped 95 lines 96 96 }, 97 97 expected: map[string]pkg.Package{ 98 98 "example-jenkins-plugin": { 99 - Name: "example-jenkins-plugin", 100 - Version: "1.0-SNAPSHOT", 101 - PURL: "pkg:maven/io.jenkins.plugins/[email protected]", 102 - Licenses: []string{"MIT License"}, 99 + Name: "example-jenkins-plugin", 100 + Version: "1.0-SNAPSHOT", 101 + PURL: "pkg:maven/io.jenkins.plugins/[email protected]", 102 + Licenses: pkg.NewLicenseSet( 103 + pkg.NewLicenseFromLocations("MIT License", source.NewLocation("test-fixtures/java-builds/packages/example-jenkins-plugin.hpi")), 104 + ), 103 105 Language: pkg.Java, 104 106 Type: pkg.JenkinsPluginPkg, 105 107 MetadataType: pkg.JavaMetadataType, skipped 44 lines 150 152 Name: "example-java-app-gradle", 151 153 Version: "0.1.0", 152 154 PURL: "pkg:maven/example-java-app-gradle/[email protected]", 153 - Licenses: []string{}, 154 155 Language: pkg.Java, 155 156 Type: pkg.JavaPkg, 156 157 MetadataType: pkg.JavaMetadataType, skipped 48 lines 205 206 Name: "example-java-app-maven", 206 207 Version: "0.1.0", 207 208 PURL: "pkg:maven/org.anchore/[email protected]", 208 - Licenses: []string{}, 209 209 Language: pkg.Java, 210 210 Type: pkg.JavaPkg, 211 211 MetadataType: pkg.JavaMetadataType, skipped 790 lines -
skipped 11 lines 12 12 locationSet := source.NewLocationSet(source.NewLocation("package-lock.json")) 13 13 expectedPkgs := []pkg.Package{ 14 14 { 15 - Name: "@actions/core", 16 - Version: "1.6.0", 17 - FoundBy: "javascript-lock-cataloger", 18 - PURL: "pkg:npm/%40actions/[email protected]", 19 - Locations: locationSet, 20 - Language: pkg.JavaScript, 21 - Type: pkg.NpmPkg, 22 - Licenses: []string{"MIT"}, 15 + Name: "@actions/core", 16 + Version: "1.6.0", 17 + FoundBy: "javascript-lock-cataloger", 18 + PURL: "pkg:npm/%40actions/[email protected]", 19 + Locations: locationSet, 20 + Language: pkg.JavaScript, 21 + Type: pkg.NpmPkg, 22 + Licenses: pkg.NewLicenseSet( 23 + pkg.NewLicenseFromLocations("MIT", source.NewLocation("package-lock.json")), 24 + ), 23 25 MetadataType: pkg.NpmPackageLockJSONMetadataType, 24 26 Metadata: pkg.NpmPackageLockJSONMetadata{Resolved: "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", Integrity: "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw=="}, 25 27 }, skipped 9 lines 35 37 Metadata: pkg.NpmPackageLockJSONMetadata{Resolved: "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", Integrity: "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="}, 36 38 }, 37 39 { 38 - Name: "cowsay", 39 - Version: "1.4.0", 40 - FoundBy: "javascript-lock-cataloger", 41 - PURL: "pkg:npm/[email protected]", 42 - Locations: locationSet, 43 - Language: pkg.JavaScript, 44 - Type: pkg.NpmPkg, 45 - Licenses: []string{"MIT"}, 40 + Name: "cowsay", 41 + Version: "1.4.0", 42 + FoundBy: "javascript-lock-cataloger", 43 + PURL: "pkg:npm/[email protected]", 44 + Locations: locationSet, 45 + Language: pkg.JavaScript, 46 + Type: pkg.NpmPkg, 47 + Licenses: pkg.NewLicenseSet( 48 + pkg.NewLicenseFromLocations("MIT", source.NewLocation("package-lock.json")), 49 + ), 46 50 MetadataType: pkg.NpmPackageLockJSONMetadataType, 47 51 Metadata: pkg.NpmPackageLockJSONMetadata{Resolved: "https://registry.npmjs.org/cowsay/-/cowsay-1.4.0.tgz", Integrity: "sha512-rdg5k5PsHFVJheO/pmE3aDg2rUDDTfPJau6yYkZYlHFktUz+UxbE+IgnUAEyyCyv4noL5ltxXD0gZzmHPCy/9g=="}, 48 52 }, skipped 149 lines -
-