mirror of
https://github.com/anchore/syft.git
synced 2026-10-13 22:57:19 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb952ed25a |
+3
-3
@@ -26,7 +26,7 @@ tools:
|
||||
# used for linting
|
||||
- name: golangci-lint
|
||||
version:
|
||||
want: v1.60.1
|
||||
want: v1.59.1
|
||||
method: github-release
|
||||
with:
|
||||
repo: golangci/golangci-lint
|
||||
@@ -42,7 +42,7 @@ tools:
|
||||
# used for signing the checksums file at release
|
||||
- name: cosign
|
||||
version:
|
||||
want: v2.4.0
|
||||
want: v2.3.0
|
||||
method: github-release
|
||||
with:
|
||||
repo: sigstore/cosign
|
||||
@@ -58,7 +58,7 @@ tools:
|
||||
# used to release all artifacts
|
||||
- name: goreleaser
|
||||
version:
|
||||
want: v2.2.0
|
||||
want: v2.1.0
|
||||
method: github-release
|
||||
with:
|
||||
repo: goreleaser/goreleaser
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
contact_links:
|
||||
|
||||
- name: Join our Discourse community 💬
|
||||
# link to our community Discourse site
|
||||
url: https://anchore.com/discourse
|
||||
- name: Join the Slack community 💬
|
||||
# link to our community Slack registration page
|
||||
url: https://anchore.com/slack
|
||||
about: 'Come chat with us! Ask for help, join our software development efforts, or just give us feedback!'
|
||||
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" # URL encode all '\r' characters
|
||||
echo "result=$OUTPUT" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
|
||||
- uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
|
||||
with:
|
||||
name: benchmark-test-results
|
||||
path: test/results/**/*
|
||||
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@429e1977040da7a23b6822b13c129cd1ba93dbb2 #v3.26.2
|
||||
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a #v3.25.15
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@429e1977040da7a23b6822b13c129cd1ba93dbb2 #v3.26.2
|
||||
uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a #v3.25.15
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
@@ -70,4 +70,4 @@ jobs:
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@429e1977040da7a23b6822b13c129cd1ba93dbb2 #v3.26.2
|
||||
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a #v3.25.15
|
||||
|
||||
@@ -148,7 +148,7 @@ jobs:
|
||||
# for updating brew formula in anchore/homebrew-syft
|
||||
GITHUB_BREW_TOKEN: ${{ secrets.ANCHOREOPS_GITHUB_OSS_WRITE_TOKEN }}
|
||||
|
||||
- uses: anchore/sbom-action@ab9d16d4b419c9d1a02df5213fa0ebe965ca5a57 #v0.17.1
|
||||
- uses: anchore/sbom-action@d94f46e13c6c62f59525ac9a1e147a99dc0b9bf5 #v0.17.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
artifact-name: sbom.spdx.json
|
||||
|
||||
@@ -188,7 +188,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Install Cosign
|
||||
uses: sigstore/cosign-installer@v3.6.0
|
||||
uses: sigstore/cosign-installer@v3.5.0
|
||||
|
||||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
|
||||
|
||||
|
||||
+2
-2
@@ -83,7 +83,7 @@ Syft's core library is implemented in the `syft` package and subpackages, where
|
||||
- the `syft` package contains a single function that can take a `source.Source` object and catalog it, producing an `sbom.SBOM` object
|
||||
- the `syft/format` package contains the ability to encode and decode SBOMs to and from different SBOM formats (such as SPDX and CycloneDX)
|
||||
|
||||
The `cmd` package at the highest level execution flow wires up [`spf13/cobra`](https://github.com/spf13/cobra) commands for execution in the main application:
|
||||
The `cmd` pacakge at the highest level execution flow wires up [`spf13/cobra`](https://github.com/spf13/cobra) commands for execution in the main application:
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant main as cmd/syft/main
|
||||
@@ -212,7 +212,7 @@ Finally, here is an example of where the package construction is done within the
|
||||
- [The APK package constructor itself](https://github.com/anchore/syft/tree/v0.70.0/syft/pkg/cataloger/apkdb/package.go#L12-L27)
|
||||
|
||||
Interested in building a new cataloger? Checkout the [list of issues with the `new-cataloger` label](https://github.com/anchore/syft/issues?q=is%3Aopen+is%3Aissue+label%3Anew-cataloger+no%3Aassignee)!
|
||||
If you have questions about implementing a cataloger feel free to file an issue or reach out to us [on discourse](https://anchore.com/discourse)!
|
||||
If you have questions about implementing a cataloger feel free to file an issue or reach out to us [on slack](https://anchore.com/slack)!
|
||||
|
||||
|
||||
#### Searching for files
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<a href="https://github.com/anchore/syft/releases/latest" target="_blank"><img alt="GitHub release" src="https://img.shields.io/github/release/anchore/syft.svg"></a>
|
||||
<a href="https://github.com/anchore/syft" target="_blank"><img alt="GitHub go.mod Go version" src="https://img.shields.io/github/go-mod/go-version/anchore/syft.svg"></a>
|
||||
<a href="" target="_blank"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a>
|
||||
<a href="https://anchore.com/discourse" target="_blank"><img alt="Join our Discourse" src="https://img.shields.io/badge/Discourse-Join-blue?logo=discourse"/></a>
|
||||
<a href="https://anchore.com/slack" target="_blank"><img alt="Slack" src="https://img.shields.io/badge/Slack-Join-blue?logo=slack"></a>
|
||||
</p>
|
||||
|
||||

|
||||
@@ -178,3 +178,5 @@ The Syft Team hold regular community meetings online. All are welcome to join to
|
||||
- Check the [calendar](https://calendar.google.com/calendar/u/0/r?cid=Y182OTM4dGt0MjRtajI0NnNzOThiaGtnM29qNEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t) for the next meeting date.
|
||||
- Add items to the [agenda](https://docs.google.com/document/d/1ZtSAa6fj2a6KRWviTn3WoJm09edvrNUp4Iz_dOjjyY8/edit?usp=sharing) (join [this group](https://groups.google.com/g/anchore-oss-community) for write access to the [agenda](https://docs.google.com/document/d/1ZtSAa6fj2a6KRWviTn3WoJm09edvrNUp4Iz_dOjjyY8/edit?usp=sharing))
|
||||
- See you there!
|
||||
|
||||
<!-- KJIc1D4zXJbRybKEJrWd -->
|
||||
|
||||
@@ -161,7 +161,7 @@ func validateArgs(cmd *cobra.Command, args []string, error string) error {
|
||||
if err := cmd.Help(); err != nil {
|
||||
return fmt.Errorf("unable to display help: %w", err)
|
||||
}
|
||||
return fmt.Errorf("%v", error)
|
||||
return fmt.Errorf(error)
|
||||
}
|
||||
|
||||
return cobra.MaximumNArgs(1)(cmd, args)
|
||||
|
||||
@@ -50,7 +50,7 @@ if false, uses the syft-json output for templating (which follows the syft JSON
|
||||
|
||||
Note: long term support for this option is not guaranteed (it may change or break at any time)`)
|
||||
|
||||
prettyDescription := `include space indentation and newlines
|
||||
prettyDescription := `include space indention and newlines
|
||||
note: inherits default value from 'format.pretty' or 'false' if parent is unset`
|
||||
descriptions.Add(&o.SyftJSON.Pretty, prettyDescription)
|
||||
descriptions.Add(&o.SPDXJSON.Pretty, prettyDescription)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,25 +0,0 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/anchore/syft/syft/pkg"
|
||||
"github.com/anchore/syft/syft/source"
|
||||
)
|
||||
|
||||
func TestSbomMetadataComponent(t *testing.T) {
|
||||
sbom, _ := catalogFixtureImage(t, "image-sbom-metadata-component", source.SquashedScope, "+sbom-cataloger")
|
||||
|
||||
expectedPkgs := []string{"first-subcomponent", "main-component"}
|
||||
foundPkgs := []string{}
|
||||
|
||||
for sbomPkg := range sbom.Artifacts.Packages.Enumerate(pkg.JavaPkg) {
|
||||
foundPkgs = append(foundPkgs, sbomPkg.Name)
|
||||
}
|
||||
|
||||
// check if both the package in `.metadata.component` and the one in `.components` were found
|
||||
if !reflect.DeepEqual(expectedPkgs, foundPkgs) {
|
||||
t.Errorf("expected packages %v, got %v", expectedPkgs, foundPkgs)
|
||||
}
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
FROM scratch
|
||||
COPY test.cdx.json /
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"bomFormat" : "CycloneDX",
|
||||
"specVersion" : "1.5",
|
||||
"serialNumber" : "urn:uuid:dc807d4b-0415-35ab-ba61-49b5d39bc2d9",
|
||||
"version" : 1,
|
||||
"metadata" : {
|
||||
"component" : {
|
||||
"name" : "main-component",
|
||||
"version" : "1.2.3",
|
||||
"purl" : "pkg:maven/org.example/main-component@1.2.3",
|
||||
"type" : "library",
|
||||
"bom-ref" : "pkg:maven/org.example/main-component@1.2.3"
|
||||
}
|
||||
},
|
||||
"components" : [
|
||||
{
|
||||
"name" : "first-subcomponent",
|
||||
"version" : "2.3.4",
|
||||
"purl" : "pkg:maven/org.example/first-subcomponent@2.3.4",
|
||||
"type" : "library",
|
||||
"bom-ref" : "pkg:maven/org.example/first-subcomponent@2.3.4"
|
||||
}
|
||||
],
|
||||
"dependencies" : [
|
||||
{
|
||||
"ref" : "pkg:maven/org.example/main-component-assembly@1.2.3",
|
||||
"dependsOn" : [
|
||||
"pkg:maven/org.example/first-subcomponent@2.3.4"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1 @@
|
||||
FROM docker.io/anchore/test_images:java-88948cc@sha256:dea0e6c24636937f53bdc997d9960c2a18966d1e38bcd8ebd0c395d4e169b806
|
||||
|
||||
RUN rm /packages/gradle-7.1.1-bin.zip
|
||||
FROM anchore/test_images:java-1abc58f@sha256:3add9f90e9ed35739cc99b7830767e09eec921052e2412adf4491648c741f066
|
||||
|
||||
@@ -24,12 +24,12 @@ require (
|
||||
github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46
|
||||
github.com/bmatcuk/doublestar/v4 v4.6.1
|
||||
github.com/charmbracelet/bubbles v0.18.0
|
||||
github.com/charmbracelet/bubbletea v0.27.0
|
||||
github.com/charmbracelet/bubbletea v0.26.6
|
||||
github.com/charmbracelet/lipgloss v0.12.1
|
||||
github.com/dave/jennifer v1.7.0
|
||||
github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da
|
||||
github.com/distribution/reference v0.6.0
|
||||
github.com/docker/docker v27.1.2+incompatible
|
||||
github.com/docker/docker v27.1.1+incompatible
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/elliotchance/phpserialize v1.4.0
|
||||
github.com/facebookincubator/nvdtools v0.1.5
|
||||
@@ -39,7 +39,7 @@ require (
|
||||
github.com/go-git/go-git/v5 v5.12.0
|
||||
github.com/go-test/deep v1.1.1
|
||||
github.com/google/go-cmp v0.6.0
|
||||
github.com/google/go-containerregistry v0.20.2
|
||||
github.com/google/go-containerregistry v0.20.1
|
||||
github.com/google/licensecheck v0.3.1
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/gookit/color v1.5.4
|
||||
@@ -79,9 +79,9 @@ require (
|
||||
github.com/zyedidia/generic v1.2.2-0.20230320175451-4410d2372cb1
|
||||
go.uber.org/goleak v1.3.0
|
||||
golang.org/x/mod v0.20.0
|
||||
golang.org/x/net v0.28.0
|
||||
golang.org/x/net v0.27.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
modernc.org/sqlite v1.32.0
|
||||
modernc.org/sqlite v1.31.1
|
||||
)
|
||||
|
||||
require google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
|
||||
@@ -125,7 +125,7 @@ require (
|
||||
github.com/containerd/typeurl/v2 v2.1.1 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/docker/cli v27.1.1+incompatible // indirect
|
||||
github.com/docker/cli v27.0.3+incompatible // indirect
|
||||
github.com/docker/distribution v2.8.3+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.7.0 // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
@@ -230,11 +230,11 @@ require (
|
||||
go.opentelemetry.io/otel/trace v1.19.0 // indirect
|
||||
go.uber.org/atomic v1.9.0 // indirect
|
||||
go.uber.org/multierr v1.9.0 // indirect
|
||||
golang.org/x/crypto v0.26.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.24.0 // indirect
|
||||
golang.org/x/term v0.23.0 // indirect
|
||||
golang.org/x/text v0.17.0 // indirect
|
||||
golang.org/x/crypto v0.25.0 // indirect
|
||||
golang.org/x/sync v0.7.0 // indirect
|
||||
golang.org/x/sys v0.22.0 // indirect
|
||||
golang.org/x/term v0.22.0 // indirect
|
||||
golang.org/x/text v0.16.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
|
||||
|
||||
@@ -157,8 +157,8 @@ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0=
|
||||
github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw=
|
||||
github.com/charmbracelet/bubbletea v0.27.0 h1:Mznj+vvYuYagD9Pn2mY7fuelGvP0HAXtZYGgRBCbHvU=
|
||||
github.com/charmbracelet/bubbletea v0.27.0/go.mod h1:5MdP9XH6MbQkgGhnlxUqCNmBXf9I74KRQ8HIidRxV1Y=
|
||||
github.com/charmbracelet/bubbletea v0.26.6 h1:zTCWSuST+3yZYZnVSvbXwKOPRSNZceVeqpzOLN2zq1s=
|
||||
github.com/charmbracelet/bubbletea v0.26.6/go.mod h1:dz8CWPlfCCGLFbBlTY4N7bjLiyOGDJEnd2Muu7pOWhk=
|
||||
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
|
||||
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
|
||||
github.com/charmbracelet/lipgloss v0.12.1 h1:/gmzszl+pedQpjCOH+wFkZr/N90Snz40J/NR7A0zQcs=
|
||||
@@ -227,12 +227,12 @@ github.com/deitch/magic v0.0.0-20230404182410-1ff89d7342da/go.mod h1:B3tI9iGHi4i
|
||||
github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4=
|
||||
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||
github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE=
|
||||
github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||
github.com/docker/cli v27.0.3+incompatible h1:usGs0/BoBW8MWxGeEtqPMkzOY56jZ6kYlSN5BLDioCQ=
|
||||
github.com/docker/cli v27.0.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
|
||||
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||
github.com/docker/docker v27.1.2+incompatible h1:AhGzR1xaQIy53qCkxARaFluI00WPGtXn0AJuoQsVYTY=
|
||||
github.com/docker/docker v27.1.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/docker v27.1.1+incompatible h1:hO/M4MtV36kzKldqnA37IWhebRA+LnqqcqDja6kVaKY=
|
||||
github.com/docker/docker v27.1.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
|
||||
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
|
||||
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
|
||||
@@ -384,8 +384,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo=
|
||||
github.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8=
|
||||
github.com/google/go-containerregistry v0.20.1 h1:eTgx9QNYugV4DN5mz4U8hiAGTi1ybXn0TPi4Smd8du0=
|
||||
github.com/google/go-containerregistry v0.20.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/licensecheck v0.3.1 h1:QoxgoDkaeC4nFrtGN1jV7IPmDCHFNIVh54e5hSt6sPs=
|
||||
github.com/google/licensecheck v0.3.1/go.mod h1:ORkR35t/JjW+emNKtfJDII0zlciG9JgbT7SmsohlHmY=
|
||||
@@ -878,8 +878,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0
|
||||
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
|
||||
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
|
||||
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
|
||||
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -968,8 +968,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
|
||||
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
|
||||
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
||||
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -1000,8 +1000,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -1081,15 +1081,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
||||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
|
||||
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
|
||||
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
|
||||
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -1102,8 +1102,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
|
||||
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -1379,8 +1379,8 @@ modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4=
|
||||
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc=
|
||||
modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss=
|
||||
modernc.org/sqlite v1.32.0 h1:6BM4uGza7bWypsw4fdLRsLxut6bHe4c58VeqjRgST8s=
|
||||
modernc.org/sqlite v1.32.0/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA=
|
||||
modernc.org/sqlite v1.31.1 h1:XVU0VyzxrYHlBhIs1DiEgSl0ZtdnPtbLVy8hSkzxGrs=
|
||||
modernc.org/sqlite v1.31.1/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA=
|
||||
modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
|
||||
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
|
||||
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Caching
|
||||
|
||||
All caches are created from a global `manager`. By default this is a `bypassedCache`, which performs no caching.
|
||||
All caches are created from a global `manager`. By defaut this is a `bypassedCache`, which performs no caching.
|
||||
One benefit of this is that tests don't need to worry about caching causing issues unless they explicitly need
|
||||
to test the cache and can opt-in using the `cache.TestCache(t)` helper.
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -34,7 +34,7 @@ func (r *errorResolver[T]) Resolve(key string, resolver resolverFunc[T]) (T, err
|
||||
return v.Value, err
|
||||
}
|
||||
if v.Error != "" {
|
||||
return v.Value, fmt.Errorf("failed to resolve cache: %s", v.Error)
|
||||
return v.Value, fmt.Errorf(v.Error)
|
||||
}
|
||||
return v.Value, nil
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Code generated by go generate; DO NOT EDIT.
|
||||
// This file was generated by robots at 2024-08-20 11:33:49.349625 -0400 EDT m=+0.383911876
|
||||
// This file was generated by robots at 2024-05-23 08:47:23.204981 -0400 EDT m=+0.050881068
|
||||
// using data from https://spdx.org/licenses/licenses.json
|
||||
package spdxlicense
|
||||
|
||||
const Version = "3.25.0"
|
||||
const Version = "3.24.0"
|
||||
|
||||
var licenseIDs = map[string]string{
|
||||
"0bsd": "0BSD",
|
||||
@@ -501,8 +501,6 @@ var licenseIDs = map[string]string{
|
||||
"dldezero2.0": "DL-DE-ZERO-2.0",
|
||||
"dldezero2.0.0": "DL-DE-ZERO-2.0",
|
||||
"doc": "DOC",
|
||||
"docbookschema": "DocBook-Schema",
|
||||
"docbookxml": "DocBook-XML",
|
||||
"dotseqn": "Dotseqn",
|
||||
"drl1": "DRL-1.0",
|
||||
"drl1.0": "DRL-1.0",
|
||||
@@ -716,7 +714,6 @@ var licenseIDs = map[string]string{
|
||||
"gutmann": "Gutmann",
|
||||
"haskellreport": "HaskellReport",
|
||||
"hdparm": "hdparm",
|
||||
"hidapi": "HIDAPI",
|
||||
"hippocratic2": "Hippocratic-2.1",
|
||||
"hippocratic2.1": "Hippocratic-2.1",
|
||||
"hippocratic2.1.0": "Hippocratic-2.1",
|
||||
@@ -743,7 +740,6 @@ var licenseIDs = map[string]string{
|
||||
"hpndmarkuskuhn": "HPND-Markus-Kuhn",
|
||||
"hpndmerchantabilityvariant": "HPND-merchantability-variant",
|
||||
"hpndmitdisclaimer": "HPND-MIT-disclaimer",
|
||||
"hpndnetrek": "HPND-Netrek",
|
||||
"hpndpbmplus": "HPND-Pbmplus",
|
||||
"hpndsellmitdisclaimerxserver": "HPND-sell-MIT-disclaimer-xserver",
|
||||
"hpndsellregexpr": "HPND-sell-regexpr",
|
||||
@@ -1169,7 +1165,6 @@ var licenseIDs = map[string]string{
|
||||
"rsamd": "RSA-MD",
|
||||
"rscpl": "RSCPL",
|
||||
"ruby": "Ruby",
|
||||
"rubypty": "Ruby-pty",
|
||||
"saxpath": "Saxpath",
|
||||
"saxpd": "SAX-PD",
|
||||
"saxpd2": "SAX-PD-2.0",
|
||||
@@ -1270,9 +1265,6 @@ var licenseIDs = map[string]string{
|
||||
"tuberlin2": "TU-Berlin-2.0",
|
||||
"tuberlin2.0": "TU-Berlin-2.0",
|
||||
"tuberlin2.0.0": "TU-Berlin-2.0",
|
||||
"ubuntufont1": "Ubuntu-font-1.0",
|
||||
"ubuntufont1.0": "Ubuntu-font-1.0",
|
||||
"ubuntufont1.0.0": "Ubuntu-font-1.0",
|
||||
"ucar": "UCAR",
|
||||
"ucl1": "UCL-1.0",
|
||||
"ucl1.0": "UCL-1.0",
|
||||
@@ -1323,11 +1315,8 @@ var licenseIDs = map[string]string{
|
||||
"x11.0": "X11",
|
||||
"x11.0.0": "X11",
|
||||
"x11.0.0distributemodificationsvariant": "X11-distribute-modifications-variant",
|
||||
"x11.0.0swapped": "X11-swapped",
|
||||
"x11.0distributemodificationsvariant": "X11-distribute-modifications-variant",
|
||||
"x11.0swapped": "X11-swapped",
|
||||
"x11distributemodificationsvariant": "X11-distribute-modifications-variant",
|
||||
"x11swapped": "X11-swapped",
|
||||
"xdebug1": "Xdebug-1.03",
|
||||
"xdebug1.03": "Xdebug-1.03",
|
||||
"xdebug1.03.0": "Xdebug-1.03",
|
||||
|
||||
@@ -211,12 +211,6 @@ func toBomProperties(srcMetadata source.Description) *[]cyclonedx.Property {
|
||||
metadata, ok := srcMetadata.Metadata.(source.ImageMetadata)
|
||||
if ok {
|
||||
props := helpers.EncodeProperties(metadata.Labels, "syft:image:labels")
|
||||
// return nil if props is nil to avoid creating a pointer to a nil slice,
|
||||
// which results in a null JSON value that does not comply with the CycloneDX schema.
|
||||
// https://github.com/anchore/grype/issues/1759
|
||||
if props == nil {
|
||||
return nil
|
||||
}
|
||||
return &props
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -236,53 +236,6 @@ func Test_toBomDescriptor(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func Test_toBomProperties(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
srcMetadata source.Description
|
||||
props *[]cyclonedx.Property
|
||||
}{
|
||||
{
|
||||
name: "ImageMetadata without labels",
|
||||
srcMetadata: source.Description{
|
||||
Metadata: source.ImageMetadata{
|
||||
Labels: map[string]string{},
|
||||
},
|
||||
},
|
||||
props: nil,
|
||||
},
|
||||
{
|
||||
name: "ImageMetadata with labels",
|
||||
srcMetadata: source.Description{
|
||||
Metadata: source.ImageMetadata{
|
||||
Labels: map[string]string{
|
||||
"label1": "value1",
|
||||
"label2": "value2",
|
||||
},
|
||||
},
|
||||
},
|
||||
props: &[]cyclonedx.Property{
|
||||
{Name: "syft:image:labels:label1", Value: "value1"},
|
||||
{Name: "syft:image:labels:label2", Value: "value2"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "not ImageMetadata",
|
||||
srcMetadata: source.Description{
|
||||
Metadata: source.FileMetadata{},
|
||||
},
|
||||
props: nil,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
props := toBomProperties(test.srcMetadata)
|
||||
require.Equal(t, test.props, props)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func Test_toOsComponent(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
@@ -39,23 +39,12 @@ func ToSyftModel(bom *cyclonedx.BOM) (*sbom.SBOM, error) {
|
||||
}
|
||||
|
||||
func collectBomPackages(bom *cyclonedx.BOM, s *sbom.SBOM, idMap map[string]interface{}) error {
|
||||
componentsPresent := false
|
||||
if bom.Components != nil {
|
||||
for i := range *bom.Components {
|
||||
collectPackages(&(*bom.Components)[i], s, idMap)
|
||||
}
|
||||
componentsPresent = true
|
||||
}
|
||||
|
||||
if bom.Metadata != nil && bom.Metadata.Component != nil {
|
||||
collectPackages(bom.Metadata.Component, s, idMap)
|
||||
componentsPresent = true
|
||||
}
|
||||
|
||||
if !componentsPresent {
|
||||
if bom.Components == nil {
|
||||
return fmt.Errorf("no components are defined in the CycloneDX BOM")
|
||||
}
|
||||
|
||||
for i := range *bom.Components {
|
||||
collectPackages(&(*bom.Components)[i], s, idMap)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -78,8 +78,7 @@ func findMetadataDefinitionNames(paths ...string) ([]string, error) {
|
||||
// note: 35 is a point-in-time gut check. This number could be updated if new metadata definitions are added, but is not required.
|
||||
// it is really intended to catch any major issues with the generation process that would generate, say, 0 definitions.
|
||||
if len(strNames) < 35 {
|
||||
msg := fmt.Sprintf("not enough metadata definitions found (discovered %d)", len(strNames))
|
||||
return nil, fmt.Errorf("%v", msg)
|
||||
return nil, fmt.Errorf("not enough metadata definitions found (discovered: " + fmt.Sprintf("%d", len(strNames)) + ")")
|
||||
}
|
||||
|
||||
return strNames, nil
|
||||
|
||||
@@ -68,8 +68,7 @@ func findMetadataDefinitionNames(paths ...string) ([]string, error) {
|
||||
// note: 3 is a point-in-time gut check. This number could be updated if new metadata definitions are added, but is not required.
|
||||
// it is really intended to catch any major issues with the generation process that would generate, say, 0 definitions.
|
||||
if len(strNames) < 3 {
|
||||
msg := fmt.Sprintf("not enough metadata definitions found (discovered %d)", len(strNames))
|
||||
return nil, fmt.Errorf("%v", msg)
|
||||
return nil, fmt.Errorf("not enough metadata definitions found (discovered: " + fmt.Sprintf("%d", len(strNames)) + ")")
|
||||
}
|
||||
|
||||
return strNames, nil
|
||||
|
||||
@@ -24,7 +24,7 @@ func parseConanfile(_ context.Context, _ file.Resolver, _ *generic.Environment,
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(err, io.EOF):
|
||||
case errors.Is(io.EOF, err):
|
||||
return pkgs, nil, nil
|
||||
case err != nil:
|
||||
return nil, nil, fmt.Errorf("failed to parse conanfile.txt file: %w", err)
|
||||
|
||||
@@ -99,7 +99,7 @@ func parseConaninfo(_ context.Context, _ file.Resolver, _ *generic.Environment,
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(err, io.EOF):
|
||||
case errors.Is(io.EOF, err):
|
||||
mainPackage := newConaninfoPackage(
|
||||
mainMetadata,
|
||||
reader.Location.WithAnnotation(pkg.EvidenceAnnotationKey, pkg.PrimaryEvidenceAnnotation),
|
||||
|
||||
@@ -28,7 +28,7 @@ func parseMixLock(_ context.Context, _ file.Resolver, _ *generic.Environment, re
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(err, io.EOF):
|
||||
case errors.Is(io.EOF, err):
|
||||
return packages, nil, nil
|
||||
case err != nil:
|
||||
return nil, nil, fmt.Errorf("failed to parse mix.lock file: %w", err)
|
||||
|
||||
@@ -251,7 +251,6 @@ func getModule(proxies []string, moduleName, moduleVersion string) (urlPrefix st
|
||||
case "file":
|
||||
p := filepath.Join(u.Path, moduleName, "@v", moduleVersion)
|
||||
urlPrefix = path.Join("file://", p) + "/"
|
||||
log.WithFields("path", p).Info("looking for go module in filesystem")
|
||||
fsys = os.DirFS(p)
|
||||
}
|
||||
if fsys != nil {
|
||||
@@ -265,7 +264,6 @@ func getModuleProxy(proxy string, moduleName string, moduleVersion string) (modu
|
||||
u := fmt.Sprintf("%s/%s/@v/%s.zip", proxy, moduleName, moduleVersion)
|
||||
|
||||
// get the module zip
|
||||
log.WithFields("url", u).Info("downloading go module from proxy")
|
||||
resp, err := http.Get(u) //nolint:gosec
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
@@ -336,8 +334,6 @@ func getModuleRepository(moduleName string, moduleVersion string) (string, fs.FS
|
||||
f := memfs.New()
|
||||
buf := &bytes.Buffer{}
|
||||
repoURL := fmt.Sprintf("https://%s", repoName)
|
||||
|
||||
log.WithFields("repoURL", repoURL, "ref", cloneRefName).Info("cloning go module repository")
|
||||
r, err := git.Clone(memory.NewStorage(), f, &git.CloneOptions{
|
||||
URL: repoURL,
|
||||
ReferenceName: cloneRefName,
|
||||
|
||||
@@ -23,7 +23,7 @@ func parseCabalFreeze(_ context.Context, _ file.Resolver, _ *generic.Environment
|
||||
for {
|
||||
line, err := r.ReadString('\n')
|
||||
switch {
|
||||
case errors.Is(err, io.EOF):
|
||||
case errors.Is(io.EOF, err):
|
||||
return pkgs, nil, nil
|
||||
case err != nil:
|
||||
return nil, nil, fmt.Errorf("failed to parse cabal.project.freeze file: %w", err)
|
||||
|
||||
@@ -1464,9 +1464,6 @@
|
||||
"quality-gates": [
|
||||
"cpe:2.3:a:jenkins:quality_gates:*:*:*:*:*:jenkins:*:*"
|
||||
],
|
||||
"qualys-pc": [
|
||||
"cpe:2.3:a:qualys:policy_compliance:*:*:*:*:*:jenkins:*:*"
|
||||
],
|
||||
"quayio-trigger": [
|
||||
"cpe:2.3:a:jenkins:quay.io_trigger:*:*:*:*:*:jenkins:*:*"
|
||||
],
|
||||
@@ -2080,9 +2077,6 @@
|
||||
"@braintree/sanitize-url": [
|
||||
"cpe:2.3:a:paypal:braintree\\/sanitize-url:*:*:*:*:*:node.js:*:*"
|
||||
],
|
||||
"@builder.io/qwik": [
|
||||
"cpe:2.3:a:qwik:qwik:*:*:*:*:*:node.js:*:*"
|
||||
],
|
||||
"@chainsafe/libp2p-noise": [
|
||||
"cpe:2.3:a:chainsafe:js-libp2p-noise:*:*:*:*:*:node.js:*:*"
|
||||
],
|
||||
@@ -5276,9 +5270,6 @@
|
||||
"weather.swlyons": [
|
||||
"cpe:2.3:a:weather.swlyons_project:weather.swlyons:*:*:*:*:*:node.js:*:*"
|
||||
],
|
||||
"webcrack": [
|
||||
"cpe:2.3:a:j4k0xb:webcrack:*:*:*:*:*:node.js:*:*"
|
||||
],
|
||||
"webdriver-launcher": [
|
||||
"cpe:2.3:a:webdriver-launcher_project:webdriver-launcher:*:*:*:*:*:node.js:*:*"
|
||||
],
|
||||
@@ -6313,9 +6304,6 @@
|
||||
"secure_headers": [
|
||||
"cpe:2.3:a:twitter:secure_headers:*:*:*:*:*:ruby:*:*"
|
||||
],
|
||||
"sequenceserver": [
|
||||
"cpe:2.3:a:wurmlab:sequenceserver:*:*:*:*:*:ruby:*:*"
|
||||
],
|
||||
"sfpagent": [
|
||||
"cpe:2.3:a:herry:sfpagent:*:*:*:*:*:ruby:*:*"
|
||||
],
|
||||
@@ -7231,7 +7219,6 @@
|
||||
"cpe:2.3:a:webtechstreet:elementor_addon_elements:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"addons-for-beaver-builder": [
|
||||
"cpe:2.3:a:livemesh:beaver_builder_addons:*:*:*:*:*:wordpress:*:*",
|
||||
"cpe:2.3:a:livemesh:livemesh_addons_for_beaver_builder:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"addons-for-elementor": [
|
||||
@@ -8611,8 +8598,7 @@
|
||||
"cpe:2.3:a:quantumcloud:ai_chatbot:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"chatbot-chatgpt": [
|
||||
"cpe:2.3:a:kognetics:kognetiks_chatbot:*:*:*:*:*:wordpress:*:*",
|
||||
"cpe:2.3:a:kognetiks:chatbot:*:*:*:*:*:wordpress:*:*"
|
||||
"cpe:2.3:a:kognetics:kognetiks_chatbot:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"chaty": [
|
||||
"cpe:2.3:a:premio:chaty:*:*:*:*:*:wordpress:*:*",
|
||||
@@ -8704,9 +8690,6 @@
|
||||
"clockwork-two-factor-authentication": [
|
||||
"cpe:2.3:a:mediaburst:two-factor_authentication:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"clone-menu": [
|
||||
"cpe:2.3:a:afzalmultani:wp_clone_menu:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"cloudnet-sync": [
|
||||
"cpe:2.3:a:cloudnet360:cloudnet360:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -10116,9 +10099,6 @@
|
||||
"enquiry-quotation-for-woocommerce": [
|
||||
"cpe:2.3:a:piwebsolution:product_enquiry_for_woocommerce:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"enteraddons": [
|
||||
"cpe:2.3:a:themelooks:enter_addons:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"envato-elements": [
|
||||
"cpe:2.3:a:envato:envato_elements:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -10874,9 +10854,6 @@
|
||||
"generatepress-premium": [
|
||||
"cpe:2.3:a:generatepress:generatepress:*:*:*:*:premium:wordpress:*:*"
|
||||
],
|
||||
"genesis-blocks": [
|
||||
"cpe:2.3:a:wpengine:genesis_blocks:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"genesis-columns-advanced": [
|
||||
"cpe:2.3:a:genesis_columns_advanced_project:genesis_columns_advanced:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -11624,7 +11601,6 @@
|
||||
"cpe:2.3:a:insert_pages_project:insert_pages:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"insert-php": [
|
||||
"cpe:2.3:a:cm-wp:woody_ad_snippets:*:*:*:*:*:wordpress:*:*",
|
||||
"cpe:2.3:a:cm-wp:woody_code_snippets:*:*:*:*:*:wordpress:*:*",
|
||||
"cpe:2.3:a:webcraftic:woody_ad_snippets:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -13268,9 +13244,6 @@
|
||||
"page-list": [
|
||||
"cpe:2.3:a:page-list_project:page-list:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"page-or-post-clone": [
|
||||
"cpe:2.3:a:carlosfazenda:page_and_post_clone:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"page-scroll-to-id": [
|
||||
"cpe:2.3:a:page_scroll_to_id_project:page_scroll_to_id:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -13344,9 +13317,6 @@
|
||||
"paypal-donations": [
|
||||
"cpe:2.3:a:tipsandtricks-hq:donations_via_paypal:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"paypal-pay-buy-donation-and-cart-buttons-shortcode": [
|
||||
"cpe:2.3:a:mohsinrasool:paypal_pay_now\\,_buy_now\\,_donation_and_cart_buttons_shortcode:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"paypal-payment-button-by-vcita": [
|
||||
"cpe:2.3:a:vcita:online_payments_-_get_paid_with_paypal\\,_square_\\\u0026_stripe:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -13749,9 +13719,6 @@
|
||||
"postmatic": [
|
||||
"cpe:2.3:a:gopostmatic:replyable:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"posts-and-users-stats": [
|
||||
"cpe:2.3:a:patrick-robrecht:posts_and_user_stats:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"posts-in-page": [
|
||||
"cpe:2.3:a:ivycat:posts_in_page:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -13954,9 +13921,6 @@
|
||||
"pwa-for-wp": [
|
||||
"cpe:2.3:a:magazine3:pwa_for_wp_\\\u0026_amp:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"pz-frontend-manager": [
|
||||
"cpe:2.3:a:projectzealous:pz_frontend_manager:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"pz-linkcard": [
|
||||
"cpe:2.3:a:popozure:pz-linkcard:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -14839,9 +14803,6 @@
|
||||
"simple-cod-fee-for-woocommerce": [
|
||||
"cpe:2.3:a:83pixel:simple_cod_fees_for_woocommerce:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"simple-csv-xls-exporter": [
|
||||
"cpe:2.3:a:shambix:simple_csv\\/xls_exporter:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"simple-custom-author-profiles": [
|
||||
"cpe:2.3:a:usbmemorydirect:simple_custom_author_profiles:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -15564,9 +15525,6 @@
|
||||
"superb-social-share-and-follow-buttons": [
|
||||
"cpe:2.3:a:superbthemes:superb_social_media_share_buttons_and_follow_buttons_for_wordpress:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"supersaas-appointment-scheduling": [
|
||||
"cpe:2.3:a:supersaas:supersaas:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"supportcandy": [
|
||||
"cpe:2.3:a:supportcandy:supportcandy:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -16026,9 +15984,6 @@
|
||||
"typofr": [
|
||||
"cpe:2.3:a:typofr_project:typofr:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"ubermenu": [
|
||||
"cpe:2.3:a:sevenspark:ubermenu:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"ucontext": [
|
||||
"cpe:2.3:a:summitmediaconcepts:ucontext_for_clickbank:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -17682,9 +17637,6 @@
|
||||
"wp-links-page": [
|
||||
"cpe:2.3:a:wplinkspage:wp_links_page:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"wp-lister-for-amazon": [
|
||||
"cpe:2.3:a:wplab:wp-lister_lite_for_amazon:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"wp-lister-for-ebay": [
|
||||
"cpe:2.3:a:wplab:wp-lister_lite_for_ebay:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -17794,9 +17746,6 @@
|
||||
"wp-open-graph": [
|
||||
"cpe:2.3:a:custom4web:wp_open_graph:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"wp-open-street-map": [
|
||||
"cpe:2.3:a:info-d-74:open_street_map:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"wp-opt-in": [
|
||||
"cpe:2.3:a:wp_opt-in_project:wp_opt-in:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
@@ -18376,9 +18325,6 @@
|
||||
"wpematico": [
|
||||
"cpe:2.3:a:etruel:wpematico_rss_feed_fetcher:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"wpextended": [
|
||||
"cpe:2.3:a:wpextended:wp_extended:*:*:*:*:*:wordpress:*:*"
|
||||
],
|
||||
"wpforms": [
|
||||
"cpe:2.3:a:wpforms:wpforms:*:*:*:*:pro:wordpress:*:*"
|
||||
],
|
||||
|
||||
@@ -23,7 +23,6 @@ var (
|
||||
}
|
||||
|
||||
PrimaryJavaManifestGroupIDFields = []string{
|
||||
"Group-Id",
|
||||
"Bundle-SymbolicName",
|
||||
"Extension-Name",
|
||||
"Specification-Vendor",
|
||||
|
||||
@@ -108,7 +108,7 @@ func (a archiveFilename) extension() string {
|
||||
|
||||
func (a archiveFilename) pkgType() pkg.Type {
|
||||
switch strings.ToLower(a.extension()) {
|
||||
case "jar", "war", "ear", "lpkg", "par", "sar", "nar", "kar":
|
||||
case "jar", "war", "ear", "lpkg", "par", "sar", "nar":
|
||||
return pkg.JavaPkg
|
||||
case "jpi", "hpi":
|
||||
return pkg.JenkinsPluginPkg
|
||||
|
||||
@@ -86,13 +86,6 @@ func TestExtractInfoFromJavaArchiveFilename(t *testing.T) {
|
||||
name: "pkg-extra-field-maven",
|
||||
ty: pkg.JavaPkg,
|
||||
},
|
||||
{
|
||||
filename: "pkg-extra-field-maven-4.3.2-rc1.kar",
|
||||
version: "4.3.2-rc1",
|
||||
extension: "kar",
|
||||
name: "pkg-extra-field-maven",
|
||||
ty: pkg.JavaPkg,
|
||||
},
|
||||
{
|
||||
filename: "/some/path/pkg-extra-field-maven-4.3.2-rc1.jpi",
|
||||
version: "4.3.2-rc1",
|
||||
|
||||
@@ -31,7 +31,6 @@ var archiveFormatGlobs = []string{
|
||||
"**/*.nar",
|
||||
"**/*.jpi",
|
||||
"**/*.hpi",
|
||||
"**/*.kar",
|
||||
"**/*.lpkg", // Zip-compressed package used to deploy applications
|
||||
// (aka plugins) to Liferay Portal server. Those files contains .JAR(s) and a .PROPERTIES file, the latter
|
||||
// has information about the application and installation requirements.
|
||||
@@ -155,14 +154,9 @@ func (j *archiveParser) parse(ctx context.Context) ([]pkg.Package, []artifact.Re
|
||||
p := &pkgs[i]
|
||||
if m, ok := p.Metadata.(pkg.JavaArchive); ok {
|
||||
p.PURL = packageURL(p.Name, p.Version, m)
|
||||
|
||||
if strings.Contains(p.PURL, "io.jenkins.plugins") || strings.Contains(p.PURL, "org.jenkins-ci.plugins") {
|
||||
p.Type = pkg.JenkinsPluginPkg
|
||||
}
|
||||
} else {
|
||||
log.WithFields("package", p.String()).Warn("unable to extract java metadata to generate purl")
|
||||
}
|
||||
|
||||
p.SetID()
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ func TestSearchMavenForLicenses(t *testing.T) {
|
||||
// this fixture has a pomProjectObject and has a parent object
|
||||
// it has no licenses on either which is the condition for testing
|
||||
// the searchMavenForLicenses functionality
|
||||
jarName := generateJavaMetadataJarFixture(t, tc.fixture, "jar")
|
||||
jarName := generateJavaMetadataJarFixture(t, tc.fixture)
|
||||
fixture, err := os.Open(jarName)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -1082,7 +1082,6 @@ func Test_parseJavaArchive_regressions(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
fixtureName string
|
||||
fileExtension string
|
||||
expectedPkgs []pkg.Package
|
||||
expectedRelationships []artifact.Relationship
|
||||
assignParent bool
|
||||
@@ -1275,45 +1274,6 @@ func Test_parseJavaArchive_regressions(t *testing.T) {
|
||||
fixtureName: "spring-instrumentation-4.3.0-1.0",
|
||||
expectedPkgs: nil, // we expect no packages to be discovered when Weave-Classes present in the manifest
|
||||
},
|
||||
{
|
||||
name: "Jenkins plugins assigned jenkins-plugin package type",
|
||||
fixtureName: "gradle",
|
||||
fileExtension: "hpi",
|
||||
expectedPkgs: []pkg.Package{
|
||||
{
|
||||
Name: "gradle",
|
||||
Version: "2.11",
|
||||
Type: pkg.JenkinsPluginPkg,
|
||||
Language: pkg.Java,
|
||||
PURL: "pkg:maven/org.jenkins-ci.plugins/gradle@2.11",
|
||||
Locations: file.NewLocationSet(file.NewLocation("test-fixtures/jar-metadata/cache/gradle.hpi")),
|
||||
Metadata: pkg.JavaArchive{
|
||||
VirtualPath: "test-fixtures/jar-metadata/cache/gradle.hpi",
|
||||
Manifest: &pkg.JavaManifest{
|
||||
Main: pkg.KeyValues{
|
||||
{Key: "Manifest-Version", Value: "1.0"},
|
||||
{
|
||||
Key: "Plugin-Dependencies",
|
||||
Value: "maven-plugin:3.14;resolution:=optional...snip",
|
||||
},
|
||||
{Key: "Group-Id", Value: "org.jenkins-ci.plugins"},
|
||||
{Key: "Minimum-Java-Version", Value: "1.8"},
|
||||
{Key: "Short-Name", Value: "gradle"},
|
||||
{Key: "Extension-Name", Value: "gradle"},
|
||||
{Key: "Long-Name", Value: "Gradle Plugin"},
|
||||
{Key: "Jenkins-Version", Value: "2.303.3"},
|
||||
{Key: "Url", Value: "https://github.com/jenkinsci/gradle-plugin"},
|
||||
{Key: "Compatible-Since-Version", Value: "1.0"},
|
||||
{Key: "Plugin-Version", Value: "2.11"},
|
||||
{Key: "Plugin-Developers", Value: "Stefan Wolf:wolfs:"},
|
||||
},
|
||||
},
|
||||
// not under test
|
||||
//ArchiveDigests: []file.Digest{{Algorithm: "sha1", Value: "d8bc1d9c428c96fe447e2c429fc4304d141024df"}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@@ -1325,7 +1285,7 @@ func Test_parseJavaArchive_regressions(t *testing.T) {
|
||||
tt.expectedPkgs[i].SetID()
|
||||
}
|
||||
pkgtest.NewCatalogTester().
|
||||
FromFile(t, generateJavaMetadataJarFixture(t, tt.fixtureName, tt.fileExtension)).
|
||||
FromFile(t, generateJavaMetadataJarFixture(t, tt.fixtureName)).
|
||||
Expects(tt.expectedPkgs, tt.expectedRelationships).
|
||||
WithCompareOptions(
|
||||
cmpopts.IgnoreFields(pkg.JavaArchive{}, "ArchiveDigests"),
|
||||
@@ -1358,7 +1318,7 @@ func Test_deterministicMatchingPomProperties(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.fixture, func(t *testing.T) {
|
||||
fixturePath := generateJavaMetadataJarFixture(t, test.fixture, "jar")
|
||||
fixturePath := generateJavaMetadataJarFixture(t, test.fixture)
|
||||
|
||||
for i := 0; i < 5; i++ {
|
||||
func() {
|
||||
@@ -1412,18 +1372,14 @@ func generateJavaBuildFixture(t *testing.T, fixturePath string) {
|
||||
run(t, cmd)
|
||||
}
|
||||
|
||||
func generateJavaMetadataJarFixture(t *testing.T, fixtureName string, fileExtension string) string {
|
||||
if fileExtension == "" {
|
||||
fileExtension = "jar"
|
||||
}
|
||||
|
||||
fixturePath := filepath.Join("test-fixtures/jar-metadata/cache/", fixtureName+"."+fileExtension)
|
||||
func generateJavaMetadataJarFixture(t *testing.T, fixtureName string) string {
|
||||
fixturePath := filepath.Join("test-fixtures/jar-metadata/cache/", fixtureName+".jar")
|
||||
if _, err := os.Stat(fixturePath); !os.IsNotExist(err) {
|
||||
// fixture already exists...
|
||||
return fixturePath
|
||||
}
|
||||
|
||||
makeTask := filepath.Join("cache", fixtureName+"."+fileExtension)
|
||||
makeTask := filepath.Join("cache", fixtureName+".jar")
|
||||
t.Logf(color.Bold.Sprintf("Generating Fixture from 'make %s'", makeTask))
|
||||
|
||||
cwd, err := os.Getwd()
|
||||
|
||||
@@ -23,7 +23,6 @@ func Test_ArchiveCataloger_Globs(t *testing.T) {
|
||||
"java-archives/example.par",
|
||||
"java-archives/example.sar",
|
||||
"java-archives/example.nar",
|
||||
"java-archives/example.kar",
|
||||
"java-archives/example.jpi",
|
||||
"java-archives/example.hpi",
|
||||
"java-archives/example.lpkg",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
example archive
|
||||
@@ -28,8 +28,3 @@ $(CACHE_DIR)/$(SPRING_INSTRUMENTATION).jar: $(CACHE_DIR)
|
||||
|
||||
$(CACHE_DIR)/$(MULTIPLE_MATCHING).jar: $(CACHE_DIR)
|
||||
cd $(MULTIPLE_MATCHING) && zip -r $(CACHE_PATH)/$(MULTIPLE_MATCHING).jar .
|
||||
|
||||
# Jenkins plugins typically do not have the version included in the archive name,
|
||||
# so it is important to not include it in the generated test fixture
|
||||
$(CACHE_DIR)/gradle.hpi: $(CACHE_DIR)
|
||||
cd jenkins-plugins/gradle/2.11 && zip -r $(CACHE_PATH)/gradle.hpi .
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Plugin-Dependencies: maven-plugin:3.14;resolution:=optional...snip
|
||||
Group-Id: org.jenkins-ci.plugins
|
||||
Minimum-Java-Version: 1.8
|
||||
Short-Name: gradle
|
||||
Extension-Name: gradle
|
||||
Long-Name: Gradle Plugin
|
||||
Jenkins-Version: 2.303.3
|
||||
Url: https://github.com/jenkinsci/gradle-plugin
|
||||
Compatible-Since-Version: 1.0
|
||||
Plugin-Version: 2.11
|
||||
Plugin-Developers: Stefan Wolf:wolfs:
|
||||
|
||||
@@ -178,13 +178,13 @@ func formatNpmRegistryURL(baseURL, packageName, version string) (requestURL stri
|
||||
return requestURL, nil
|
||||
}
|
||||
|
||||
func getLicenseFromNpmRegistry(baseURL, packageName, version string) (string, error) {
|
||||
func getLicenseFromNpmRegistry(basURL, packageName, version string) (string, error) {
|
||||
// "https://registry.npmjs.org/%s/%s", packageName, version
|
||||
requestURL, err := formatNpmRegistryURL(baseURL, packageName, version)
|
||||
requestURL, err := formatNpmRegistryURL(basURL, packageName, version)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("unable to format npm request for pkg:version %s%s; %w", packageName, version, err)
|
||||
}
|
||||
log.WithFields("url", requestURL).Info("downloading javascript package from npm")
|
||||
log.Tracef("trying to fetch remote package %s", requestURL)
|
||||
|
||||
npmRequest, err := http.NewRequest(http.MethodGet, requestURL, nil)
|
||||
if err != nil {
|
||||
|
||||
@@ -643,7 +643,7 @@ func Test_PackageCataloger_SitePackageRelationships(t *testing.T) {
|
||||
// Note: we'll only see new relationships, so any relationship where there is at least one new player (in FROM or TO)
|
||||
"blessed @ 1.20.0 (/usr/local/lib/python3.9/dist-packages) [dependency-of] inquirer @ 3.0.0 (/app/project1/venv/lib/python3.9/site-packages)", // note: depends on global site package!
|
||||
"python-editor @ 1.0.4 (/usr/local/lib/python3.9/dist-packages) [dependency-of] inquirer @ 3.0.0 (/app/project1/venv/lib/python3.9/site-packages)", // note: depends on global site package!
|
||||
"readchar @ 4.2.0 (/app/project1/venv/lib/python3.9/site-packages) [dependency-of] inquirer @ 3.0.0 (/app/project1/venv/lib/python3.9/site-packages)",
|
||||
"readchar @ 4.1.0 (/app/project1/venv/lib/python3.9/site-packages) [dependency-of] inquirer @ 3.0.0 (/app/project1/venv/lib/python3.9/site-packages)",
|
||||
"soupsieve @ 2.3 (/app/project1/venv/lib/python3.9/site-packages) [dependency-of] beautifulsoup4 @ 4.10.0 (/app/project1/venv/lib/python3.9/site-packages)",
|
||||
|
||||
// project 2 virtual env
|
||||
|
||||
@@ -17,7 +17,7 @@ RUN python3.9 -m pip install requests==2.25.0 certifi==2020.12.5 chardet==3.0.4
|
||||
RUN python3.8 -m pip install click==8.0.2 beautifulsoup4==4.9.2 soupsieve==2.2.0 requests==2.25.0
|
||||
RUN python3.8 -m pip install runs==1.2.2 xmod==1.8.1 # partial dependencies for inquirer in project2 (which is a red herring)
|
||||
RUN python3.8 -m pip install requests==2.25.0 certifi==2020.12.5 chardet==3.0.4 idna==2.10 urllib3==1.26.18 # total dependencies for requests
|
||||
RUN python3.8 -m pip install readchar==4.2.0
|
||||
RUN python3.8 -m pip install readchar==4.1.0
|
||||
|
||||
# create directories for the two projects
|
||||
RUN mkdir -p /app/project1 /app/project2
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/anchore/syft/syft/format/cyclonedxjson"
|
||||
)
|
||||
|
||||
// We have schema validation mechanisms in schema/cyclonedx/
|
||||
// We have schema validation mechanims in schema/cyclonedx/
|
||||
// This test allows us to double check that validation against the cyclonedx-cli tool
|
||||
func TestValidCycloneDX(t *testing.T) {
|
||||
imageFixture := func(t *testing.T) string {
|
||||
|
||||
Reference in New Issue
Block a user