diff --git a/.bouncer.yaml b/.bouncer.yaml index fe3f9713f14d..b27baa6eab27 100644 --- a/.bouncer.yaml +++ b/.bouncer.yaml @@ -11,6 +11,10 @@ ignore-packages: # packageurl-go is released under the MIT license located in the root of the repo at /mit.LICENSE - github.com/anchore/packageurl-go + # both of these dependencies are specified as Apache-2.0 in their respective GitHub READMEs + - github.com/alibabacloud-go/cr-20160607/client + - github.com/alibabacloud-go/tea-xml/service + # crypto/internal/boring is released under the openSSL license as a part of the Golang Standard Libary - crypto/internal/boring diff --git a/.github/workflows/update-bootstrap-tools.yml b/.github/workflows/update-bootstrap-tools.yml index 8d46bce6d6c8..947fb2fd0681 100644 --- a/.github/workflows/update-bootstrap-tools.yml +++ b/.github/workflows/update-bootstrap-tools.yml @@ -26,6 +26,7 @@ jobs: BOUNCER_LATEST_VERSION=$(go list -m -json github.com/wagoodman/go-bouncer@latest 2>/dev/null | jq -r '.Version') CHRONICLE_LATEST_VERSION=$(go list -m -json github.com/anchore/chronicle@latest 2>/dev/null | jq -r '.Version') GORELEASER_LATEST_VERSION=$(go list -m -json github.com/goreleaser/goreleaser@latest 2>/dev/null | jq -r '.Version') + GOSIMPORTS_LATEST_VERSION=$(go list -m -json github.com/rinchsan/gosimports@latest 2>/dev/null | jq -r '.Version') YAJSV_LATEST_VERSION=$(go list -m -json github.com/neilpa/yajsv@latest 2>/dev/null | jq -r '.Version') COSIGN_LATEST_VERSION=$(go list -m -json github.com/sigstore/cosign@latest 2>/dev/null | jq -r '.Version') @@ -34,6 +35,7 @@ jobs: sed -r -i -e 's/^(BOUNCER_VERSION = ).*/\1'${BOUNCER_LATEST_VERSION}'/' Makefile sed -r -i -e 's/^(CHRONICLE_VERSION = ).*/\1'${CHRONICLE_LATEST_VERSION}'/' Makefile sed -r -i -e 's/^(GORELEASER_VERSION = ).*/\1'${GORELEASER_LATEST_VERSION}'/' Makefile + sed -r -i -e 's/^(GOSIMPORTS_VERSION = ).*/\1'${GOSIMPORTS_LATEST_VERSION}'/' Makefile sed -r -i -e 's/^(YAJSV_VERSION = ).*/\1'${YAJSV_LATEST_VERSION}'/' Makefile sed -r -i -e 's/^(COSIGN_VERSION = ).*/\1'${COSIGN_LATEST_VERSION}'/' Makefile @@ -46,6 +48,7 @@ jobs: echo "::set-output name=BOUNCER::$BOUNCER_LATEST_VERSION" echo "::set-output name=CHRONICLE::$CHRONICLE_LATEST_VERSION" echo "::set-output name=GORELEASER::$GORELEASER_LATEST_VERSION" + echo "::set-output name=GOSIMPORTS::$GOSIMPORTS_LATEST_VERSION" echo "::set-output name=YAJSV::$YAJSV_LATEST_VERSION" echo "::set-output name=COSIGN::$COSIGN_LATEST_VERSION" id: latest-versions @@ -69,6 +72,7 @@ jobs: - [bouncer ${{ steps.latest-versions.outputs.BOUNCER }}](https://github.com/wagoodman/go-bouncer/releases/tag/${{ steps.latest-versions.outputs.BOUNCER }}) - [chronicle ${{ steps.latest-versions.outputs.CHRONICLE }}](https://github.com/anchore/chronicle/releases/tag/${{ steps.latest-versions.outputs.CHRONICLE }}) - [goreleaser ${{ steps.latest-versions.outputs.GORELEASER }}](https://github.com/goreleaser/goreleaser/releases/tag/${{ steps.latest-versions.outputs.GORELEASER }}) + - [gosimports ${{ steps.latest-versions.outputs.GOSIMPORTS }}](https://github.com/rinchsan/gosimports/releases/tag/${{ steps.latest-versions.outputs.GOSIMPORTS }}) - [yajsv ${{ steps.latest-versions.outputs.YAJSV }}](https://github.com/neilpa/yajsv/releases/tag/${{ steps.latest-versions.outputs.YAJSV }}) - [cosign ${{ steps.latest-versions.outputs.COSIGN }}](https://github.com/sigstore/cosign/releases/tag/${{ steps.latest-versions.outputs.COSIGN }}) This is an auto-generated pull request to update all of the bootstrap tools to the latest versions. diff --git a/.golangci.yaml b/.golangci.yaml index 536445ff8b49..a07f7b91969b 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -10,7 +10,6 @@ linters: enable: - asciicheck - bodyclose - - deadcode - depguard - dogsled - dupl @@ -22,7 +21,6 @@ linters: - gocritic - gocyclo - gofmt - - goimports - goprintffuncname - gosec - gosimple @@ -32,23 +30,22 @@ linters: - nakedret - nolintlint - revive - - rowserrcheck - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - unused - - varcheck - whitespace # do not enable... # - gochecknoglobals # - gochecknoinits # this is too aggressive +# - rowserrcheck disabled per generics https://github.com/golangci/golangci-lint/issues/2649 # - godot # - godox # - goerr113 +# - goimports # we're using gosimports now instead to account for extra whitespaces (see https://github.com/golang/go/issues/20818) # - golint # deprecated # - gomnd # this is too aggressive # - interfacer # this is a good idea, but is no longer supported and is prone to false positives diff --git a/DEVELOPING.md b/DEVELOPING.md index f12462ab4ef6..c30497100def 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -6,11 +6,38 @@ In order to test and develop in this repo you will need the following dependenci - docker - make -After cloning do the following: +After cloning the following step can help you get setup: 1. run `make bootstrap` to download go mod dependencies, create the `/.tmp` dir, and download helper utilities. -2. run `make` to run linting, tests, and other verifications to make certain everything is working alright. +2. run `make` to view the selection of developer commands in the Makefile +3. run `make build` to build the release snapshot binaries and packages +4. for an even quicker start you can run `go run cmd/syft/main.go` to print the syft help. + - this command `go run cmd/syft/main.go alpine:latest` will compile and run syft against `alpine:latest` +5. view the README or syft help output for more output options -Checkout `make help` to see what other actions you can take. +#### Make output +``` +all Run all linux-based checks (linting, license check, unit, integration, and linux compare tests) +benchmark Run benchmark tests and compare against the baseline (if available) +bootstrap Download and install all tooling dependencies (+ prep tooling in the ./tmp dir) +build Build release snapshot binaries and packages +check-licenses Ensure transitive dependencies are compliant with the current license policy +clean-test-image-cache Clean test image cache +clean Remove previous builds, result reports, and test cache +cli Run CLI tests +compare-linux Run compare tests on build snapshot binaries and packages (Linux) +compare-mac Run compare tests on build snapshot binaries and packages (Mac) +generate-json-schema Generate a new json schema +generate-license-list Generate an updated spdx license list +help Display this help +integration Run integration tests +lint-fix Auto-format all source code + run golangci lint fixers +lint Run gofmt + golangci lint checks +show-test-image-cache Show all docker and image tar cache +show-test-snapshots Show all test snapshots +snapshot-with-signing Build snapshot release binaries and packages (with dummy signing) +test Run all tests (currently unit, integration, linux compare, and cli tests) +unit Run unit tests (with coverage) +``` The main make tasks for common static analysis and testing are `lint`, `lint-fix`, `unit`, `integration`, and `cli`. @@ -176,4 +203,4 @@ TODO: outline: - source.Source - file.Resolvers - logger abstraction -- events / bus abstraction \ No newline at end of file +- events / bus abstraction diff --git a/Makefile b/Makefile index f7091a648313..ef4d296d7e1d 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,19 @@ BIN = syft +VERSION=$(shell git describe --dirty --always --tags) TEMPDIR = ./.tmp -RESULTSDIR = test/results -COVER_REPORT = $(RESULTSDIR)/unit-coverage-details.txt -COVER_TOTAL = $(RESULTSDIR)/unit-coverage-summary.txt -LINTCMD = $(TEMPDIR)/golangci-lint run --tests=false --timeout=4m --config .golangci.yaml + +# commands and versions +LINTCMD = $(TEMPDIR)/golangci-lint run --tests=false --timeout=5m --config .golangci.yaml +GOIMPORTS_CMD = $(TEMPDIR)/gosimports -local github.com/anchore RELEASE_CMD=$(TEMPDIR)/goreleaser release --rm-dist SNAPSHOT_CMD=$(RELEASE_CMD) --skip-publish --snapshot -VERSION=$(shell git describe --dirty --always --tags) -COMPARE_TEST_IMAGE = centos:8.2.2004 -COMPARE_DIR = ./test/compare GOLANGCILINT_VERSION = v1.49.0 +GOSIMPORTS_VERSION = v0.3.1 BOUNCER_VERSION = v0.4.0 CHRONICLE_VERSION = v0.4.1 GORELEASER_VERSION = v1.11.2 YAJSV_VERSION = v1.4.0 -COSIGN_VERSION = v1.11.1 +COSIGN_VERSION = v1.12.0 # formatting variables BOLD := $(shell tput -T linux bold) @@ -26,6 +25,12 @@ RESET := $(shell tput -T linux sgr0) TITLE := $(BOLD)$(PURPLE) SUCCESS := $(BOLD)$(GREEN) +# test variables +RESULTSDIR = test/results +COMPARE_DIR = ./test/compare +COMPARE_TEST_IMAGE = centos:8.2.2004 +COVER_REPORT = $(RESULTSDIR)/unit-coverage-details.txt +COVER_TOTAL = $(RESULTSDIR)/unit-coverage-summary.txt # the quality gate lower threshold for unit test total % coverage (by function statements) COVERAGE_THRESHOLD := 62 @@ -41,7 +46,6 @@ OS=$(shell uname | tr '[:upper:]' '[:lower:]') SNAPSHOT_BIN=$(realpath $(shell pwd)/$(SNAPSHOTDIR)/$(OS)-build_$(OS)_amd64_v1/$(BIN)) ## Variable assertions - ifndef TEMPDIR $(error TEMPDIR is not set) endif @@ -82,6 +86,9 @@ define safe_rm_rf_children bash -c 'test -z "$(1)" && false || rm -rf $(1)/*' endef +## Default Task +.DEFAULT_GOAL:=help + ## Tasks .PHONY: all @@ -91,10 +98,6 @@ all: clean static-analysis test ## Run all linux-based checks (linting, license .PHONY: test test: unit validate-cyclonedx-schema integration benchmark compare-linux cli ## Run all tests (currently unit, integration, linux compare, and cli tests) -.PHONY: help -help: - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(BOLD)$(CYAN)%-25s$(RESET)%s\n", $$1, $$2}' - .PHONY: ci-bootstrap ci-bootstrap: DEBIAN_FRONTEND=noninteractive sudo apt update && sudo -E apt install -y bc jq libxml2-utils @@ -116,6 +119,8 @@ bootstrap-tools: $(TEMPDIR) curl -sSfL https://raw.githubusercontent.com/wagoodman/go-bouncer/master/bouncer.sh | sh -s -- -b $(TEMPDIR)/ $(BOUNCER_VERSION) curl -sSfL https://raw.githubusercontent.com/anchore/chronicle/main/install.sh | sh -s -- -b $(TEMPDIR)/ $(CHRONICLE_VERSION) .github/scripts/goreleaser-install.sh -d -b $(TEMPDIR)/ $(GORELEASER_VERSION) + # the only difference between goimports and gosimports is that gosimports removes extra whitespace between import blocks (see https://github.com/golang/go/issues/20818) + GOBIN="$(realpath $(TEMPDIR))" go install github.com/rinchsan/gosimports/cmd/gosimports@$(GOSIMPORTS_VERSION) GOBIN="$(realpath $(TEMPDIR))" go install github.com/neilpa/yajsv@$(YAJSV_VERSION) GOBIN="$(realpath $(TEMPDIR))" go install github.com/sigstore/cosign/cmd/cosign@$(COSIGN_VERSION) @@ -124,7 +129,7 @@ bootstrap-go: go mod download .PHONY: bootstrap -bootstrap: $(RESULTSDIR) bootstrap-go bootstrap-tools ## Download and install all go dependencies (+ prep tooling in the ./tmp dir) +bootstrap: $(RESULTSDIR) bootstrap-go bootstrap-tools ## Download and install all tooling dependencies (+ prep tooling in the ./tmp dir) $(call title,Bootstrapping dependencies) .PHONY: static-analysis @@ -139,6 +144,7 @@ lint: ## Run gofmt + golangci lint checks # run all golangci-lint rules $(LINTCMD) + @[ -z "$(shell $(GOIMPORTS_CMD) -d .)" ] || (echo "goimports needs to be fixed" && false) # go tooling does not play well with certain filename characters, ensure the common cases don't result in future "go get" failures $(eval MALFORMED_FILENAMES := $(shell find . | grep -e ':')) @@ -148,6 +154,7 @@ lint: ## Run gofmt + golangci lint checks lint-fix: ## Auto-format all source code + run golangci lint fixers $(call title,Running lint fixers) gofmt -w -s . + $(GOIMPORTS_CMD) -w . $(LINTCMD) --fix go mod tidy @@ -344,7 +351,7 @@ CHANGELOG.md: $(TEMPDIR)/chronicle -vv > CHANGELOG.md .PHONY: release -release: clean-dist CHANGELOG.md ## Build and publish final binaries and packages. Intended to be run only on macOS. +release: clean-dist CHANGELOG.md $(call title,Publishing release artifacts) # create a config with the dist dir overridden @@ -398,14 +405,16 @@ clean-dist: clean-changelog clean-changelog: rm -f CHANGELOG.md -clean-test-image-cache: clean-test-image-tar-cache clean-test-image-docker-cache +clean-test-image-cache: clean-test-image-tar-cache clean-test-image-docker-cache ## Clean test image cache .PHONY: clear-test-image-tar-cache -clean-test-image-tar-cache: ## Delete all test cache (built docker image tars) +clean-test-image-tar-cache: + ## Delete all test cache (built docker image tars) find . -type f -wholename "**/test-fixtures/cache/stereoscope-fixture-*.tar" -delete .PHONY: clear-test-image-docker-cache -clean-test-image-docker-cache: ## Purge all test docker images +clean-test-image-docker-cache: + ## Purge all test docker images docker images --format '{{.ID}} {{.Repository}}' | grep stereoscope-fixture- | awk '{print $$1}' | uniq | xargs -r docker rmi --force .PHONY: show-test-image-cache @@ -420,3 +429,7 @@ show-test-image-cache: ## Show all docker and image tar cache show-test-snapshots: ## Show all test snapshots $(call title,Test snapshots) @find . -type f -wholename "**/test-fixtures/snapshot/*" | sort + +.PHONY: help +help: ## Display this help + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(BOLD)$(CYAN)%-25s$(RESET)%s\n", $$1, $$2}' diff --git a/README.md b/README.md index 0d8110eae6d6..235285ef8a47 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ For commercial support options with Syft or Grype, please [contact Anchore](http ## Features - Generates SBOMs for container images, filesystems, archives, and more to discover packages and libraries -- Supports OCI and Docker image formats +- Supports OCI, Docker and [Singularity](https://github.com/sylabs/singularity) image formats - Linux distribution identification - Works seamlessly with [Grype](https://github.com/anchore/grype) (a fast, modern vulnerability scanner) - Able to create signed SBOM attestations using the [in-toto specification](https://github.com/in-toto/attestation/blob/main/spec/README.md) @@ -119,6 +119,9 @@ Syft can generate a SBOM from a variety of sources: # catalog a container image archive (from the result of `docker image save ...`, `podman save ...`, or `skopeo copy` commands) syft path/to/image.tar +# catalog a Singularity Image Format (SIF) container +syft path/to/image.sif + # catalog a directory syft path/to/dir ``` diff --git a/cmd/syft/cli/attest.go b/cmd/syft/cli/attest.go index e102144d2b62..91feb929a423 100644 --- a/cmd/syft/cli/attest.go +++ b/cmd/syft/cli/attest.go @@ -4,14 +4,14 @@ import ( "fmt" "log" + sigopts "github.com/sigstore/cosign/cmd/cosign/cli/options" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/anchore/syft/cmd/syft/cli/attest" "github.com/anchore/syft/cmd/syft/cli/options" "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/config" - "github.com/spf13/cobra" - "github.com/spf13/viper" - - sigopts "github.com/sigstore/cosign/cmd/cosign/cli/options" ) const ( diff --git a/cmd/syft/cli/attest/attest.go b/cmd/syft/cli/attest/attest.go index d0d6d0d16252..6758edb28678 100644 --- a/cmd/syft/cli/attest/attest.go +++ b/cmd/syft/cli/attest/attest.go @@ -7,24 +7,6 @@ import ( "fmt" "os" - "github.com/wagoodman/go-progress" - - "github.com/anchore/stereoscope" - "github.com/anchore/stereoscope/pkg/image" - "github.com/anchore/syft/cmd/syft/cli/eventloop" - "github.com/anchore/syft/cmd/syft/cli/options" - "github.com/anchore/syft/cmd/syft/cli/packages" - "github.com/anchore/syft/internal/bus" - "github.com/anchore/syft/internal/config" - "github.com/anchore/syft/internal/formats/cyclonedxjson" - "github.com/anchore/syft/internal/formats/spdx22json" - "github.com/anchore/syft/internal/formats/syftjson" - "github.com/anchore/syft/internal/log" - "github.com/anchore/syft/internal/ui" - "github.com/anchore/syft/syft" - "github.com/anchore/syft/syft/event" - "github.com/anchore/syft/syft/sbom" - "github.com/anchore/syft/syft/source" "github.com/google/go-containerregistry/pkg/name" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/in-toto/in-toto-golang/in_toto" @@ -43,9 +25,26 @@ import ( "github.com/sigstore/rekor/pkg/generated/client" "github.com/sigstore/rekor/pkg/generated/models" "github.com/sigstore/sigstore/pkg/signature/dsse" + signatureoptions "github.com/sigstore/sigstore/pkg/signature/options" "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" - signatureoptions "github.com/sigstore/sigstore/pkg/signature/options" + "github.com/anchore/stereoscope" + "github.com/anchore/stereoscope/pkg/image" + "github.com/anchore/syft/cmd/syft/cli/eventloop" + "github.com/anchore/syft/cmd/syft/cli/options" + "github.com/anchore/syft/cmd/syft/cli/packages" + "github.com/anchore/syft/internal/bus" + "github.com/anchore/syft/internal/config" + "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/internal/ui" + "github.com/anchore/syft/syft" + "github.com/anchore/syft/syft/event" + "github.com/anchore/syft/syft/formats/cyclonedxjson" + "github.com/anchore/syft/syft/formats/spdx22json" + "github.com/anchore/syft/syft/formats/syftjson" + "github.com/anchore/syft/syft/sbom" + "github.com/anchore/syft/syft/source" ) var ( @@ -71,7 +70,14 @@ func Run(ctx context.Context, app *config.Application, ko sigopts.KeyOpts, args return err } - format := syft.FormatByName(app.Outputs[0]) + output := parseAttestationOutput(app.Outputs) + + format := syft.FormatByName(output) + + // user typo or unknown outputs provided + if format == nil { + format = syft.FormatByID(syftjson.ID) // default attestation format + } predicateType := formatPredicateType(format) if predicateType == "" { return fmt.Errorf( @@ -110,6 +116,14 @@ func Run(ctx context.Context, app *config.Application, ko sigopts.KeyOpts, args ) } +func parseAttestationOutput(outputs []string) (format string) { + if len(outputs) == 0 { + outputs = append(outputs, string(syftjson.ID)) + } + + return outputs[0] +} + func parseImageSource(userInput string, app *config.Application) (s *source.Input, err error) { si, err := source.ParseInput(userInput, app.Platform, false) if err != nil { diff --git a/cmd/syft/cli/attest/password.go b/cmd/syft/cli/attest/password.go index 89520a0e90bb..c65367931111 100644 --- a/cmd/syft/cli/attest/password.go +++ b/cmd/syft/cli/attest/password.go @@ -7,9 +7,10 @@ import ( "os" "strings" + "github.com/sigstore/cosign/pkg/cosign" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/log" - "github.com/sigstore/cosign/pkg/cosign" ) func selectPassFunc(keypath, password string) (cosign.PassFunc, error) { diff --git a/cmd/syft/cli/commands.go b/cmd/syft/cli/commands.go index d1adaff78fea..17d38fd8ef4c 100644 --- a/cmd/syft/cli/commands.go +++ b/cmd/syft/cli/commands.go @@ -4,22 +4,22 @@ import ( "fmt" "strings" - "github.com/anchore/stereoscope" - "github.com/anchore/syft/internal/logger" - "github.com/anchore/syft/syft" + cranecmd "github.com/google/go-containerregistry/cmd/crane/cmd" + "github.com/gookit/color" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/wagoodman/go-partybus" + "github.com/anchore/stereoscope" "github.com/anchore/syft/cmd/syft/cli/options" "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/config" "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/internal/logger" "github.com/anchore/syft/internal/version" + "github.com/anchore/syft/syft" "github.com/anchore/syft/syft/event" - cranecmd "github.com/google/go-containerregistry/cmd/crane/cmd" - "github.com/gookit/color" - "github.com/spf13/cobra" - "github.com/spf13/viper" - "github.com/wagoodman/go-partybus" ) const indent = " " diff --git a/cmd/syft/cli/convert.go b/cmd/syft/cli/convert.go index 51e46e75df44..a2bf4c737496 100644 --- a/cmd/syft/cli/convert.go +++ b/cmd/syft/cli/convert.go @@ -4,12 +4,13 @@ import ( "fmt" "log" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/anchore/syft/cmd/syft/cli/convert" "github.com/anchore/syft/cmd/syft/cli/options" "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/config" - "github.com/spf13/cobra" - "github.com/spf13/viper" ) const ( diff --git a/cmd/syft/cli/eventloop/event_loop.go b/cmd/syft/cli/eventloop/event_loop.go index 396dd74919f9..e86464b0f90e 100644 --- a/cmd/syft/cli/eventloop/event_loop.go +++ b/cmd/syft/cli/eventloop/event_loop.go @@ -5,10 +5,11 @@ import ( "fmt" "os" - "github.com/anchore/syft/internal/log" - "github.com/anchore/syft/internal/ui" "github.com/hashicorp/go-multierror" "github.com/wagoodman/go-partybus" + + "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/internal/ui" ) // eventLoop listens to worker errors (from execution path), worker events (from a partybus subscription), and diff --git a/cmd/syft/cli/eventloop/event_loop_test.go b/cmd/syft/cli/eventloop/event_loop_test.go index d2a12fd52af1..2b76bcb65bc4 100644 --- a/cmd/syft/cli/eventloop/event_loop_test.go +++ b/cmd/syft/cli/eventloop/event_loop_test.go @@ -7,11 +7,12 @@ import ( "testing" "time" - "github.com/anchore/syft/internal/ui" - "github.com/anchore/syft/syft/event" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/wagoodman/go-partybus" + + "github.com/anchore/syft/internal/ui" + "github.com/anchore/syft/syft/event" ) var _ ui.UI = (*uiMock)(nil) diff --git a/cmd/syft/cli/options/packages.go b/cmd/syft/cli/options/packages.go index 8891f814e918..d6783bf6f27d 100644 --- a/cmd/syft/cli/options/packages.go +++ b/cmd/syft/cli/options/packages.go @@ -3,13 +3,14 @@ package options import ( "fmt" - "github.com/anchore/syft/internal/formats/table" - "github.com/anchore/syft/syft" - "github.com/anchore/syft/syft/pkg/cataloger" - "github.com/anchore/syft/syft/source" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" + + "github.com/anchore/syft/syft" + "github.com/anchore/syft/syft/formats/table" + "github.com/anchore/syft/syft/pkg/cataloger" + "github.com/anchore/syft/syft/source" ) type PackagesOptions struct { diff --git a/cmd/syft/cli/options/writer.go b/cmd/syft/cli/options/writer.go index 2b28dd97a690..d93e1db037e7 100644 --- a/cmd/syft/cli/options/writer.go +++ b/cmd/syft/cli/options/writer.go @@ -4,11 +4,12 @@ import ( "fmt" "strings" - "github.com/anchore/syft/internal/formats/table" - "github.com/anchore/syft/internal/formats/template" + "github.com/hashicorp/go-multierror" + "github.com/anchore/syft/syft" + "github.com/anchore/syft/syft/formats/table" + "github.com/anchore/syft/syft/formats/template" "github.com/anchore/syft/syft/sbom" - "github.com/hashicorp/go-multierror" ) // makeWriter creates a sbom.Writer for output or returns an error. this will either return a valid writer diff --git a/cmd/syft/cli/packages.go b/cmd/syft/cli/packages.go index c7aa6f35cc68..2b6fd69b689f 100644 --- a/cmd/syft/cli/packages.go +++ b/cmd/syft/cli/packages.go @@ -4,13 +4,13 @@ import ( "fmt" "log" - "github.com/anchore/syft/cmd/syft/cli/options" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/anchore/syft/cmd/syft/cli/options" "github.com/anchore/syft/cmd/syft/cli/packages" "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/config" - "github.com/spf13/cobra" - "github.com/spf13/viper" ) const ( @@ -25,12 +25,12 @@ const ( Supports the following image sources: {{.appName}} {{.command}} yourrepo/yourimage:tag defaults to using images from a Docker daemon. If Docker is not present, the image is pulled directly from the registry. - {{.appName}} {{.command}} path/to/a/file/or/dir a Docker tar, OCI tar, OCI directory, or generic filesystem directory + {{.appName}} {{.command}} path/to/a/file/or/dir a Docker tar, OCI tar, OCI directory, SIF container, or generic filesystem directory ` schemeHelpHeader = "You can also explicitly specify the scheme to use:" imageSchemeHelp = ` {{.appName}} {{.command}} docker:yourrepo/yourimage:tag explicitly use the Docker daemon - {{.appName}} {{.command}} podman:yourrepo/yourimage:tag explicitly use the Podman daemon + {{.appName}} {{.command}} podman:yourrepo/yourimage:tag explicitly use the Podman daemon {{.appName}} {{.command}} registry:yourrepo/yourimage:tag pull image directly from a registry (no container runtime required) {{.appName}} {{.command}} docker-archive:path/to/yourimage.tar use a tarball from disk for archives created from "docker save" {{.appName}} {{.command}} oci-archive:path/to/yourimage.tar use a tarball from disk for OCI archives (from Skopeo or otherwise) diff --git a/cmd/syft/cli/packages/packages.go b/cmd/syft/cli/packages/packages.go index 0914b186c685..40681b944dba 100644 --- a/cmd/syft/cli/packages/packages.go +++ b/cmd/syft/cli/packages/packages.go @@ -3,9 +3,11 @@ package packages import ( "context" "fmt" - "io/ioutil" + "io" "os" + "github.com/wagoodman/go-partybus" + "github.com/anchore/stereoscope" "github.com/anchore/syft/cmd/syft/cli/eventloop" "github.com/anchore/syft/cmd/syft/cli/options" @@ -13,16 +15,15 @@ import ( "github.com/anchore/syft/internal/anchore" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/config" - "github.com/anchore/syft/internal/formats/template" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/internal/ui" "github.com/anchore/syft/internal/version" "github.com/anchore/syft/syft" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/event" + "github.com/anchore/syft/syft/formats/template" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/wagoodman/go-partybus" ) func Run(ctx context.Context, app *config.Application, args []string) error { @@ -161,7 +162,7 @@ func runPackageSbomUpload(src *source.Source, s sbom.SBOM, app *config.Applicati return fmt.Errorf("unable to open dockerfile=%q: %w", app.Anchore.Dockerfile, err) } - dockerfileContents, err = ioutil.ReadAll(fh) + dockerfileContents, err = io.ReadAll(fh) if err != nil { return fmt.Errorf("unable to read dockerfile=%q: %w", app.Anchore.Dockerfile, err) } diff --git a/cmd/syft/cli/poweruser.go b/cmd/syft/cli/poweruser.go index 65d4cc6bffc2..f02b85e98e68 100644 --- a/cmd/syft/cli/poweruser.go +++ b/cmd/syft/cli/poweruser.go @@ -3,12 +3,13 @@ package cli import ( "fmt" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/anchore/syft/cmd/syft/cli/options" "github.com/anchore/syft/cmd/syft/cli/poweruser" "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/config" - "github.com/spf13/cobra" - "github.com/spf13/viper" ) const powerUserExample = ` {{.appName}} {{.command}} diff --git a/cmd/syft/cli/poweruser/poweruser.go b/cmd/syft/cli/poweruser/poweruser.go index 1908a1650b5f..9c773596404f 100644 --- a/cmd/syft/cli/poweruser/poweruser.go +++ b/cmd/syft/cli/poweruser/poweruser.go @@ -5,6 +5,9 @@ import ( "fmt" "os" + "github.com/gookit/color" + "github.com/wagoodman/go-partybus" + "github.com/anchore/stereoscope" "github.com/anchore/syft/cmd/syft/cli/eventloop" "github.com/anchore/syft/cmd/syft/cli/options" @@ -12,17 +15,15 @@ import ( "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/config" - "github.com/anchore/syft/internal/formats/syftjson" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/internal/ui" "github.com/anchore/syft/internal/version" "github.com/anchore/syft/syft" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/event" + "github.com/anchore/syft/syft/formats/syftjson" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/gookit/color" - "github.com/wagoodman/go-partybus" ) func Run(ctx context.Context, app *config.Application, args []string) error { diff --git a/cmd/syft/cli/version.go b/cmd/syft/cli/version.go index 078fb0057816..b644577ffcf4 100644 --- a/cmd/syft/cli/version.go +++ b/cmd/syft/cli/version.go @@ -6,12 +6,13 @@ import ( "log" "os" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "github.com/anchore/syft/cmd/syft/cli/options" "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/config" "github.com/anchore/syft/internal/version" - "github.com/spf13/cobra" - "github.com/spf13/viper" ) func Version(v *viper.Viper, app *config.Application) *cobra.Command { diff --git a/go.mod b/go.mod index 11b64061b497..f14deab86549 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/facebookincubator/nvdtools v0.1.4 github.com/go-test/deep v1.0.8 - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 github.com/google/uuid v1.3.0 github.com/gookit/color v1.4.2 github.com/hashicorp/go-multierror v1.1.1 @@ -39,7 +39,7 @@ require ( github.com/spf13/afero v1.8.2 github.com/spf13/cobra v1.5.0 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.12.0 + github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.0 github.com/vifraa/gopom v0.1.0 github.com/wagoodman/go-partybus v0.0.0-20210627031916-db1f5573bbc5 @@ -48,7 +48,7 @@ require ( github.com/x-cray/logrus-prefixed-formatter v0.5.2 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 - golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 + golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 gopkg.in/yaml.v2 v2.4.0 ) @@ -61,9 +61,9 @@ require ( github.com/in-toto/in-toto-golang v0.3.4-0.20220709202702-fa494aaa0add github.com/knqyf263/go-rpmdb v0.0.0-20220629110411-9a3bd2ebb923 github.com/sassoftware/go-rpmutils v0.2.0 - github.com/sigstore/cosign v1.11.1 + github.com/sigstore/cosign v1.12.0 github.com/sigstore/rekor v0.11.0 - github.com/sigstore/sigstore v1.4.0 + github.com/sigstore/sigstore v1.4.1-0.20220908204944-ec922cf4f1c2 github.com/vbatts/go-mtree v0.5.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -71,6 +71,7 @@ require ( require ( bitbucket.org/creachadair/shell v0.0.7 // indirect cloud.google.com/go/compute v1.7.0 // indirect + github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0 // indirect github.com/Azure/azure-sdk-for-go v66.0.0+incompatible // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest v0.11.28 // indirect @@ -85,20 +86,32 @@ require ( github.com/Masterminds/semver/v3 v3.1.1 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect github.com/ThalesIgnite/crypto11 v1.2.5 // indirect + github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 // indirect + github.com/alibabacloud-go/cr-20160607 v1.0.1 // indirect + github.com/alibabacloud-go/cr-20181201 v1.0.10 // indirect + github.com/alibabacloud-go/darabonba-openapi v0.1.18 // indirect + github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect + github.com/alibabacloud-go/endpoint-util v1.1.1 // indirect + github.com/alibabacloud-go/openapi-util v0.0.11 // indirect + github.com/alibabacloud-go/tea v1.1.18 // indirect + github.com/alibabacloud-go/tea-utils v1.4.4 // indirect + github.com/alibabacloud-go/tea-xml v1.1.2 // indirect + github.com/aliyun/credentials-go v1.2.3 // indirect github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect - github.com/aws/aws-sdk-go-v2 v1.16.11 // indirect - github.com/aws/aws-sdk-go-v2/config v1.17.1 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.12.14 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 // indirect + github.com/aws/aws-sdk-go-v2 v1.16.14 // indirect + github.com/aws/aws-sdk-go-v2/config v1.17.5 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.18 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.15 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.22 // indirect github.com/aws/aws-sdk-go-v2/service/ecr v1.15.0 // indirect github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.12.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 // indirect - github.com/aws/smithy-go v1.12.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.15 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.21 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.17 // indirect + github.com/aws/smithy-go v1.13.2 // indirect github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04 // indirect github.com/benbjohnson/clock v1.1.0 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -108,12 +121,13 @@ require ( github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/chrismellard/docker-credential-acr-env v0.0.0-20220119192733-fe33c00cee21 // indirect + github.com/clbanning/mxj/v2 v2.5.6 // indirect github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490 // indirect github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect github.com/containerd/containerd v1.5.13 // indirect github.com/containerd/stargz-snapshotter/estargz v0.12.0 // indirect - github.com/coreos/go-oidc/v3 v3.2.0 // indirect + github.com/coreos/go-oidc/v3 v3.3.0 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect @@ -201,12 +215,13 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mozillazg/docker-credential-acr-helper v0.3.0 // indirect github.com/nwaples/rardecode v1.1.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.13.0 // indirect @@ -228,15 +243,16 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spiffe/go-spiffe/v2 v2.1.1 // indirect github.com/stretchr/objx v0.4.0 // indirect - github.com/subosito/gotenv v1.3.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect github.com/sylabs/sif/v2 v2.7.2 // indirect github.com/sylabs/squashfs v0.6.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tent/canonical-json-go v0.0.0-20130607151641-96e4ba3a7613 // indirect github.com/thales-e-security/pool v0.0.2 // indirect github.com/therootcompany/xz v1.0.1 // indirect - github.com/theupdateframework/go-tuf v0.3.1 // indirect + github.com/theupdateframework/go-tuf v0.5.0 // indirect github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect + github.com/tjfoc/gmsm v1.3.2 // indirect github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect github.com/transparency-dev/merkle v0.0.1 // indirect github.com/ulikunitz/xz v0.5.10 // indirect @@ -274,17 +290,17 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.22.0 // indirect - golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect + golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect - golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect + golang.org/x/sys v0.0.0-20220907062415-87db552b00fd // indirect golang.org/x/text v0.3.8-0.20211004125949-5bd84dd9b33b // indirect golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect golang.org/x/tools v0.1.11 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/api v0.93.0 // indirect + google.golang.org/api v0.95.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 // indirect - google.golang.org/grpc v1.48.0 // indirect + google.golang.org/grpc v1.49.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect gopkg.in/inf.v0 v0.9.1 // indirect @@ -318,7 +334,7 @@ require ( // go: warning: github.com/andybalholm/brotli@v1.0.1: retracted by module author: occasional panics and data corruption github.com/andybalholm/brotli v1.0.4 // indirect github.com/pkg/errors v0.9.1 - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect + golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect ) retract ( diff --git a/go.sum b/go.sum index acc61d985e33..04b666b093bb 100644 --- a/go.sum +++ b/go.sum @@ -90,6 +90,8 @@ contrib.go.opencensus.io/exporter/stackdriver v0.13.12/go.mod h1:mmxnWlrvrFdpiOH contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0 h1:8+4G8JaejP8Xa6W46PzJEwisNgBXMvFcz78N6zG/ARw= +github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0/go.mod h1:GgeIE+1be8Ivm7Sh4RgwI42aTtC9qrcj+Y9Y6CjJhJs= github.com/Antonboom/errname v0.1.5/go.mod h1:DugbBstvPFQbv/5uLcRRzfrNqKE9tVdVCqWCLp6Cifo= github.com/Antonboom/nilnil v0.1.0/go.mod h1:PhHLvRPSghY5Y7mX4TW+BHZQYo1A8flE5H20D3IPZBo= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= @@ -219,6 +221,44 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.2/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/cr-20160607 v1.0.1 h1:WEnP1iPFKJU74ryUKh/YDPHoxMZawqlPajOymyNAkts= +github.com/alibabacloud-go/cr-20160607 v1.0.1/go.mod h1:QHeKZtZ3F3FOE+/uIXCBAp8POwnUYekpLwr1dtQa5r0= +github.com/alibabacloud-go/cr-20181201 v1.0.10 h1:B60f6S1imsgn2fgC6X6FrVNrONDrbCT0NwYhsJ0C9/c= +github.com/alibabacloud-go/cr-20181201 v1.0.10/go.mod h1:VN9orB/w5G20FjytoSpZROqu9ZqxwycASmGqYUJSoDc= +github.com/alibabacloud-go/darabonba-openapi v0.1.12/go.mod h1:sTAjsFJmVsmcVeklL9d9uDBlFsgl43wZ6jhI6BHqHqU= +github.com/alibabacloud-go/darabonba-openapi v0.1.14/go.mod h1:w4CosR7O/kapCtEEMBm3JsQqWBU/CnZ2o0pHorsTWDI= +github.com/alibabacloud-go/darabonba-openapi v0.1.18 h1:3eUVmAr7WCJp7fgIvmCd9ZUyuwtJYbtUqJIed5eXCmk= +github.com/alibabacloud-go/darabonba-openapi v0.1.18/go.mod h1:PB4HffMhJVmAgNKNq3wYbTUlFvPgxJpTzd1F5pTuUsc= +github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 h1:NqugFkGxx1TXSh/pBcU00Y6bljgDPaFdh5MUSeJ7e50= +github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68/go.mod h1:6pb/Qy8c+lqua8cFpEy7g39NRRqOWc3rOwAy8m5Y2BY= +github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/endpoint-util v1.1.1 h1:ZkBv2/jnghxtU0p+upSU0GGzW1VL9GQdZO3mcSUTUy8= +github.com/alibabacloud-go/endpoint-util v1.1.1/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/openapi-util v0.0.9/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.0.10/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/openapi-util v0.0.11 h1:iYnqOPR5hyEEnNZmebGyRMkkEJRWUEjDiiaOHZ5aNhA= +github.com/alibabacloud-go/openapi-util v0.0.11/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg= +github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.11/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4= +github.com/alibabacloud-go/tea v1.1.17/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea v1.1.18 h1:+6GJ06eu5Cr/Mkj09vWrf6QAfrPepctY2OxcWNclRC0= +github.com/alibabacloud-go/tea v1.1.18/go.mod h1:nXxjm6CIFkBhwW4FQkNrolwbfon8Svy6cujmKFUq98A= +github.com/alibabacloud-go/tea-utils v1.3.1/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils v1.3.9/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= +github.com/alibabacloud-go/tea-utils v1.4.3/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw= +github.com/alibabacloud-go/tea-utils v1.4.4 h1:lxCDvNCdTo9FaXKKq45+4vGETQUKNOW/qKTcX9Sk53o= +github.com/alibabacloud-go/tea-utils v1.4.4/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw= +github.com/alibabacloud-go/tea-xml v1.1.2 h1:oLxa7JUXm2EDFzMg+7oRsYc+kutgCVwm+bZlhhmvW5M= +github.com/alibabacloud-go/tea-xml v1.1.2/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= +github.com/aliyun/credentials-go v1.1.2/go.mod h1:ozcZaMR5kLM7pwtCMEpVmQ242suV6qTJya2bDq4X1Tw= +github.com/aliyun/credentials-go v1.2.3 h1:Vmodnr52Rz1mcbwn0kzMhLRKb6soizewuKXdfZiNemU= +github.com/aliyun/credentials-go v1.2.3/go.mod h1:/KowD1cfGSLrLsH28Jr8W+xwoId0ywIy5lNzDz6O1vw= github.com/anchore/client-go v0.0.0-20210222170800-9c70f9b80bcf h1:DYssiUV1pBmKqzKsm4mqXx8artqC0Q8HgZsVI3lMsAg= github.com/anchore/client-go v0.0.0-20210222170800-9c70f9b80bcf/go.mod h1:FaODhIA06mxO1E6R32JE0TL1JWZZkmjRIAd4ULvHUKk= github.com/anchore/go-macholibre v0.0.0-20220308212642-53e6d0aaf6fb h1:iDMnx6LIjtjZ46C0akqveX83WFzhpTD3eqOthawb5vU= @@ -280,26 +320,26 @@ github.com/aws/aws-sdk-go v1.37.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zK github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v1.7.1/go.mod h1:L5LuPC1ZgDr2xQS7AmIec/Jlc7O/Y1u2KxJyNVab250= github.com/aws/aws-sdk-go-v2 v1.14.0/go.mod h1:ZA3Y8V0LrlWj63MQAnRHgKf/5QB//LSZCPNWlWrNGLU= -github.com/aws/aws-sdk-go-v2 v1.16.11 h1:xM1ZPSvty3xVmdxiGr7ay/wlqv+MWhH0rMlyLdbC0YQ= -github.com/aws/aws-sdk-go-v2 v1.16.11/go.mod h1:WTACcleLz6VZTp7fak4EO5b9Q4foxbn+8PIz3PmyKlo= +github.com/aws/aws-sdk-go-v2 v1.16.14 h1:db6GvO4Z2UqHt5gvT0lr6J5x5P+oQ7bdRzczVaRekMU= +github.com/aws/aws-sdk-go-v2 v1.16.14/go.mod h1:s/G+UV29dECbF5rf+RNj1xhlmvoNurGSr+McVSRj59w= github.com/aws/aws-sdk-go-v2/config v1.5.0/go.mod h1:RWlPOAW3E3tbtNAqTwvSW54Of/yP3oiZXMI0xfUdjyA= -github.com/aws/aws-sdk-go-v2/config v1.17.1 h1:BWxTjokU/69BZ4DnLrZco6OvBDii6ToEdfBL/y5I1nA= -github.com/aws/aws-sdk-go-v2/config v1.17.1/go.mod h1:uOxDHjBemNTF2Zos+fgG0NNfE86wn1OAHDTGxjMEYi0= +github.com/aws/aws-sdk-go-v2/config v1.17.5 h1:+NS1BWvprx7nHcIk5o32LrZgifs/7Pm1V2nWjQgZ2H0= +github.com/aws/aws-sdk-go-v2/config v1.17.5/go.mod h1:H0cvPNDO3uExWts/9PDhD/0ne2esu1uaIulwn1vkwxM= github.com/aws/aws-sdk-go-v2/credentials v1.3.1/go.mod h1:r0n73xwsIVagq8RsxmZbGSRQFj9As3je72C2WzUIToc= -github.com/aws/aws-sdk-go-v2/credentials v1.12.14 h1:AtVG/amkjbDBfnPr/tuW2IG18HGNznP6L12Dx0rLz+Q= -github.com/aws/aws-sdk-go-v2/credentials v1.12.14/go.mod h1:opAndTyq+YN7IpVG57z2CeNuXSQMqTYxGGlYH0m0RMY= +github.com/aws/aws-sdk-go-v2/credentials v1.12.18 h1:HF62tbhARhgLfvmfwUbL9qZ+dkbZYzbFdxBb3l5gr7Q= +github.com/aws/aws-sdk-go-v2/credentials v1.12.18/go.mod h1:O7n/CPagQ33rfG6h7vR/W02ammuc5CrsSM22cNZp9so= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.3.0/go.mod h1:2LAuqPx1I6jNfaGDucWfA2zqQCYCOMCDHiCOciALyNw= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12 h1:wgJBHO58Pc1V1QAnzdVM3JK3WbE/6eUF0JxCZ+/izz0= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.12/go.mod h1:aZ4vZnyUuxedC7eD4JyEHpGnCz+O2sHQEx3VvAwklSE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15 h1:nkQ+aI0OCeYfzrBipL6ja/6VEbUnHQoZHBHtoK+Nzxw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.15/go.mod h1:Oz2/qWINxIgSmoZT9adpxJy2UhpcOAI3TIyWgYMVSz0= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.5/go.mod h1:2hXc8ooJqF2nAznsbJQIn+7h851/bu8GVC80OVTTqf8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18 h1:OmiwoVyLKEqqD5GvB683dbSqxiOfvx4U2lDZhG2Esc4= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.18/go.mod h1:348MLhzV1GSlZSMusdwQpXKbhD7X2gbI/TxwAPKkYZQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.21 h1:gRIXnmAVNyoRQywdNtpAkgY+f30QNzgF53Q5OobNZZs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.21/go.mod h1:XsmHMV9c512xgsW01q7H0ut+UQQQpWX8QsFbdLHDwaU= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.3.0/go.mod h1:miRSv9l093jX/t/j+mBCaLqFHo9xKYzJ7DGm1BsGoJM= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12 h1:5mvQDtNWtI6H56+E4LUnLWEmATMB7oEh+Z9RurtIuC0= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.12/go.mod h1:ckaCVTEdGAxO6KwTGzgskxR1xM+iJW4lxMyDFVda2Fc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.15 h1:noAhOo2mMDyYhTx99aYPvQw16T3fQ/DiKAv9fzpIKH8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.15/go.mod h1:kjJ4CyD9M3Wq88GYg3IPfj67Rs0Uvz8aXK7MJ8BvE4I= github.com/aws/aws-sdk-go-v2/internal/ini v1.1.1/go.mod h1:Zy8smImhTdOETZqfyn01iNOe0CNggVbPjCajyaz6Gvg= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19 h1:g5qq9sgtEzt2szMaDqQO6fqKe026T6dHTFJp5NsPzkQ= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.19/go.mod h1:cVHo8KTuHjShb9V8/VjH3S/8+xPu16qx8fdGwmotJhE= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.22 h1:nF+E8HfYpOMw6M5oA9efB602VC00IHNQnB5CmFvZPvA= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.22/go.mod h1:tltHVGy977LrSOgRR5aV9+miyno/Gul/uJNPKS7FzP4= github.com/aws/aws-sdk-go-v2/service/ecr v1.4.1/go.mod h1:FglZcyeiBqcbvyinl+n14aT/EWC7S1MIH+Gan2iizt0= github.com/aws/aws-sdk-go-v2/service/ecr v1.15.0 h1:lY2Z2sBP+zSbJ6CvvmnFgPcgknoQ0OJV88AwVetRRFk= github.com/aws/aws-sdk-go-v2/service/ecr v1.15.0/go.mod h1:4zYI85WiYDhFaU1jPFVfkD7HlBcdnITDE3QxDwy4Kus= @@ -307,19 +347,21 @@ github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.4.1/go.mod h1:eD5Eo4drVP2FLTw0 github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.12.0 h1:LsqBpyRofMG6eDs6YGud6FhdGyIyXelAasPOZ6wWLro= github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.12.0/go.mod h1:IArQ3IBR00FkuraKwudKZZU32OxJfdTdwV+W5iZh3Y4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.2.1/go.mod h1:zceowr5Z1Nh2WVP8bf/3ikB41IZW59E4yIYbg+pC6mw= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12 h1:7iPTTX4SAI2U2VOogD7/gmHlsgnYSgoNHt7MSQXtG2M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.12/go.mod h1:1TODGhheLWjpQWSuhYuAUWYTCKwEjx2iblIFKDHjeTc= -github.com/aws/aws-sdk-go-v2/service/kms v1.18.4 h1:tsokBawk9+eD3RfMbJJRla/y8FinZ79Ylj5tZ3Ayxcw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.15 h1:xlf0J6DUgAj/ocvKQxCmad8Bu1lJuRbt5Wu+4G1xw1g= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.15/go.mod h1:ZVJ7ejRl4+tkWMuCwjXoy0jd8fF5u3RCyWjSVjUIvQE= +github.com/aws/aws-sdk-go-v2/service/kms v1.18.9 h1:BPMcM9DZdpQKWQ8WSXla36mpm+5YgVqP7pLF+W7TEe0= github.com/aws/aws-sdk-go-v2/service/sso v1.3.1/go.mod h1:J3A3RGUvuCZjvSuZEcOpHDnzZP/sKbhDWV2T1EOzFIM= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.17 h1:pXxu9u2z1UqSbjO9YA8kmFJBhFc1EVTDaf7A+S+Ivq8= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.17/go.mod h1:mS5xqLZc/6kc06IpXn5vRxdLaED+jEuaSRv5BxtnsiY= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.21 h1:7jUFr+7F4MzIjCZzy7ygRtXFQcQ0kAbT0gUvtUeAdyU= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.21/go.mod h1:q8nYq51W3gpZempYsAD83fPRlrOTMCwN+Ahg4BKFTXQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.3 h1:UTTPNP3/WzZa7hoHP3Szb/Yl0bM3NoBrf5ABy1OArUM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.3/go.mod h1:+IF75RMJh0+zqTGXGshyEGRsU2ImqWv6UuHGkHl6kEo= github.com/aws/aws-sdk-go-v2/service/sts v1.6.0/go.mod h1:q7o0j7d7HrJk/vr9uUt3BVRASvcU7gYZB9PUgPiByXg= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.13 h1:dl8T0PJlN92rvEGOEUiD0+YPYdPEaCZK0TqHukvSfII= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.13/go.mod h1:Ru3QVMLygVs/07UQ3YDur1AQZZp2tUNje8wfloFttC0= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.17 h1:LVM2jzEQ8mhb2dhrFl4PJ3sa5+KcKT01dsMk2Ma9/FU= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.17/go.mod h1:bQujK1n0V1D1Gz5uII1jaB1WDvhj4/T3tElsJnVXCR0= github.com/aws/smithy-go v1.6.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= github.com/aws/smithy-go v1.11.0/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= -github.com/aws/smithy-go v1.12.1 h1:yQRC55aXN/y1W10HgwHle01DRuV9Dpf31iGkotjt3Ag= -github.com/aws/smithy-go v1.12.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.13.2 h1:TBLKyeJfXTrTXRHmsv4qWt9IQGYyWThLYaJWSahTOGE= +github.com/aws/smithy-go v1.13.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04 h1:p2I85zYI9z5/c/3Q0LiO3RtNXcmXHTtJfml/hV16zNg= github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04/go.mod h1:Z+bXnIbhKJYSvxNwsNnwde7pDKxuqlEZCbUBoTwAqf0= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= @@ -394,6 +436,8 @@ github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLI github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/clbanning/mxj/v2 v2.5.6 h1:Jm4VaCI/+Ug5Q57IzEoZbwx4iQFA6wkXv72juUSeK+g= +github.com/clbanning/mxj/v2 v2.5.6/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= @@ -517,8 +561,8 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-oidc/v3 v3.2.0 h1:2eR2MGR7thBXSQ2YbODlF0fcmgtliLCfr9iX6RW11fc= -github.com/coreos/go-oidc/v3 v3.2.0/go.mod h1:rEJ/idjfUyfkBit1eI1fvyr+64/g9dcKpAm8MJMesvo= +github.com/coreos/go-oidc/v3 v3.3.0 h1:Y1LV3mP+QT3MEycATZpAiwfyN+uxZLqVbAHJUuOJEe4= +github.com/coreos/go-oidc/v3 v3.3.0/go.mod h1:eHUXhZtXPQLgEaDrOVTgwbgmz1xGOkJNye6h3zkD2Pw= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -756,7 +800,7 @@ github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-restruct/restruct v1.2.0-alpha h1:2Lp474S/9660+SJjpVxoKuWX09JsXHSrdV7Nv3/gkvc= github.com/go-restruct/restruct v1.2.0-alpha/go.mod h1:KqrpKpn4M8OLznErihXTGLlsXFGeLxHUrLRRI/1YjGk= -github.com/go-rod/rod v0.109.1 h1:658X/G9xyQKjFUNo5apMsIyHpEb/KJnJ5LkAl6a62AI= +github.com/go-rod/rod v0.109.3 h1:MxuSJGK9lEUq07K+QPfnxnuvQpsQT+YI4SoQjSE0LVg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -906,8 +950,9 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.7.0/go.mod h1:2zaoelrL0d08gGbpdP3LqyUuBmhWbpD6IOe2s9nLS2k= github.com/google/go-containerregistry v0.11.0 h1:Xt8x1adcREjFcmDoDK8OdOsjxu90PHkGuwNP8GiHMLM= github.com/google/go-containerregistry v0.11.0/go.mod h1:BBaYtsHPHA42uEgAvd/NejvAfPSlz281sJWqupjSxfk= @@ -943,6 +988,7 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -985,6 +1031,7 @@ github.com/gookit/color v1.2.5/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1K github.com/gookit/color v1.4.2 h1:tXy44JFSFkKnELV6WaMo/lLfu/meqITX3iAV52do7lk= github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gordonklaus/ineffassign v0.0.0-20210225214923-2e10b2664254/go.mod h1:M9mZEtGIsR1oDaZagNPNG9iq9n2HrhZ17dsXk73V3Lw= github.com/goreleaser/goreleaser v0.134.0/go.mod h1:ZT6Y2rSYa6NxQzIsdfWWNWAlYGXGbreo66NmE+3X3WQ= @@ -1371,6 +1418,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= +github.com/mozillazg/docker-credential-acr-helper v0.3.0 h1:DVWFZ3/O8BP6Ue3iS/Olw+G07u1hCq1EOVCDZZjCIBI= +github.com/mozillazg/docker-credential-acr-helper v0.3.0/go.mod h1:cZlu3tof523ujmLuiNUb6JsjtHcNA70u1jitrrdnuyA= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -1422,6 +1471,8 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1431,7 +1482,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1487,8 +1540,8 @@ github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCko github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= @@ -1643,14 +1696,14 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sigstore/cosign v1.11.1 h1:y9IlANx0kTe5bt4wVkauJkfgWjMwmFId1H2y782hXmc= -github.com/sigstore/cosign v1.11.1/go.mod h1:PURIOXUUu1KmXTJ1x11DHH/X9CyaoYpa9AxRphagu+s= +github.com/sigstore/cosign v1.12.0 h1:4FtGar5z0tuor8p4arOEtgCkzMWyjFKYE4D1oJiPJ6Y= +github.com/sigstore/cosign v1.12.0/go.mod h1:gcWqjoMm2jhu5knf9HMWq5AS8CcnOeYXuamMUBj0Arg= github.com/sigstore/fulcio v0.5.3 h1:fwdl2BHv1RjL3GJJ44T+tPsvmQ028zv54psxVhSwUGA= github.com/sigstore/fulcio v0.5.3/go.mod h1:4yzMqOao6r9Nul1Dgt4LL7loKdkkgbDemLYrXUuAc+Y= github.com/sigstore/rekor v0.11.0 h1:2x1Sy3fu3VSWbl/2fwTyFPqs5fehY++EqdTFWWT6+Mo= github.com/sigstore/rekor v0.11.0/go.mod h1:xEfHnfiQJ/yJVCz41/OglUrDID71gICzixJjYFrQeN0= -github.com/sigstore/sigstore v1.4.0 h1:5A3eUhbSQkhiqJNUPi/2UMKdTyb3NKfWcVjaTBkkaJk= -github.com/sigstore/sigstore v1.4.0/go.mod h1:z3kt1jm2A39M+g7emkQ8jdErL/haCMEjkNxvqTf41/k= +github.com/sigstore/sigstore v1.4.1-0.20220908204944-ec922cf4f1c2 h1:/UPRO/SWpsZHRVXE8IBOHuv+ZgqzjE5/dP0ilC6AlDI= +github.com/sigstore/sigstore v1.4.1-0.20220908204944-ec922cf4f1c2/go.mod h1:d0zef5dbdOvwBwQ0NlqO8pZuiFe4VtW12+ful2i1Nbw= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1668,6 +1721,7 @@ github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EE github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -1720,8 +1774,8 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/spiffe/go-spiffe/v2 v2.1.1 h1:RT9kM8MZLZIsPTH+HKQEP5yaAk3yd/VBzlINaRjXs8k= github.com/spiffe/go-spiffe/v2 v2.1.1/go.mod h1:5qg6rpqlwIub0JAiF1UK9IMD6BpPTmvG6yfSgDBs5lg= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= @@ -1749,11 +1803,12 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.3.0 h1:mjC+YW8QpAdXibNi+vNWgzmgBH4+5l5dCXv8cNysBLI= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/sylabs/sif/v2 v2.7.2 h1:eCxtl2ub9fPfrO7g2JPagn6HKDhv+Kl92Jz6+ww2Y1Q= github.com/sylabs/sif/v2 v2.7.2/go.mod h1:LQOdYXC9a8i7BleTKRw9lohi0rTbXkJOeS9u0ebvgyM= github.com/sylabs/squashfs v0.6.1 h1:4hgvHnD9JGlYWwT0bPYNt9zaz23mAV3Js+VEgQoRGYQ= @@ -1762,8 +1817,8 @@ github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= +github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= @@ -1775,8 +1830,8 @@ github.com/thales-e-security/pool v0.0.2 h1:RAPs4q2EbWsTit6tpzuvTFlgFRJ3S8Evf5gt github.com/thales-e-security/pool v0.0.2/go.mod h1:qtpMm2+thHtqhLzTwgDBj/OuNnMpupY8mv0Phz0gjhU= github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw= github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY= -github.com/theupdateframework/go-tuf v0.3.1 h1:NkjMlCuLcDpHNtsWXY4lTmbbQQ5nOM7JSBbOKEEiI1c= -github.com/theupdateframework/go-tuf v0.3.1/go.mod h1:lhHZ3Vt2pdAh15h0Cc6gWdlI+Okn2ZznD3q/cNjd5jw= +github.com/theupdateframework/go-tuf v0.5.0 h1:aQ7i9CBw4q9QEZifCaW6G8qGQwoN23XGaZkOA+F50z4= +github.com/theupdateframework/go-tuf v0.5.0/go.mod h1:vAqWV3zEs89byeFsAYoh/Q14vJTgJkHwnnRCWBBBINY= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= @@ -1786,6 +1841,8 @@ github.com/tj/assert v0.0.0-20171129193455-018094318fb0/go.mod h1:mZ9/Rh9oLWpLLD github.com/tj/go-elastic v0.0.0-20171221160941-36157cbbebc2/go.mod h1:WjeM0Oo1eNAjXGDx2yma7uG2XoyRZTq1uv3M/o7imD0= github.com/tj/go-kinesis v0.0.0-20171128231115-08b17f58cb1b/go.mod h1:/yhzCV0xPfx6jb1bBgRFjl5lytqVqZXEaeqWP8lTEao= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= +github.com/tjfoc/gmsm v1.3.2 h1:7JVkAn5bvUJ7HtU08iW6UiD+UTmJTIToHCfeFzkcCxM= +github.com/tjfoc/gmsm v1.3.2/go.mod h1:HaUcFuY0auTiaHB9MHFGCPx5IaLhTUd2atbCFBQXn9w= github.com/tklauser/go-sysconf v0.3.9/go.mod h1:11DU/5sG7UexIrp/O6g35hrWzu0JxlwQ3LSFUzyeuhs= github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1881,6 +1938,7 @@ github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDf github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.30/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -2044,8 +2102,10 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20191219195013-becbf705a915/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2063,8 +2123,9 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 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= @@ -2143,14 +2204,12 @@ golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200930145003-4acb6c075d10/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -2185,8 +2244,8 @@ golang.org/x/net v0.0.0-20220421235706-1d1ef9303861/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48 h1:N9Vc/rorQUDes6B9CNdIxAn5jODGj2wzfrei2x4wNj4= -golang.org/x/net v0.0.0-20220805013720-a33c5aa5df48/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY= +golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2213,9 +2272,8 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c h1:q3gFqPqH7NVofKo3c3yETAP//pPI+G5mvB7qqj1Y5kY= -golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2295,6 +2353,7 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2304,7 +2363,6 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2375,8 +2433,9 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220907062415-87db552b00fd h1:AZeIEzg+8RCELJYq8w+ODLVxFgLMMigSwO/ffKPEd9U= +golang.org/x/sys v0.0.0-20220907062415-87db552b00fd/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2475,6 +2534,7 @@ golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -2585,8 +2645,8 @@ google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.93.0 h1:T2xt9gi0gHdxdnRkVQhT8mIvPaXKNsDNWz+L696M66M= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= +google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2754,8 +2814,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/grpc/examples v0.0.0-20201130180447-c456688b1860/go.mod h1:Ly7ZA/ARzg8fnPU9TyZIxoz33sEUuWX7txiqs8lPTgE= @@ -2796,6 +2856,7 @@ gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKW gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= diff --git a/internal/anchore/import.go b/internal/anchore/import.go index 4225c96c8a35..e3459a26f081 100644 --- a/internal/anchore/import.go +++ b/internal/anchore/import.go @@ -6,14 +6,15 @@ import ( "fmt" "time" + "github.com/antihax/optional" + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" + "github.com/anchore/client-go/pkg/external" "github.com/anchore/stereoscope/pkg/image" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/syft/event" "github.com/anchore/syft/syft/sbom" - "github.com/antihax/optional" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/go-progress" ) type ImportConfig struct { diff --git a/internal/anchore/import_config_test.go b/internal/anchore/import_config_test.go index 190808c84bd8..ecd964be3021 100644 --- a/internal/anchore/import_config_test.go +++ b/internal/anchore/import_config_test.go @@ -8,11 +8,11 @@ import ( "strings" "testing" + "github.com/docker/docker/pkg/ioutils" + "github.com/go-test/deep" "github.com/wagoodman/go-progress" "github.com/anchore/client-go/pkg/external" - "github.com/docker/docker/pkg/ioutils" - "github.com/go-test/deep" ) type mockConfigImportAPI struct { diff --git a/internal/anchore/import_dockerfile.go b/internal/anchore/import_dockerfile.go index bc8083768165..83fd31633bdd 100644 --- a/internal/anchore/import_dockerfile.go +++ b/internal/anchore/import_dockerfile.go @@ -8,9 +8,8 @@ import ( "github.com/wagoodman/go-progress" - "github.com/anchore/syft/internal/log" - "github.com/anchore/client-go/pkg/external" + "github.com/anchore/syft/internal/log" ) type dockerfileImportAPI interface { diff --git a/internal/anchore/import_dockerfile_test.go b/internal/anchore/import_dockerfile_test.go index 27a5c6e2de9e..336fea1c4915 100644 --- a/internal/anchore/import_dockerfile_test.go +++ b/internal/anchore/import_dockerfile_test.go @@ -7,12 +7,11 @@ import ( "strings" "testing" - "github.com/wagoodman/go-progress" - "github.com/docker/docker/pkg/ioutils" + "github.com/go-test/deep" + "github.com/wagoodman/go-progress" "github.com/anchore/client-go/pkg/external" - "github.com/go-test/deep" ) type mockDockerfileImportAPI struct { diff --git a/internal/anchore/import_manifest_test.go b/internal/anchore/import_manifest_test.go index 349970e81e60..e4edea3a0d0a 100644 --- a/internal/anchore/import_manifest_test.go +++ b/internal/anchore/import_manifest_test.go @@ -8,11 +8,11 @@ import ( "strings" "testing" + "github.com/docker/docker/pkg/ioutils" + "github.com/go-test/deep" "github.com/wagoodman/go-progress" "github.com/anchore/client-go/pkg/external" - "github.com/docker/docker/pkg/ioutils" - "github.com/go-test/deep" ) type mockManifestImportAPI struct { diff --git a/internal/anchore/import_package_sbom.go b/internal/anchore/import_package_sbom.go index 6c9f6c0ac9e1..cf6551972086 100644 --- a/internal/anchore/import_package_sbom.go +++ b/internal/anchore/import_package_sbom.go @@ -8,12 +8,13 @@ import ( "fmt" "net/http" + "github.com/wagoodman/go-progress" + "github.com/anchore/client-go/pkg/external" - "github.com/anchore/syft/internal/formats/syftjson" - syftjsonModel "github.com/anchore/syft/internal/formats/syftjson/model" "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/formats/syftjson" + syftjsonModel "github.com/anchore/syft/syft/formats/syftjson/model" "github.com/anchore/syft/syft/sbom" - "github.com/wagoodman/go-progress" ) type packageSBOMImportAPI interface { diff --git a/internal/anchore/import_package_sbom_test.go b/internal/anchore/import_package_sbom_test.go index 3628a07c4820..c1603efd71cf 100644 --- a/internal/anchore/import_package_sbom_test.go +++ b/internal/anchore/import_package_sbom_test.go @@ -8,18 +8,19 @@ import ( "strings" "testing" + "github.com/docker/docker/pkg/ioutils" + "github.com/go-test/deep" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/wagoodman/go-progress" + "github.com/anchore/client-go/pkg/external" - "github.com/anchore/syft/internal/formats/syftjson" "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/formats/syftjson" "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/docker/docker/pkg/ioutils" - "github.com/go-test/deep" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/wagoodman/go-progress" ) func must(c pkg.CPE, e error) pkg.CPE { diff --git a/internal/config/application.go b/internal/config/application.go index d5898b0d103a..037412c58702 100644 --- a/internal/config/application.go +++ b/internal/config/application.go @@ -8,16 +8,15 @@ import ( "sort" "strings" - "github.com/anchore/syft/syft/pkg/cataloger" - - "github.com/sirupsen/logrus" - "github.com/adrg/xdg" - "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/log" "github.com/mitchellh/go-homedir" + "github.com/sirupsen/logrus" "github.com/spf13/viper" "gopkg.in/yaml.v2" + + "github.com/anchore/syft/internal" + "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/pkg/cataloger" ) var ( diff --git a/internal/config/file_classification.go b/internal/config/file_classification.go index f4ba630184e4..d78812705b6e 100644 --- a/internal/config/file_classification.go +++ b/internal/config/file_classification.go @@ -1,8 +1,9 @@ package config import ( - "github.com/anchore/syft/syft/source" "github.com/spf13/viper" + + "github.com/anchore/syft/syft/source" ) type fileClassification struct { diff --git a/internal/config/file_contents.go b/internal/config/file_contents.go index f8c3c47d18b0..18a404f5b61b 100644 --- a/internal/config/file_contents.go +++ b/internal/config/file_contents.go @@ -1,9 +1,10 @@ package config import ( + "github.com/spf13/viper" + "github.com/anchore/syft/internal/file" "github.com/anchore/syft/syft/source" - "github.com/spf13/viper" ) type fileContents struct { diff --git a/internal/config/file_metadata.go b/internal/config/file_metadata.go index 764b9b3925fe..5339f29d77fd 100644 --- a/internal/config/file_metadata.go +++ b/internal/config/file_metadata.go @@ -1,8 +1,9 @@ package config import ( - "github.com/anchore/syft/syft/source" "github.com/spf13/viper" + + "github.com/anchore/syft/syft/source" ) type FileMetadata struct { diff --git a/internal/config/pkg.go b/internal/config/pkg.go index 88d6225414aa..21e26a59bab8 100644 --- a/internal/config/pkg.go +++ b/internal/config/pkg.go @@ -1,8 +1,9 @@ package config import ( - "github.com/anchore/syft/syft/pkg/cataloger" "github.com/spf13/viper" + + "github.com/anchore/syft/syft/pkg/cataloger" ) type pkg struct { diff --git a/internal/config/registry.go b/internal/config/registry.go index 6ae85d3e770d..7e7e7132bbb4 100644 --- a/internal/config/registry.go +++ b/internal/config/registry.go @@ -3,9 +3,9 @@ package config import ( "os" - "github.com/anchore/stereoscope/pkg/image" - "github.com/spf13/viper" + + "github.com/anchore/stereoscope/pkg/image" ) type RegistryCredentials struct { diff --git a/internal/config/registry_test.go b/internal/config/registry_test.go index 6d9ecf280e84..c98511c1e280 100644 --- a/internal/config/registry_test.go +++ b/internal/config/registry_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/anchore/stereoscope/pkg/image" - "github.com/stretchr/testify/assert" + + "github.com/anchore/stereoscope/pkg/image" ) func TestHasNonEmptyCredentials(t *testing.T) { diff --git a/internal/config/secrets.go b/internal/config/secrets.go index 2c07dd4987ef..0d0efc4f1fc3 100644 --- a/internal/config/secrets.go +++ b/internal/config/secrets.go @@ -1,9 +1,10 @@ package config import ( + "github.com/spf13/viper" + "github.com/anchore/syft/internal/file" "github.com/anchore/syft/syft/source" - "github.com/spf13/viper" ) type secrets struct { diff --git a/internal/spdxlicense/generate/generate_license_list_test.go b/internal/spdxlicense/generate/generate_license_list_test.go index d730db1413ab..08a4ae33763f 100644 --- a/internal/spdxlicense/generate/generate_license_list_test.go +++ b/internal/spdxlicense/generate/generate_license_list_test.go @@ -2,10 +2,10 @@ package main import ( "encoding/json" - "github.com/google/go-cmp/cmp" "os" "testing" + "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" ) diff --git a/internal/spdxlicense/generate/license_test.go b/internal/spdxlicense/generate/license_test.go index 4796873ec6fa..81de2406d7d5 100644 --- a/internal/spdxlicense/generate/license_test.go +++ b/internal/spdxlicense/generate/license_test.go @@ -1,9 +1,10 @@ package main import ( - "github.com/stretchr/testify/assert" "strings" "testing" + + "github.com/stretchr/testify/assert" ) var ( diff --git a/internal/ui/common_event_handlers.go b/internal/ui/common_event_handlers.go index 39b131e8087c..09325b21f8dc 100644 --- a/internal/ui/common_event_handlers.go +++ b/internal/ui/common_event_handlers.go @@ -3,8 +3,9 @@ package ui import ( "fmt" - syftEventParsers "github.com/anchore/syft/syft/event/parsers" "github.com/wagoodman/go-partybus" + + syftEventParsers "github.com/anchore/syft/syft/event/parsers" ) // handleExit is a UI function for processing the Exit bus event, diff --git a/internal/ui/ephemeral_terminal_ui.go b/internal/ui/ephemeral_terminal_ui.go index 7cf7ad329ea0..99b7a08b6f70 100644 --- a/internal/ui/ephemeral_terminal_ui.go +++ b/internal/ui/ephemeral_terminal_ui.go @@ -11,12 +11,13 @@ import ( "os" "sync" + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/jotframe/pkg/frame" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/internal/logger" syftEvent "github.com/anchore/syft/syft/event" "github.com/anchore/syft/ui" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/jotframe/pkg/frame" ) // ephemeralTerminalUI provides an "ephemeral" terminal user interface to display the application state dynamically. diff --git a/internal/ui/etui_event_handlers.go b/internal/ui/etui_event_handlers.go index fcd998e44269..606962fbdb84 100644 --- a/internal/ui/etui_event_handlers.go +++ b/internal/ui/etui_event_handlers.go @@ -9,12 +9,12 @@ import ( "io" "sync" - "github.com/anchore/syft/internal" "github.com/gookit/color" + "github.com/wagoodman/go-partybus" "github.com/wagoodman/jotframe/pkg/frame" + "github.com/anchore/syft/internal" syftEventParsers "github.com/anchore/syft/syft/event/parsers" - "github.com/wagoodman/go-partybus" ) // handleAppUpdateAvailable is a UI handler function to display a new application version to the top of the screen. diff --git a/internal/ui/logger_ui.go b/internal/ui/logger_ui.go index 53cd9f7a9525..48f5c1ed6bf4 100644 --- a/internal/ui/logger_ui.go +++ b/internal/ui/logger_ui.go @@ -1,9 +1,10 @@ package ui import ( + "github.com/wagoodman/go-partybus" + "github.com/anchore/syft/internal/log" syftEvent "github.com/anchore/syft/syft/event" - "github.com/wagoodman/go-partybus" ) type loggerUI struct { diff --git a/schema/json/generate.go b/schema/json/generate.go index 5bd99403cb8c..e5833e5ffd6b 100644 --- a/schema/json/generate.go +++ b/schema/json/generate.go @@ -11,8 +11,9 @@ import ( "strings" "github.com/alecthomas/jsonschema" + "github.com/anchore/syft/internal" - syftjsonModel "github.com/anchore/syft/internal/formats/syftjson/model" + syftjsonModel "github.com/anchore/syft/syft/formats/syftjson/model" "github.com/anchore/syft/syft/pkg" ) diff --git a/syft/event/parsers/parsers.go b/syft/event/parsers/parsers.go index f384044cd521..c6b97810050e 100644 --- a/syft/event/parsers/parsers.go +++ b/syft/event/parsers/parsers.go @@ -6,11 +6,12 @@ package parsers import ( "fmt" + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" + "github.com/anchore/syft/syft/event" "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg/cataloger" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/go-progress" ) type ErrBadPayload struct { diff --git a/syft/file/all_regular_files_test.go b/syft/file/all_regular_files_test.go index aad33b3487bb..d1e261652fce 100644 --- a/syft/file/all_regular_files_test.go +++ b/syft/file/all_regular_files_test.go @@ -1,12 +1,14 @@ package file import ( - "github.com/anchore/stereoscope/pkg/imagetest" - "github.com/anchore/syft/syft/source" + "testing" + "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" + + "github.com/anchore/stereoscope/pkg/imagetest" + "github.com/anchore/syft/syft/source" ) func Test_allRegularFiles(t *testing.T) { diff --git a/syft/file/classification_cataloger_test.go b/syft/file/classification_cataloger_test.go index da6fb37cb7bb..90cca7642359 100644 --- a/syft/file/classification_cataloger_test.go +++ b/syft/file/classification_cataloger_test.go @@ -1,11 +1,12 @@ package file import ( - "github.com/anchore/stereoscope/pkg/imagetest" "testing" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" + + "github.com/anchore/stereoscope/pkg/imagetest" + "github.com/anchore/syft/syft/source" ) func TestClassifierCataloger_DefaultClassifiers_PositiveCases(t *testing.T) { diff --git a/syft/file/classifier.go b/syft/file/classifier.go index d4efa538a1e8..9b35b5110573 100644 --- a/syft/file/classifier.go +++ b/syft/file/classifier.go @@ -3,7 +3,7 @@ package file import ( "bytes" "fmt" - "io/ioutil" + "io" "regexp" "text/template" @@ -84,7 +84,7 @@ func (c Classifier) Classify(resolver source.FileResolver, location source.Locat defer internal.CloseAndLogError(contentReader, location.VirtualPath) // TODO: there is room for improvement here, as this may use an excessive amount of memory. Alternate approach is to leverage a RuneReader. - contents, err := ioutil.ReadAll(contentReader) + contents, err := io.ReadAll(contentReader) if err != nil { return nil, err } diff --git a/syft/file/classifier_test.go b/syft/file/classifier_test.go index 9151f3f5bb52..ddfa50a2be59 100644 --- a/syft/file/classifier_test.go +++ b/syft/file/classifier_test.go @@ -4,8 +4,9 @@ import ( "regexp" "testing" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/source" ) func TestFilepathMatches(t *testing.T) { diff --git a/syft/file/contents_cataloger.go b/syft/file/contents_cataloger.go index b65a042841c4..b4d7802a63d3 100644 --- a/syft/file/contents_cataloger.go +++ b/syft/file/contents_cataloger.go @@ -7,7 +7,6 @@ import ( "io" "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/source" ) diff --git a/syft/file/contents_cataloger_test.go b/syft/file/contents_cataloger_test.go index d13025c4c831..526baae5c338 100644 --- a/syft/file/contents_cataloger_test.go +++ b/syft/file/contents_cataloger_test.go @@ -3,8 +3,9 @@ package file import ( "testing" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/source" ) func TestContentsCataloger(t *testing.T) { diff --git a/syft/file/digest_cataloger.go b/syft/file/digest_cataloger.go index edc096c16b14..50dccac8de14 100644 --- a/syft/file/digest_cataloger.go +++ b/syft/file/digest_cataloger.go @@ -8,15 +8,13 @@ import ( "io" "strings" - "github.com/anchore/syft/internal" - - "github.com/anchore/syft/internal/log" - - "github.com/anchore/syft/internal/bus" - "github.com/anchore/syft/syft/event" "github.com/wagoodman/go-partybus" "github.com/wagoodman/go-progress" + "github.com/anchore/syft/internal" + "github.com/anchore/syft/internal/bus" + "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/event" "github.com/anchore/syft/syft/source" ) diff --git a/syft/file/digest_cataloger_test.go b/syft/file/digest_cataloger_test.go index 2779215089d2..c2f3c6b5f566 100644 --- a/syft/file/digest_cataloger_test.go +++ b/syft/file/digest_cataloger_test.go @@ -3,18 +3,16 @@ package file import ( "crypto" "fmt" - "github.com/stretchr/testify/require" "io/ioutil" "os" "path/filepath" "testing" - "github.com/anchore/stereoscope/pkg/file" - - "github.com/anchore/stereoscope/pkg/imagetest" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/anchore/stereoscope/pkg/file" + "github.com/anchore/stereoscope/pkg/imagetest" "github.com/anchore/syft/syft/source" ) diff --git a/syft/file/metadata_cataloger.go b/syft/file/metadata_cataloger.go index e9cf28b90ca9..39f1e28b41a3 100644 --- a/syft/file/metadata_cataloger.go +++ b/syft/file/metadata_cataloger.go @@ -1,12 +1,13 @@ package file import ( + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" + "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/event" "github.com/anchore/syft/syft/source" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/go-progress" ) type MetadataCataloger struct { diff --git a/syft/file/metadata_cataloger_test.go b/syft/file/metadata_cataloger_test.go index 9ca27a6d014f..c7633bb7c8c0 100644 --- a/syft/file/metadata_cataloger_test.go +++ b/syft/file/metadata_cataloger_test.go @@ -5,10 +5,11 @@ import ( "os" "testing" + "github.com/stretchr/testify/assert" + "github.com/anchore/stereoscope/pkg/file" "github.com/anchore/stereoscope/pkg/imagetest" "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/assert" ) var updateImageGoldenFiles = flag.Bool("update-image", false, "update the golden fixture images used for testing") diff --git a/syft/file/secrets_cataloger.go b/syft/file/secrets_cataloger.go index b8f31980ea99..224307b7537f 100644 --- a/syft/file/secrets_cataloger.go +++ b/syft/file/secrets_cataloger.go @@ -4,18 +4,17 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "regexp" "sort" - "github.com/anchore/syft/internal" + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/event" "github.com/anchore/syft/syft/source" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/go-progress" ) var DefaultSecretsPatterns = map[string]string{ @@ -111,7 +110,7 @@ func extractValue(resolver source.FileResolver, location source.Location, start, } defer internal.CloseAndLogError(readCloser, location.VirtualPath) - n, err := io.CopyN(ioutil.Discard, readCloser, start) + n, err := io.CopyN(io.Discard, readCloser, start) if err != nil { return "", fmt.Errorf("unable to read contents for location=%q : %w", location, err) } diff --git a/syft/file/secrets_cataloger_test.go b/syft/file/secrets_cataloger_test.go index 696f3865c875..b2c55a9f3f0b 100644 --- a/syft/file/secrets_cataloger_test.go +++ b/syft/file/secrets_cataloger_test.go @@ -4,11 +4,10 @@ import ( "regexp" "testing" - "github.com/anchore/syft/internal/file" + "github.com/stretchr/testify/assert" + "github.com/anchore/syft/internal/file" "github.com/anchore/syft/syft/source" - - "github.com/stretchr/testify/assert" ) func TestSecretsCataloger(t *testing.T) { diff --git a/syft/file/secrets_search_by_line_strategy.go b/syft/file/secrets_search_by_line_strategy.go index 0fd87ff63c77..d241846fab1b 100644 --- a/syft/file/secrets_search_by_line_strategy.go +++ b/syft/file/secrets_search_by_line_strategy.go @@ -5,11 +5,9 @@ import ( "errors" "fmt" "io" - "io/ioutil" "regexp" "github.com/anchore/syft/internal" - "github.com/anchore/syft/syft/source" ) @@ -80,7 +78,7 @@ func readerAtPosition(resolver source.FileResolver, location source.Location, se return nil, fmt.Errorf("unable to fetch reader for location=%q : %w", location, err) } if seekPosition > 0 { - n, err := io.CopyN(ioutil.Discard, readCloser, seekPosition) + n, err := io.CopyN(io.Discard, readCloser, seekPosition) if err != nil { return nil, fmt.Errorf("unable to read contents for location=%q while searching for secrets: %w", location, err) } diff --git a/syft/formats.go b/syft/formats.go index f3433a48e019..1e606136a9b8 100644 --- a/syft/formats.go +++ b/syft/formats.go @@ -4,15 +4,15 @@ import ( "bytes" "strings" - "github.com/anchore/syft/internal/formats/cyclonedxjson" - "github.com/anchore/syft/internal/formats/cyclonedxxml" - "github.com/anchore/syft/internal/formats/github" - "github.com/anchore/syft/internal/formats/spdx22json" - "github.com/anchore/syft/internal/formats/spdx22tagvalue" - "github.com/anchore/syft/internal/formats/syftjson" - "github.com/anchore/syft/internal/formats/table" - "github.com/anchore/syft/internal/formats/template" - "github.com/anchore/syft/internal/formats/text" + "github.com/anchore/syft/syft/formats/cyclonedxjson" + "github.com/anchore/syft/syft/formats/cyclonedxxml" + "github.com/anchore/syft/syft/formats/github" + "github.com/anchore/syft/syft/formats/spdx22json" + "github.com/anchore/syft/syft/formats/spdx22tagvalue" + "github.com/anchore/syft/syft/formats/syftjson" + "github.com/anchore/syft/syft/formats/table" + "github.com/anchore/syft/syft/formats/template" + "github.com/anchore/syft/syft/formats/text" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/common/cyclonedxhelpers/author.go b/syft/formats/common/cyclonedxhelpers/author.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/author.go rename to syft/formats/common/cyclonedxhelpers/author.go diff --git a/internal/formats/common/cyclonedxhelpers/author_test.go b/syft/formats/common/cyclonedxhelpers/author_test.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/author_test.go rename to syft/formats/common/cyclonedxhelpers/author_test.go index 11cd95d667ac..11bc9a8d8c3c 100644 --- a/internal/formats/common/cyclonedxhelpers/author_test.go +++ b/syft/formats/common/cyclonedxhelpers/author_test.go @@ -3,8 +3,9 @@ package cyclonedxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_encodeAuthor(t *testing.T) { diff --git a/internal/formats/common/cyclonedxhelpers/component.go b/syft/formats/common/cyclonedxhelpers/component.go similarity index 98% rename from internal/formats/common/cyclonedxhelpers/component.go rename to syft/formats/common/cyclonedxhelpers/component.go index 955b3b227c5a..0f2c1fd89b33 100644 --- a/internal/formats/common/cyclonedxhelpers/component.go +++ b/syft/formats/common/cyclonedxhelpers/component.go @@ -6,7 +6,7 @@ import ( "github.com/CycloneDX/cyclonedx-go" "github.com/anchore/packageurl-go" - "github.com/anchore/syft/internal/formats/common" + "github.com/anchore/syft/syft/formats/common" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" ) diff --git a/internal/formats/common/cyclonedxhelpers/component_test.go b/syft/formats/common/cyclonedxhelpers/component_test.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/component_test.go rename to syft/formats/common/cyclonedxhelpers/component_test.go diff --git a/internal/formats/common/cyclonedxhelpers/cpe.go b/syft/formats/common/cyclonedxhelpers/cpe.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/cpe.go rename to syft/formats/common/cyclonedxhelpers/cpe.go diff --git a/internal/formats/common/cyclonedxhelpers/cpe_test.go b/syft/formats/common/cyclonedxhelpers/cpe_test.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/cpe_test.go rename to syft/formats/common/cyclonedxhelpers/cpe_test.go diff --git a/internal/formats/common/cyclonedxhelpers/decoder.go b/syft/formats/common/cyclonedxhelpers/decoder.go similarity index 97% rename from internal/formats/common/cyclonedxhelpers/decoder.go rename to syft/formats/common/cyclonedxhelpers/decoder.go index f255d1b228cb..36d99e26014e 100644 --- a/internal/formats/common/cyclonedxhelpers/decoder.go +++ b/syft/formats/common/cyclonedxhelpers/decoder.go @@ -6,8 +6,8 @@ import ( "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/internal/formats/common" "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/formats/common" "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" @@ -38,7 +38,7 @@ func GetDecoder(format cyclonedx.BOMFileFormat) sbom.Decoder { if err != nil { return nil, err } - s, err := toSyftModel(bom) + s, err := ToSyftModel(bom) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func GetDecoder(format cyclonedx.BOMFileFormat) sbom.Decoder { } } -func toSyftModel(bom *cyclonedx.BOM) (*sbom.SBOM, error) { +func ToSyftModel(bom *cyclonedx.BOM) (*sbom.SBOM, error) { if bom == nil { return nil, fmt.Errorf("no content defined in CycloneDX BOM") } diff --git a/internal/formats/common/cyclonedxhelpers/decoder_test.go b/syft/formats/common/cyclonedxhelpers/decoder_test.go similarity index 98% rename from internal/formats/common/cyclonedxhelpers/decoder_test.go rename to syft/formats/common/cyclonedxhelpers/decoder_test.go index 5f029bd3e412..c2f64775e829 100644 --- a/internal/formats/common/cyclonedxhelpers/decoder_test.go +++ b/syft/formats/common/cyclonedxhelpers/decoder_test.go @@ -204,7 +204,7 @@ func Test_decode(t *testing.T) { } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - sbom, err := toSyftModel(&test.input) + sbom, err := ToSyftModel(&test.input) assert.NoError(t, err) test: @@ -267,12 +267,12 @@ func Test_missingDataDecode(t *testing.T) { Components: &[]cyclonedx.Component{}, } - _, err := toSyftModel(bom) + _, err := ToSyftModel(bom) assert.NoError(t, err) bom.Metadata = &cyclonedx.Metadata{} - _, err = toSyftModel(bom) + _, err = ToSyftModel(bom) assert.NoError(t, err) pkg := decodeComponent(&cyclonedx.Component{ diff --git a/internal/formats/common/cyclonedxhelpers/description.go b/syft/formats/common/cyclonedxhelpers/description.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/description.go rename to syft/formats/common/cyclonedxhelpers/description.go diff --git a/internal/formats/common/cyclonedxhelpers/description_test.go b/syft/formats/common/cyclonedxhelpers/description_test.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/description_test.go rename to syft/formats/common/cyclonedxhelpers/description_test.go index 21f722702044..3eea431f6d05 100644 --- a/internal/formats/common/cyclonedxhelpers/description_test.go +++ b/syft/formats/common/cyclonedxhelpers/description_test.go @@ -3,8 +3,9 @@ package cyclonedxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_encodeDescription(t *testing.T) { diff --git a/internal/formats/common/cyclonedxhelpers/external_references.go b/syft/formats/common/cyclonedxhelpers/external_references.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/external_references.go rename to syft/formats/common/cyclonedxhelpers/external_references.go index c7f952717df7..1c9f39d9d479 100644 --- a/internal/formats/common/cyclonedxhelpers/external_references.go +++ b/syft/formats/common/cyclonedxhelpers/external_references.go @@ -4,9 +4,9 @@ import ( "fmt" "strings" - syftFile "github.com/anchore/syft/syft/file" - "github.com/CycloneDX/cyclonedx-go" + + syftFile "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" ) diff --git a/internal/formats/common/cyclonedxhelpers/external_references_test.go b/syft/formats/common/cyclonedxhelpers/external_references_test.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/external_references_test.go rename to syft/formats/common/cyclonedxhelpers/external_references_test.go index e5a91daa6675..0dd8795574ed 100644 --- a/internal/formats/common/cyclonedxhelpers/external_references_test.go +++ b/syft/formats/common/cyclonedxhelpers/external_references_test.go @@ -4,8 +4,9 @@ import ( "testing" "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_encodeExternalReferences(t *testing.T) { diff --git a/internal/formats/common/cyclonedxhelpers/format.go b/syft/formats/common/cyclonedxhelpers/format.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/format.go rename to syft/formats/common/cyclonedxhelpers/format.go diff --git a/internal/formats/common/cyclonedxhelpers/group.go b/syft/formats/common/cyclonedxhelpers/group.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/group.go rename to syft/formats/common/cyclonedxhelpers/group.go diff --git a/internal/formats/common/cyclonedxhelpers/group_test.go b/syft/formats/common/cyclonedxhelpers/group_test.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/group_test.go rename to syft/formats/common/cyclonedxhelpers/group_test.go index 38352131fadb..23c8c4bbbca4 100644 --- a/internal/formats/common/cyclonedxhelpers/group_test.go +++ b/syft/formats/common/cyclonedxhelpers/group_test.go @@ -3,8 +3,9 @@ package cyclonedxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_encodeGroup(t *testing.T) { diff --git a/internal/formats/common/cyclonedxhelpers/licenses.go b/syft/formats/common/cyclonedxhelpers/licenses.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/licenses.go rename to syft/formats/common/cyclonedxhelpers/licenses.go index 9acf70d39ef1..ab8aa9d3a0d6 100644 --- a/internal/formats/common/cyclonedxhelpers/licenses.go +++ b/syft/formats/common/cyclonedxhelpers/licenses.go @@ -2,6 +2,7 @@ package cyclonedxhelpers import ( "github.com/CycloneDX/cyclonedx-go" + "github.com/anchore/syft/internal/spdxlicense" "github.com/anchore/syft/syft/pkg" ) diff --git a/internal/formats/common/cyclonedxhelpers/licenses_test.go b/syft/formats/common/cyclonedxhelpers/licenses_test.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/licenses_test.go rename to syft/formats/common/cyclonedxhelpers/licenses_test.go index 4b3745adc8f0..d8e7b37cf817 100644 --- a/internal/formats/common/cyclonedxhelpers/licenses_test.go +++ b/syft/formats/common/cyclonedxhelpers/licenses_test.go @@ -4,8 +4,9 @@ import ( "testing" "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_encodeLicense(t *testing.T) { diff --git a/internal/formats/common/cyclonedxhelpers/properties.go b/syft/formats/common/cyclonedxhelpers/properties.go similarity index 88% rename from internal/formats/common/cyclonedxhelpers/properties.go rename to syft/formats/common/cyclonedxhelpers/properties.go index a43052b92692..ba630daeb213 100644 --- a/internal/formats/common/cyclonedxhelpers/properties.go +++ b/syft/formats/common/cyclonedxhelpers/properties.go @@ -3,7 +3,7 @@ package cyclonedxhelpers import ( "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/internal/formats/common" + "github.com/anchore/syft/syft/formats/common" ) var ( diff --git a/internal/formats/common/cyclonedxhelpers/publisher.go b/syft/formats/common/cyclonedxhelpers/publisher.go similarity index 100% rename from internal/formats/common/cyclonedxhelpers/publisher.go rename to syft/formats/common/cyclonedxhelpers/publisher.go diff --git a/internal/formats/common/cyclonedxhelpers/publisher_test.go b/syft/formats/common/cyclonedxhelpers/publisher_test.go similarity index 99% rename from internal/formats/common/cyclonedxhelpers/publisher_test.go rename to syft/formats/common/cyclonedxhelpers/publisher_test.go index 0673059864bf..bda829587fa4 100644 --- a/internal/formats/common/cyclonedxhelpers/publisher_test.go +++ b/syft/formats/common/cyclonedxhelpers/publisher_test.go @@ -3,8 +3,9 @@ package cyclonedxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_encodePublisher(t *testing.T) { diff --git a/internal/formats/common/property_encoder.go b/syft/formats/common/property_encoder.go similarity index 100% rename from internal/formats/common/property_encoder.go rename to syft/formats/common/property_encoder.go diff --git a/internal/formats/common/property_encoder_test.go b/syft/formats/common/property_encoder_test.go similarity index 100% rename from internal/formats/common/property_encoder_test.go rename to syft/formats/common/property_encoder_test.go diff --git a/internal/formats/common/spdxhelpers/description.go b/syft/formats/common/spdxhelpers/description.go similarity index 100% rename from internal/formats/common/spdxhelpers/description.go rename to syft/formats/common/spdxhelpers/description.go diff --git a/internal/formats/common/spdxhelpers/description_test.go b/syft/formats/common/spdxhelpers/description_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/description_test.go rename to syft/formats/common/spdxhelpers/description_test.go index e620186220e0..031a9034b5c5 100644 --- a/internal/formats/common/spdxhelpers/description_test.go +++ b/syft/formats/common/spdxhelpers/description_test.go @@ -3,8 +3,9 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_Description(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/document_name.go b/syft/formats/common/spdxhelpers/document_name.go similarity index 100% rename from internal/formats/common/spdxhelpers/document_name.go rename to syft/formats/common/spdxhelpers/document_name.go diff --git a/internal/formats/common/spdxhelpers/document_name_test.go b/syft/formats/common/spdxhelpers/document_name_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/document_name_test.go rename to syft/formats/common/spdxhelpers/document_name_test.go index e3d0ff5b5ed4..6f4392d29819 100644 --- a/internal/formats/common/spdxhelpers/document_name_test.go +++ b/syft/formats/common/spdxhelpers/document_name_test.go @@ -5,9 +5,10 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/source" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/source" ) func Test_DocumentName(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/document_namespace.go b/syft/formats/common/spdxhelpers/document_namespace.go similarity index 99% rename from internal/formats/common/spdxhelpers/document_namespace.go rename to syft/formats/common/spdxhelpers/document_namespace.go index 9110efef54c8..584713bcbf62 100644 --- a/internal/formats/common/spdxhelpers/document_namespace.go +++ b/syft/formats/common/spdxhelpers/document_namespace.go @@ -5,9 +5,10 @@ import ( "net/url" "path" + "github.com/google/uuid" + "github.com/anchore/syft/internal" "github.com/anchore/syft/syft/source" - "github.com/google/uuid" ) func DocumentNameAndNamespace(srcMetadata source.Metadata) (string, string) { diff --git a/internal/formats/common/spdxhelpers/document_namespace_test.go b/syft/formats/common/spdxhelpers/document_namespace_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/document_namespace_test.go rename to syft/formats/common/spdxhelpers/document_namespace_test.go index 12030100e3dc..5452276644f4 100644 --- a/internal/formats/common/spdxhelpers/document_namespace_test.go +++ b/syft/formats/common/spdxhelpers/document_namespace_test.go @@ -5,9 +5,10 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/source" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/source" ) func Test_documentNamespace(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/download_location.go b/syft/formats/common/spdxhelpers/download_location.go similarity index 100% rename from internal/formats/common/spdxhelpers/download_location.go rename to syft/formats/common/spdxhelpers/download_location.go diff --git a/internal/formats/common/spdxhelpers/download_location_test.go b/syft/formats/common/spdxhelpers/download_location_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/download_location_test.go rename to syft/formats/common/spdxhelpers/download_location_test.go index 42b205a1e423..5ae1d714adf7 100644 --- a/internal/formats/common/spdxhelpers/download_location_test.go +++ b/syft/formats/common/spdxhelpers/download_location_test.go @@ -3,8 +3,9 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_DownloadLocation(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/external_ref.go b/syft/formats/common/spdxhelpers/external_ref.go similarity index 100% rename from internal/formats/common/spdxhelpers/external_ref.go rename to syft/formats/common/spdxhelpers/external_ref.go diff --git a/internal/formats/common/spdxhelpers/external_refs.go b/syft/formats/common/spdxhelpers/external_refs.go similarity index 100% rename from internal/formats/common/spdxhelpers/external_refs.go rename to syft/formats/common/spdxhelpers/external_refs.go diff --git a/internal/formats/common/spdxhelpers/external_refs_test.go b/syft/formats/common/spdxhelpers/external_refs_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/external_refs_test.go rename to syft/formats/common/spdxhelpers/external_refs_test.go index 180a5c4dbd12..1ae0a224c4aa 100644 --- a/internal/formats/common/spdxhelpers/external_refs_test.go +++ b/syft/formats/common/spdxhelpers/external_refs_test.go @@ -3,8 +3,9 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_ExternalRefs(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/file_type.go b/syft/formats/common/spdxhelpers/file_type.go similarity index 100% rename from internal/formats/common/spdxhelpers/file_type.go rename to syft/formats/common/spdxhelpers/file_type.go diff --git a/internal/formats/common/spdxhelpers/homepage.go b/syft/formats/common/spdxhelpers/homepage.go similarity index 100% rename from internal/formats/common/spdxhelpers/homepage.go rename to syft/formats/common/spdxhelpers/homepage.go diff --git a/internal/formats/common/spdxhelpers/homepage_test.go b/syft/formats/common/spdxhelpers/homepage_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/homepage_test.go rename to syft/formats/common/spdxhelpers/homepage_test.go index 371f45bfb9b6..91b77b7258ab 100644 --- a/internal/formats/common/spdxhelpers/homepage_test.go +++ b/syft/formats/common/spdxhelpers/homepage_test.go @@ -3,8 +3,9 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_Homepage(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/license.go b/syft/formats/common/spdxhelpers/license.go similarity index 100% rename from internal/formats/common/spdxhelpers/license.go rename to syft/formats/common/spdxhelpers/license.go diff --git a/internal/formats/common/spdxhelpers/license_test.go b/syft/formats/common/spdxhelpers/license_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/license_test.go rename to syft/formats/common/spdxhelpers/license_test.go index 94c32f9f67c1..ee51c16c1572 100644 --- a/internal/formats/common/spdxhelpers/license_test.go +++ b/syft/formats/common/spdxhelpers/license_test.go @@ -3,8 +3,9 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_License(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/none_if_empty.go b/syft/formats/common/spdxhelpers/none_if_empty.go similarity index 100% rename from internal/formats/common/spdxhelpers/none_if_empty.go rename to syft/formats/common/spdxhelpers/none_if_empty.go diff --git a/internal/formats/common/spdxhelpers/none_if_empty_test.go b/syft/formats/common/spdxhelpers/none_if_empty_test.go similarity index 100% rename from internal/formats/common/spdxhelpers/none_if_empty_test.go rename to syft/formats/common/spdxhelpers/none_if_empty_test.go diff --git a/internal/formats/common/spdxhelpers/originator_test.go b/syft/formats/common/spdxhelpers/originator_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/originator_test.go rename to syft/formats/common/spdxhelpers/originator_test.go index be8e9e97b93f..a35c707fbf0e 100644 --- a/internal/formats/common/spdxhelpers/originator_test.go +++ b/syft/formats/common/spdxhelpers/originator_test.go @@ -3,8 +3,9 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_Originator(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/origintor.go b/syft/formats/common/spdxhelpers/origintor.go similarity index 100% rename from internal/formats/common/spdxhelpers/origintor.go rename to syft/formats/common/spdxhelpers/origintor.go diff --git a/internal/formats/common/spdxhelpers/relationship_type.go b/syft/formats/common/spdxhelpers/relationship_type.go similarity index 100% rename from internal/formats/common/spdxhelpers/relationship_type.go rename to syft/formats/common/spdxhelpers/relationship_type.go diff --git a/internal/formats/common/spdxhelpers/source_info.go b/syft/formats/common/spdxhelpers/source_info.go similarity index 100% rename from internal/formats/common/spdxhelpers/source_info.go rename to syft/formats/common/spdxhelpers/source_info.go diff --git a/internal/formats/common/spdxhelpers/source_info_test.go b/syft/formats/common/spdxhelpers/source_info_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/source_info_test.go rename to syft/formats/common/spdxhelpers/source_info_test.go index a403aed054a1..75f3987bab3d 100644 --- a/internal/formats/common/spdxhelpers/source_info_test.go +++ b/syft/formats/common/spdxhelpers/source_info_test.go @@ -3,9 +3,10 @@ package spdxhelpers import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/assert" ) func Test_SourceInfo(t *testing.T) { diff --git a/internal/formats/common/spdxhelpers/spdxid.go b/syft/formats/common/spdxhelpers/spdxid.go similarity index 100% rename from internal/formats/common/spdxhelpers/spdxid.go rename to syft/formats/common/spdxhelpers/spdxid.go diff --git a/internal/formats/common/spdxhelpers/spdxid_test.go b/syft/formats/common/spdxhelpers/spdxid_test.go similarity index 100% rename from internal/formats/common/spdxhelpers/spdxid_test.go rename to syft/formats/common/spdxhelpers/spdxid_test.go diff --git a/internal/formats/common/spdxhelpers/to_syft_model.go b/syft/formats/common/spdxhelpers/to_syft_model.go similarity index 100% rename from internal/formats/common/spdxhelpers/to_syft_model.go rename to syft/formats/common/spdxhelpers/to_syft_model.go diff --git a/internal/formats/common/spdxhelpers/to_syft_model_test.go b/syft/formats/common/spdxhelpers/to_syft_model_test.go similarity index 99% rename from internal/formats/common/spdxhelpers/to_syft_model_test.go rename to syft/formats/common/spdxhelpers/to_syft_model_test.go index 9f09b3da2181..10d35bac6f8f 100644 --- a/internal/formats/common/spdxhelpers/to_syft_model_test.go +++ b/syft/formats/common/spdxhelpers/to_syft_model_test.go @@ -3,11 +3,12 @@ package spdxhelpers import ( "testing" - "github.com/anchore/syft/syft/pkg" - "github.com/anchore/syft/syft/source" "github.com/spdx/tools-golang/spdx" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestToSyftModel(t *testing.T) { diff --git a/internal/formats/common/testutils/utils.go b/syft/formats/common/testutils/utils.go similarity index 99% rename from internal/formats/common/testutils/utils.go rename to syft/formats/common/testutils/utils.go index b1004d506fb8..5276c46e5d6b 100644 --- a/internal/formats/common/testutils/utils.go +++ b/syft/formats/common/testutils/utils.go @@ -5,6 +5,9 @@ import ( "strings" "testing" + "github.com/sergi/go-diff/diffmatchpatch" + "github.com/stretchr/testify/assert" + "github.com/anchore/go-testutils" "github.com/anchore/stereoscope/pkg/filetree" "github.com/anchore/stereoscope/pkg/image" @@ -13,8 +16,6 @@ import ( "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/sergi/go-diff/diffmatchpatch" - "github.com/stretchr/testify/assert" ) type redactor func(s []byte) []byte diff --git a/internal/formats/cyclonedxjson/decoder_test.go b/syft/formats/cyclonedxjson/decoder_test.go similarity index 100% rename from internal/formats/cyclonedxjson/decoder_test.go rename to syft/formats/cyclonedxjson/decoder_test.go diff --git a/internal/formats/cyclonedxjson/encoder.go b/syft/formats/cyclonedxjson/encoder.go similarity index 83% rename from internal/formats/cyclonedxjson/encoder.go rename to syft/formats/cyclonedxjson/encoder.go index aa8302915261..3281d2eaf682 100644 --- a/internal/formats/cyclonedxjson/encoder.go +++ b/syft/formats/cyclonedxjson/encoder.go @@ -4,7 +4,8 @@ import ( "io" "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/internal/formats/common/cyclonedxhelpers" + + "github.com/anchore/syft/syft/formats/common/cyclonedxhelpers" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/cyclonedxjson/encoder_test.go b/syft/formats/cyclonedxjson/encoder_test.go similarity index 95% rename from internal/formats/cyclonedxjson/encoder_test.go rename to syft/formats/cyclonedxjson/encoder_test.go index 06ad8293c44a..2928a28cf16a 100644 --- a/internal/formats/cyclonedxjson/encoder_test.go +++ b/syft/formats/cyclonedxjson/encoder_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" + "github.com/anchore/syft/syft/formats/common/testutils" ) var updateCycloneDx = flag.Bool("update-cyclonedx", false, "update the *.golden files for cyclone-dx encoders") diff --git a/internal/formats/cyclonedxjson/format.go b/syft/formats/cyclonedxjson/format.go similarity index 83% rename from internal/formats/cyclonedxjson/format.go rename to syft/formats/cyclonedxjson/format.go index 9802120919bb..14b3005fded5 100644 --- a/internal/formats/cyclonedxjson/format.go +++ b/syft/formats/cyclonedxjson/format.go @@ -2,7 +2,8 @@ package cyclonedxjson import ( "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/internal/formats/common/cyclonedxhelpers" + + "github.com/anchore/syft/syft/formats/common/cyclonedxhelpers" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/cyclonedxjson/test-fixtures/image-simple/Dockerfile b/syft/formats/cyclonedxjson/test-fixtures/image-simple/Dockerfile similarity index 100% rename from internal/formats/cyclonedxjson/test-fixtures/image-simple/Dockerfile rename to syft/formats/cyclonedxjson/test-fixtures/image-simple/Dockerfile diff --git a/internal/formats/cyclonedxjson/test-fixtures/image-simple/file-1.txt b/syft/formats/cyclonedxjson/test-fixtures/image-simple/file-1.txt similarity index 100% rename from internal/formats/cyclonedxjson/test-fixtures/image-simple/file-1.txt rename to syft/formats/cyclonedxjson/test-fixtures/image-simple/file-1.txt diff --git a/internal/formats/cyclonedxjson/test-fixtures/image-simple/file-2.txt b/syft/formats/cyclonedxjson/test-fixtures/image-simple/file-2.txt similarity index 100% rename from internal/formats/cyclonedxjson/test-fixtures/image-simple/file-2.txt rename to syft/formats/cyclonedxjson/test-fixtures/image-simple/file-2.txt diff --git a/internal/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden b/syft/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden similarity index 100% rename from internal/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden rename to syft/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden diff --git a/internal/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden b/syft/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden similarity index 100% rename from internal/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden rename to syft/formats/cyclonedxjson/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden diff --git a/internal/formats/cyclonedxjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden b/syft/formats/cyclonedxjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden similarity index 100% rename from internal/formats/cyclonedxjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden rename to syft/formats/cyclonedxjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden diff --git a/internal/formats/cyclonedxxml/decoder_test.go b/syft/formats/cyclonedxxml/decoder_test.go similarity index 100% rename from internal/formats/cyclonedxxml/decoder_test.go rename to syft/formats/cyclonedxxml/decoder_test.go diff --git a/internal/formats/cyclonedxxml/encoder.go b/syft/formats/cyclonedxxml/encoder.go similarity index 83% rename from internal/formats/cyclonedxxml/encoder.go rename to syft/formats/cyclonedxxml/encoder.go index 315fcd0c2ee9..b8abdf81a158 100644 --- a/internal/formats/cyclonedxxml/encoder.go +++ b/syft/formats/cyclonedxxml/encoder.go @@ -4,7 +4,8 @@ import ( "io" "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/internal/formats/common/cyclonedxhelpers" + + "github.com/anchore/syft/syft/formats/common/cyclonedxhelpers" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/cyclonedxxml/encoder_test.go b/syft/formats/cyclonedxxml/encoder_test.go similarity index 96% rename from internal/formats/cyclonedxxml/encoder_test.go rename to syft/formats/cyclonedxxml/encoder_test.go index 5c4129aa74a1..3d677272c94a 100644 --- a/internal/formats/cyclonedxxml/encoder_test.go +++ b/syft/formats/cyclonedxxml/encoder_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" + "github.com/anchore/syft/syft/formats/common/testutils" ) var updateCycloneDx = flag.Bool("update-cyclonedx", false, "update the *.golden files for cyclone-dx encoders") diff --git a/internal/formats/cyclonedxxml/format.go b/syft/formats/cyclonedxxml/format.go similarity index 83% rename from internal/formats/cyclonedxxml/format.go rename to syft/formats/cyclonedxxml/format.go index 07ac3ad297fb..de1e57cb0dac 100644 --- a/internal/formats/cyclonedxxml/format.go +++ b/syft/formats/cyclonedxxml/format.go @@ -2,7 +2,8 @@ package cyclonedxxml import ( "github.com/CycloneDX/cyclonedx-go" - "github.com/anchore/syft/internal/formats/common/cyclonedxhelpers" + + "github.com/anchore/syft/syft/formats/common/cyclonedxhelpers" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/cyclonedxxml/test-fixtures/image-simple/Dockerfile b/syft/formats/cyclonedxxml/test-fixtures/image-simple/Dockerfile similarity index 100% rename from internal/formats/cyclonedxxml/test-fixtures/image-simple/Dockerfile rename to syft/formats/cyclonedxxml/test-fixtures/image-simple/Dockerfile diff --git a/internal/formats/cyclonedxxml/test-fixtures/image-simple/file-1.txt b/syft/formats/cyclonedxxml/test-fixtures/image-simple/file-1.txt similarity index 100% rename from internal/formats/cyclonedxxml/test-fixtures/image-simple/file-1.txt rename to syft/formats/cyclonedxxml/test-fixtures/image-simple/file-1.txt diff --git a/internal/formats/cyclonedxxml/test-fixtures/image-simple/file-2.txt b/syft/formats/cyclonedxxml/test-fixtures/image-simple/file-2.txt similarity index 100% rename from internal/formats/cyclonedxxml/test-fixtures/image-simple/file-2.txt rename to syft/formats/cyclonedxxml/test-fixtures/image-simple/file-2.txt diff --git a/internal/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden b/syft/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden similarity index 100% rename from internal/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden rename to syft/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxDirectoryEncoder.golden diff --git a/internal/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden b/syft/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden similarity index 100% rename from internal/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden rename to syft/formats/cyclonedxxml/test-fixtures/snapshot/TestCycloneDxImageEncoder.golden diff --git a/internal/formats/cyclonedxxml/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden b/syft/formats/cyclonedxxml/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden similarity index 100% rename from internal/formats/cyclonedxxml/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden rename to syft/formats/cyclonedxxml/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden diff --git a/internal/formats/github/encoder.go b/syft/formats/github/encoder.go similarity index 100% rename from internal/formats/github/encoder.go rename to syft/formats/github/encoder.go diff --git a/internal/formats/github/encoder_test.go b/syft/formats/github/encoder_test.go similarity index 100% rename from internal/formats/github/encoder_test.go rename to syft/formats/github/encoder_test.go diff --git a/internal/formats/github/format.go b/syft/formats/github/format.go similarity index 100% rename from internal/formats/github/format.go rename to syft/formats/github/format.go diff --git a/internal/formats/github/github_dependency_api.go b/syft/formats/github/github_dependency_api.go similarity index 100% rename from internal/formats/github/github_dependency_api.go rename to syft/formats/github/github_dependency_api.go diff --git a/internal/formats/spdx22json/decoder.go b/syft/formats/spdx22json/decoder.go similarity index 90% rename from internal/formats/spdx22json/decoder.go rename to syft/formats/spdx22json/decoder.go index f037cd5f402d..1e1bbb978171 100644 --- a/internal/formats/spdx22json/decoder.go +++ b/syft/formats/spdx22json/decoder.go @@ -6,7 +6,7 @@ import ( "github.com/spdx/tools-golang/jsonloader" - "github.com/anchore/syft/internal/formats/common/spdxhelpers" + "github.com/anchore/syft/syft/formats/common/spdxhelpers" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/spdx22json/decoder_test.go b/syft/formats/spdx22json/decoder_test.go similarity index 99% rename from internal/formats/spdx22json/decoder_test.go rename to syft/formats/spdx22json/decoder_test.go index 6f718dc4d7a1..004b14d76e7e 100644 --- a/internal/formats/spdx22json/decoder_test.go +++ b/syft/formats/spdx22json/decoder_test.go @@ -5,8 +5,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func TestSPDXJSONDecoder(t *testing.T) { diff --git a/internal/formats/spdx22json/encoder.go b/syft/formats/spdx22json/encoder.go similarity index 100% rename from internal/formats/spdx22json/encoder.go rename to syft/formats/spdx22json/encoder.go diff --git a/internal/formats/spdx22json/encoder_test.go b/syft/formats/spdx22json/encoder_test.go similarity index 95% rename from internal/formats/spdx22json/encoder_test.go rename to syft/formats/spdx22json/encoder_test.go index ef5ccfce96e9..77b0d35de811 100644 --- a/internal/formats/spdx22json/encoder_test.go +++ b/syft/formats/spdx22json/encoder_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" + "github.com/anchore/syft/syft/formats/common/testutils" ) var updateSpdxJson = flag.Bool("update-spdx-json", false, "update the *.golden files for spdx-json encoders") diff --git a/internal/formats/spdx22json/format.go b/syft/formats/spdx22json/format.go similarity index 100% rename from internal/formats/spdx22json/format.go rename to syft/formats/spdx22json/format.go diff --git a/internal/formats/spdx22json/model/annotation.go b/syft/formats/spdx22json/model/annotation.go similarity index 100% rename from internal/formats/spdx22json/model/annotation.go rename to syft/formats/spdx22json/model/annotation.go diff --git a/internal/formats/spdx22json/model/checksum.go b/syft/formats/spdx22json/model/checksum.go similarity index 100% rename from internal/formats/spdx22json/model/checksum.go rename to syft/formats/spdx22json/model/checksum.go diff --git a/internal/formats/spdx22json/model/creation_info.go b/syft/formats/spdx22json/model/creation_info.go similarity index 100% rename from internal/formats/spdx22json/model/creation_info.go rename to syft/formats/spdx22json/model/creation_info.go diff --git a/internal/formats/spdx22json/model/document.go b/syft/formats/spdx22json/model/document.go similarity index 100% rename from internal/formats/spdx22json/model/document.go rename to syft/formats/spdx22json/model/document.go diff --git a/internal/formats/spdx22json/model/element.go b/syft/formats/spdx22json/model/element.go similarity index 100% rename from internal/formats/spdx22json/model/element.go rename to syft/formats/spdx22json/model/element.go diff --git a/internal/formats/spdx22json/model/element_id.go b/syft/formats/spdx22json/model/element_id.go similarity index 85% rename from internal/formats/spdx22json/model/element_id.go rename to syft/formats/spdx22json/model/element_id.go index 0973ce4bd211..45f65da097ee 100644 --- a/internal/formats/spdx22json/model/element_id.go +++ b/syft/formats/spdx22json/model/element_id.go @@ -1,6 +1,6 @@ package model -import "github.com/anchore/syft/internal/formats/common/spdxhelpers" +import "github.com/anchore/syft/syft/formats/common/spdxhelpers" // ElementID represents the identifier string portion of an SPDX element // identifier. DocElementID should be used for any attributes which can diff --git a/internal/formats/spdx22json/model/external_document_ref.go b/syft/formats/spdx22json/model/external_document_ref.go similarity index 100% rename from internal/formats/spdx22json/model/external_document_ref.go rename to syft/formats/spdx22json/model/external_document_ref.go diff --git a/internal/formats/spdx22json/model/file.go b/syft/formats/spdx22json/model/file.go similarity index 100% rename from internal/formats/spdx22json/model/file.go rename to syft/formats/spdx22json/model/file.go diff --git a/internal/formats/spdx22json/model/has_extracted_licensing_info.go b/syft/formats/spdx22json/model/has_extracted_licensing_info.go similarity index 100% rename from internal/formats/spdx22json/model/has_extracted_licensing_info.go rename to syft/formats/spdx22json/model/has_extracted_licensing_info.go diff --git a/internal/formats/spdx22json/model/item.go b/syft/formats/spdx22json/model/item.go similarity index 100% rename from internal/formats/spdx22json/model/item.go rename to syft/formats/spdx22json/model/item.go diff --git a/internal/formats/spdx22json/model/package.go b/syft/formats/spdx22json/model/package.go similarity index 98% rename from internal/formats/spdx22json/model/package.go rename to syft/formats/spdx22json/model/package.go index a4808e7e21e0..711c859412fc 100644 --- a/internal/formats/spdx22json/model/package.go +++ b/syft/formats/spdx22json/model/package.go @@ -1,6 +1,6 @@ package model -import "github.com/anchore/syft/internal/formats/common/spdxhelpers" +import "github.com/anchore/syft/syft/formats/common/spdxhelpers" type Package struct { Item diff --git a/internal/formats/spdx22json/model/package_verification_code.go b/syft/formats/spdx22json/model/package_verification_code.go similarity index 100% rename from internal/formats/spdx22json/model/package_verification_code.go rename to syft/formats/spdx22json/model/package_verification_code.go diff --git a/internal/formats/spdx22json/model/relationship.go b/syft/formats/spdx22json/model/relationship.go similarity index 86% rename from internal/formats/spdx22json/model/relationship.go rename to syft/formats/spdx22json/model/relationship.go index 9c806c41c124..272246302f6e 100644 --- a/internal/formats/spdx22json/model/relationship.go +++ b/syft/formats/spdx22json/model/relationship.go @@ -1,6 +1,6 @@ package model -import "github.com/anchore/syft/internal/formats/common/spdxhelpers" +import "github.com/anchore/syft/syft/formats/common/spdxhelpers" type Relationship struct { // Id to which the SPDX element is related diff --git a/internal/formats/spdx22json/model/snippet.go b/syft/formats/spdx22json/model/snippet.go similarity index 100% rename from internal/formats/spdx22json/model/snippet.go rename to syft/formats/spdx22json/model/snippet.go diff --git a/internal/formats/spdx22json/model/version.go b/syft/formats/spdx22json/model/version.go similarity index 100% rename from internal/formats/spdx22json/model/version.go rename to syft/formats/spdx22json/model/version.go diff --git a/internal/formats/spdx22json/test-fixtures/image-simple/Dockerfile b/syft/formats/spdx22json/test-fixtures/image-simple/Dockerfile similarity index 100% rename from internal/formats/spdx22json/test-fixtures/image-simple/Dockerfile rename to syft/formats/spdx22json/test-fixtures/image-simple/Dockerfile diff --git a/internal/formats/spdx22json/test-fixtures/image-simple/file-1.txt b/syft/formats/spdx22json/test-fixtures/image-simple/file-1.txt similarity index 100% rename from internal/formats/spdx22json/test-fixtures/image-simple/file-1.txt rename to syft/formats/spdx22json/test-fixtures/image-simple/file-1.txt diff --git a/internal/formats/spdx22json/test-fixtures/image-simple/file-2.txt b/syft/formats/spdx22json/test-fixtures/image-simple/file-2.txt similarity index 100% rename from internal/formats/spdx22json/test-fixtures/image-simple/file-2.txt rename to syft/formats/spdx22json/test-fixtures/image-simple/file-2.txt diff --git a/internal/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONDirectoryEncoder.golden b/syft/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONDirectoryEncoder.golden similarity index 100% rename from internal/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONDirectoryEncoder.golden rename to syft/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONDirectoryEncoder.golden diff --git a/internal/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONImageEncoder.golden b/syft/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONImageEncoder.golden similarity index 100% rename from internal/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONImageEncoder.golden rename to syft/formats/spdx22json/test-fixtures/snapshot/TestSPDXJSONImageEncoder.golden diff --git a/internal/formats/spdx22json/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden b/syft/formats/spdx22json/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden similarity index 100% rename from internal/formats/spdx22json/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden rename to syft/formats/spdx22json/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden diff --git a/internal/formats/spdx22json/test-fixtures/spdx/alpine-3.10.syft.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/alpine-3.10.syft.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/alpine-3.10.syft.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/alpine-3.10.syft.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/alpine-3.10.vendor.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/alpine-3.10.vendor.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/alpine-3.10.vendor.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/alpine-3.10.vendor.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/bad/example7-bin.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/bad/example7-bin.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/bad/example7-bin.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/bad/example7-bin.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/bad/example7-go-module.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/bad/example7-go-module.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/bad/example7-go-module.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/bad/example7-go-module.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/bad/example7-golang.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/bad/example7-golang.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/bad/example7-golang.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/bad/example7-golang.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/bad/example7-third-party-modules.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/bad/example7-third-party-modules.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/bad/example7-third-party-modules.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/bad/example7-third-party-modules.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/example7-bin.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/example7-bin.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/example7-bin.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/example7-bin.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/example7-go-module.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/example7-go-module.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/example7-go-module.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/example7-go-module.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/example7-golang.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/example7-golang.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/example7-golang.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/example7-golang.spdx.json diff --git a/internal/formats/spdx22json/test-fixtures/spdx/example7-third-party-modules.spdx.json b/syft/formats/spdx22json/test-fixtures/spdx/example7-third-party-modules.spdx.json similarity index 100% rename from internal/formats/spdx22json/test-fixtures/spdx/example7-third-party-modules.spdx.json rename to syft/formats/spdx22json/test-fixtures/spdx/example7-third-party-modules.spdx.json diff --git a/internal/formats/spdx22json/to_format_model.go b/syft/formats/spdx22json/to_format_model.go similarity index 98% rename from internal/formats/spdx22json/to_format_model.go rename to syft/formats/spdx22json/to_format_model.go index d1f3d3d4678a..e232014e63f1 100644 --- a/internal/formats/spdx22json/to_format_model.go +++ b/syft/formats/spdx22json/to_format_model.go @@ -7,12 +7,12 @@ import ( "time" "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/formats/common/spdxhelpers" - "github.com/anchore/syft/internal/formats/spdx22json/model" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/internal/spdxlicense" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/formats/common/spdxhelpers" + "github.com/anchore/syft/syft/formats/spdx22json/model" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" diff --git a/internal/formats/spdx22json/to_format_model_test.go b/syft/formats/spdx22json/to_format_model_test.go similarity index 97% rename from internal/formats/spdx22json/to_format_model_test.go rename to syft/formats/spdx22json/to_format_model_test.go index ee4c1ed11449..2845568b9698 100644 --- a/internal/formats/spdx22json/to_format_model_test.go +++ b/syft/formats/spdx22json/to_format_model_test.go @@ -3,16 +3,14 @@ package spdx22json import ( "testing" - "github.com/anchore/syft/syft/pkg" - - "github.com/anchore/syft/syft/file" + "github.com/stretchr/testify/assert" "github.com/anchore/syft/syft/artifact" - - "github.com/anchore/syft/internal/formats/common/spdxhelpers" - "github.com/anchore/syft/internal/formats/spdx22json/model" + "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/formats/common/spdxhelpers" + "github.com/anchore/syft/syft/formats/spdx22json/model" + "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/assert" ) func Test_toFileTypes(t *testing.T) { diff --git a/internal/formats/spdx22json/validator.go b/syft/formats/spdx22json/validator.go similarity index 100% rename from internal/formats/spdx22json/validator.go rename to syft/formats/spdx22json/validator.go diff --git a/internal/formats/spdx22tagvalue/decoder.go b/syft/formats/spdx22tagvalue/decoder.go similarity index 84% rename from internal/formats/spdx22tagvalue/decoder.go rename to syft/formats/spdx22tagvalue/decoder.go index adce71c36041..a54ff98f0669 100644 --- a/internal/formats/spdx22tagvalue/decoder.go +++ b/syft/formats/spdx22tagvalue/decoder.go @@ -6,7 +6,7 @@ import ( "github.com/spdx/tools-golang/tvloader" - "github.com/anchore/syft/internal/formats/common/spdxhelpers" + "github.com/anchore/syft/syft/formats/common/spdxhelpers" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/spdx22tagvalue/encoder.go b/syft/formats/spdx22tagvalue/encoder.go similarity index 99% rename from internal/formats/spdx22tagvalue/encoder.go rename to syft/formats/spdx22tagvalue/encoder.go index 6f9fdf5d8430..c195391c2739 100644 --- a/internal/formats/spdx22tagvalue/encoder.go +++ b/syft/formats/spdx22tagvalue/encoder.go @@ -3,8 +3,9 @@ package spdx22tagvalue import ( "io" - "github.com/anchore/syft/syft/sbom" "github.com/spdx/tools-golang/tvsaver" + + "github.com/anchore/syft/syft/sbom" ) func encoder(output io.Writer, s sbom.SBOM) error { diff --git a/internal/formats/spdx22tagvalue/encoder_test.go b/syft/formats/spdx22tagvalue/encoder_test.go similarity index 97% rename from internal/formats/spdx22tagvalue/encoder_test.go rename to syft/formats/spdx22tagvalue/encoder_test.go index 83992655d9c4..f479d2715eb8 100644 --- a/internal/formats/spdx22tagvalue/encoder_test.go +++ b/syft/formats/spdx22tagvalue/encoder_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" + "github.com/anchore/syft/syft/formats/common/testutils" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" diff --git a/internal/formats/spdx22tagvalue/format.go b/syft/formats/spdx22tagvalue/format.go similarity index 100% rename from internal/formats/spdx22tagvalue/format.go rename to syft/formats/spdx22tagvalue/format.go diff --git a/internal/formats/spdx22tagvalue/test-fixtures/image-simple/Dockerfile b/syft/formats/spdx22tagvalue/test-fixtures/image-simple/Dockerfile similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/image-simple/Dockerfile rename to syft/formats/spdx22tagvalue/test-fixtures/image-simple/Dockerfile diff --git a/internal/formats/spdx22tagvalue/test-fixtures/image-simple/file-1.txt b/syft/formats/spdx22tagvalue/test-fixtures/image-simple/file-1.txt similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/image-simple/file-1.txt rename to syft/formats/spdx22tagvalue/test-fixtures/image-simple/file-1.txt diff --git a/internal/formats/spdx22tagvalue/test-fixtures/image-simple/file-2.txt b/syft/formats/spdx22tagvalue/test-fixtures/image-simple/file-2.txt similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/image-simple/file-2.txt rename to syft/formats/spdx22tagvalue/test-fixtures/image-simple/file-2.txt diff --git a/internal/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXJSONSPDXIDs.golden b/syft/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXJSONSPDXIDs.golden similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXJSONSPDXIDs.golden rename to syft/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXJSONSPDXIDs.golden diff --git a/internal/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueDirectoryEncoder.golden b/syft/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueDirectoryEncoder.golden similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueDirectoryEncoder.golden rename to syft/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueDirectoryEncoder.golden diff --git a/internal/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueImageEncoder.golden b/syft/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueImageEncoder.golden similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueImageEncoder.golden rename to syft/formats/spdx22tagvalue/test-fixtures/snapshot/TestSPDXTagValueImageEncoder.golden diff --git a/internal/formats/spdx22tagvalue/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden b/syft/formats/spdx22tagvalue/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden similarity index 100% rename from internal/formats/spdx22tagvalue/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden rename to syft/formats/spdx22tagvalue/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden diff --git a/internal/formats/spdx22tagvalue/to_format_model.go b/syft/formats/spdx22tagvalue/to_format_model.go similarity index 99% rename from internal/formats/spdx22tagvalue/to_format_model.go rename to syft/formats/spdx22tagvalue/to_format_model.go index 41296665ee26..ae4c004776c7 100644 --- a/internal/formats/spdx22tagvalue/to_format_model.go +++ b/syft/formats/spdx22tagvalue/to_format_model.go @@ -4,13 +4,13 @@ import ( "fmt" "time" - "github.com/anchore/syft/syft/sbom" + "github.com/spdx/tools-golang/spdx" "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/formats/common/spdxhelpers" "github.com/anchore/syft/internal/spdxlicense" + "github.com/anchore/syft/syft/formats/common/spdxhelpers" "github.com/anchore/syft/syft/pkg" - "github.com/spdx/tools-golang/spdx" + "github.com/anchore/syft/syft/sbom" ) // toFormatModel creates and populates a new JSON document struct that follows the SPDX 2.2 spec from the given cataloging results. diff --git a/internal/formats/spdx22tagvalue/validator.go b/syft/formats/spdx22tagvalue/validator.go similarity index 100% rename from internal/formats/spdx22tagvalue/validator.go rename to syft/formats/spdx22tagvalue/validator.go diff --git a/internal/formats/syftjson/decoder.go b/syft/formats/syftjson/decoder.go similarity index 85% rename from internal/formats/syftjson/decoder.go rename to syft/formats/syftjson/decoder.go index 95f16fdd2234..b6286bd97c64 100644 --- a/internal/formats/syftjson/decoder.go +++ b/syft/formats/syftjson/decoder.go @@ -5,9 +5,8 @@ import ( "fmt" "io" + "github.com/anchore/syft/syft/formats/syftjson/model" "github.com/anchore/syft/syft/sbom" - - "github.com/anchore/syft/internal/formats/syftjson/model" ) func decoder(reader io.Reader) (*sbom.SBOM, error) { diff --git a/internal/formats/syftjson/decoder_test.go b/syft/formats/syftjson/decoder_test.go similarity index 95% rename from internal/formats/syftjson/decoder_test.go rename to syft/formats/syftjson/decoder_test.go index 3dc069fc2bda..ed9043b8b75c 100644 --- a/internal/formats/syftjson/decoder_test.go +++ b/syft/formats/syftjson/decoder_test.go @@ -5,9 +5,10 @@ import ( "strings" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" "github.com/go-test/deep" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/formats/common/testutils" ) func TestEncodeDecodeCycle(t *testing.T) { diff --git a/internal/formats/syftjson/encoder.go b/syft/formats/syftjson/encoder.go similarity index 100% rename from internal/formats/syftjson/encoder.go rename to syft/formats/syftjson/encoder.go diff --git a/internal/formats/syftjson/encoder_test.go b/syft/formats/syftjson/encoder_test.go similarity index 98% rename from internal/formats/syftjson/encoder_test.go rename to syft/formats/syftjson/encoder_test.go index 9d8087d5e84d..22d66e1f2866 100644 --- a/internal/formats/syftjson/encoder_test.go +++ b/syft/formats/syftjson/encoder_test.go @@ -4,16 +4,13 @@ import ( "flag" "testing" - "github.com/anchore/syft/syft/file" - "github.com/anchore/syft/syft/artifact" - + "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/formats/common/testutils" "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - - "github.com/anchore/syft/internal/formats/common/testutils" ) var updateJson = flag.Bool("update-json", false, "update the *.golden files for json encoders") diff --git a/internal/formats/syftjson/format.go b/syft/formats/syftjson/format.go similarity index 100% rename from internal/formats/syftjson/format.go rename to syft/formats/syftjson/format.go diff --git a/internal/formats/syftjson/model/document.go b/syft/formats/syftjson/model/document.go similarity index 100% rename from internal/formats/syftjson/model/document.go rename to syft/formats/syftjson/model/document.go diff --git a/internal/formats/syftjson/model/file.go b/syft/formats/syftjson/model/file.go similarity index 99% rename from internal/formats/syftjson/model/file.go rename to syft/formats/syftjson/model/file.go index be2c88df3bbb..10e1249dbafd 100644 --- a/internal/formats/syftjson/model/file.go +++ b/syft/formats/syftjson/model/file.go @@ -2,7 +2,6 @@ package model import ( "github.com/anchore/syft/syft/file" - "github.com/anchore/syft/syft/source" ) diff --git a/internal/formats/syftjson/model/linux_release.go b/syft/formats/syftjson/model/linux_release.go similarity index 100% rename from internal/formats/syftjson/model/linux_release.go rename to syft/formats/syftjson/model/linux_release.go diff --git a/internal/formats/syftjson/model/linux_release_test.go b/syft/formats/syftjson/model/linux_release_test.go similarity index 100% rename from internal/formats/syftjson/model/linux_release_test.go rename to syft/formats/syftjson/model/linux_release_test.go diff --git a/internal/formats/syftjson/model/package.go b/syft/formats/syftjson/model/package.go similarity index 99% rename from internal/formats/syftjson/model/package.go rename to syft/formats/syftjson/model/package.go index 12ef3c335452..7249af296e01 100644 --- a/internal/formats/syftjson/model/package.go +++ b/syft/formats/syftjson/model/package.go @@ -5,10 +5,9 @@ import ( "errors" "fmt" - "github.com/anchore/syft/syft/source" - "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) var errUnknownMetadataType = errors.New("unknown metadata type") diff --git a/internal/formats/syftjson/model/package_test.go b/syft/formats/syftjson/model/package_test.go similarity index 99% rename from internal/formats/syftjson/model/package_test.go rename to syft/formats/syftjson/model/package_test.go index da282f4260f8..0887a4e0a3a3 100644 --- a/internal/formats/syftjson/model/package_test.go +++ b/syft/formats/syftjson/model/package_test.go @@ -2,10 +2,12 @@ package model import ( "encoding/json" - "github.com/anchore/syft/syft/pkg" + "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" + + "github.com/anchore/syft/syft/pkg" ) func TestUnmarshalPackageGolang(t *testing.T) { diff --git a/internal/formats/syftjson/model/relationship.go b/syft/formats/syftjson/model/relationship.go similarity index 100% rename from internal/formats/syftjson/model/relationship.go rename to syft/formats/syftjson/model/relationship.go diff --git a/internal/formats/syftjson/model/secrets.go b/syft/formats/syftjson/model/secrets.go similarity index 100% rename from internal/formats/syftjson/model/secrets.go rename to syft/formats/syftjson/model/secrets.go diff --git a/internal/formats/syftjson/model/source.go b/syft/formats/syftjson/model/source.go similarity index 100% rename from internal/formats/syftjson/model/source.go rename to syft/formats/syftjson/model/source.go diff --git a/internal/formats/syftjson/model/source_test.go b/syft/formats/syftjson/model/source_test.go similarity index 99% rename from internal/formats/syftjson/model/source_test.go rename to syft/formats/syftjson/model/source_test.go index cedf06e9deca..bcd4b9bd102f 100644 --- a/internal/formats/syftjson/model/source_test.go +++ b/syft/formats/syftjson/model/source_test.go @@ -4,11 +4,10 @@ import ( "encoding/json" "testing" - "github.com/anchore/syft/syft/source" - "github.com/google/go-cmp/cmp" - "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/source" ) func TestSource_UnmarshalJSON(t *testing.T) { diff --git a/internal/formats/syftjson/test-fixtures/image-simple/Dockerfile b/syft/formats/syftjson/test-fixtures/image-simple/Dockerfile similarity index 100% rename from internal/formats/syftjson/test-fixtures/image-simple/Dockerfile rename to syft/formats/syftjson/test-fixtures/image-simple/Dockerfile diff --git a/internal/formats/syftjson/test-fixtures/image-simple/file-1.txt b/syft/formats/syftjson/test-fixtures/image-simple/file-1.txt similarity index 100% rename from internal/formats/syftjson/test-fixtures/image-simple/file-1.txt rename to syft/formats/syftjson/test-fixtures/image-simple/file-1.txt diff --git a/internal/formats/syftjson/test-fixtures/image-simple/file-2.txt b/syft/formats/syftjson/test-fixtures/image-simple/file-2.txt similarity index 100% rename from internal/formats/syftjson/test-fixtures/image-simple/file-2.txt rename to syft/formats/syftjson/test-fixtures/image-simple/file-2.txt diff --git a/internal/formats/syftjson/test-fixtures/snapshot/TestDirectoryEncoder.golden b/syft/formats/syftjson/test-fixtures/snapshot/TestDirectoryEncoder.golden similarity index 100% rename from internal/formats/syftjson/test-fixtures/snapshot/TestDirectoryEncoder.golden rename to syft/formats/syftjson/test-fixtures/snapshot/TestDirectoryEncoder.golden diff --git a/internal/formats/syftjson/test-fixtures/snapshot/TestEncodeFullJSONDocument.golden b/syft/formats/syftjson/test-fixtures/snapshot/TestEncodeFullJSONDocument.golden similarity index 100% rename from internal/formats/syftjson/test-fixtures/snapshot/TestEncodeFullJSONDocument.golden rename to syft/formats/syftjson/test-fixtures/snapshot/TestEncodeFullJSONDocument.golden diff --git a/internal/formats/syftjson/test-fixtures/snapshot/TestImageEncoder.golden b/syft/formats/syftjson/test-fixtures/snapshot/TestImageEncoder.golden similarity index 100% rename from internal/formats/syftjson/test-fixtures/snapshot/TestImageEncoder.golden rename to syft/formats/syftjson/test-fixtures/snapshot/TestImageEncoder.golden diff --git a/internal/formats/syftjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden b/syft/formats/syftjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden similarity index 100% rename from internal/formats/syftjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden rename to syft/formats/syftjson/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden diff --git a/internal/formats/syftjson/to_format_model.go b/syft/formats/syftjson/to_format_model.go similarity index 99% rename from internal/formats/syftjson/to_format_model.go rename to syft/formats/syftjson/to_format_model.go index b97e22725051..2d5fd84ab0b3 100644 --- a/internal/formats/syftjson/to_format_model.go +++ b/syft/formats/syftjson/to_format_model.go @@ -5,18 +5,14 @@ import ( "sort" "strconv" - "github.com/anchore/syft/syft/linux" - - "github.com/anchore/syft/syft/file" - - "github.com/anchore/syft/syft/artifact" - - "github.com/anchore/syft/syft/sbom" - "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/formats/syftjson/model" "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/file" + "github.com/anchore/syft/syft/formats/syftjson/model" + "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" ) diff --git a/internal/formats/syftjson/to_format_model_test.go b/syft/formats/syftjson/to_format_model_test.go similarity index 97% rename from internal/formats/syftjson/to_format_model_test.go rename to syft/formats/syftjson/to_format_model_test.go index 18d67936dc00..b09c74ac1826 100644 --- a/internal/formats/syftjson/to_format_model_test.go +++ b/syft/formats/syftjson/to_format_model_test.go @@ -4,11 +4,11 @@ import ( "testing" "github.com/scylladb/go-set/strset" - - "github.com/anchore/syft/internal/formats/syftjson/model" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/formats/syftjson/model" + "github.com/anchore/syft/syft/source" ) func Test_toSourceModel(t *testing.T) { diff --git a/internal/formats/syftjson/to_syft_model.go b/syft/formats/syftjson/to_syft_model.go similarity index 98% rename from internal/formats/syftjson/to_syft_model.go rename to syft/formats/syftjson/to_syft_model.go index 992c724767f6..8a97ae68fadd 100644 --- a/internal/formats/syftjson/to_syft_model.go +++ b/syft/formats/syftjson/to_syft_model.go @@ -1,14 +1,15 @@ package syftjson import ( - "github.com/anchore/syft/internal/formats/syftjson/model" + "github.com/google/go-cmp/cmp" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/formats/syftjson/model" "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/google/go-cmp/cmp" ) func toSyftModel(doc model.Document) (*sbom.SBOM, error) { diff --git a/internal/formats/syftjson/to_syft_model_test.go b/syft/formats/syftjson/to_syft_model_test.go similarity index 97% rename from internal/formats/syftjson/to_syft_model_test.go rename to syft/formats/syftjson/to_syft_model_test.go index 277106b8e457..1e7b86c3d24c 100644 --- a/internal/formats/syftjson/to_syft_model_test.go +++ b/syft/formats/syftjson/to_syft_model_test.go @@ -3,11 +3,12 @@ package syftjson import ( "testing" - "github.com/anchore/syft/internal/formats/syftjson/model" - "github.com/anchore/syft/syft/artifact" - "github.com/anchore/syft/syft/source" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/formats/syftjson/model" + "github.com/anchore/syft/syft/source" ) func Test_toSyftSourceData(t *testing.T) { diff --git a/internal/formats/syftjson/validator.go b/syft/formats/syftjson/validator.go similarity index 90% rename from internal/formats/syftjson/validator.go rename to syft/formats/syftjson/validator.go index d359b60d9403..daf541b8858f 100644 --- a/internal/formats/syftjson/validator.go +++ b/syft/formats/syftjson/validator.go @@ -6,7 +6,7 @@ import ( "io" "strings" - "github.com/anchore/syft/internal/formats/syftjson/model" + "github.com/anchore/syft/syft/formats/syftjson/model" ) func validator(reader io.Reader) error { diff --git a/internal/formats/table/encoder.go b/syft/formats/table/encoder.go similarity index 100% rename from internal/formats/table/encoder.go rename to syft/formats/table/encoder.go index e651674c5c23..458d6eb6d60c 100644 --- a/internal/formats/table/encoder.go +++ b/syft/formats/table/encoder.go @@ -6,9 +6,9 @@ import ( "sort" "strings" - "github.com/anchore/syft/syft/sbom" - "github.com/olekukonko/tablewriter" + + "github.com/anchore/syft/syft/sbom" ) func encoder(output io.Writer, s sbom.SBOM) error { diff --git a/internal/formats/table/encoder_test.go b/syft/formats/table/encoder_test.go similarity index 93% rename from internal/formats/table/encoder_test.go rename to syft/formats/table/encoder_test.go index b2ba02368894..434ba402894b 100644 --- a/internal/formats/table/encoder_test.go +++ b/syft/formats/table/encoder_test.go @@ -4,8 +4,9 @@ import ( "flag" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/formats/common/testutils" ) var updateTableGoldenFiles = flag.Bool("update-table", false, "update the *.golden files for table format") diff --git a/internal/formats/table/format.go b/syft/formats/table/format.go similarity index 100% rename from internal/formats/table/format.go rename to syft/formats/table/format.go diff --git a/internal/formats/table/test-fixtures/snapshot/TestTableEncoder.golden b/syft/formats/table/test-fixtures/snapshot/TestTableEncoder.golden similarity index 100% rename from internal/formats/table/test-fixtures/snapshot/TestTableEncoder.golden rename to syft/formats/table/test-fixtures/snapshot/TestTableEncoder.golden diff --git a/internal/formats/template/encoder.go b/syft/formats/template/encoder.go similarity index 100% rename from internal/formats/template/encoder.go rename to syft/formats/template/encoder.go diff --git a/internal/formats/template/encoder_test.go b/syft/formats/template/encoder_test.go similarity index 90% rename from internal/formats/template/encoder_test.go rename to syft/formats/template/encoder_test.go index 950d4f91460c..b5a46bd29e55 100644 --- a/internal/formats/template/encoder_test.go +++ b/syft/formats/template/encoder_test.go @@ -4,8 +4,9 @@ import ( "flag" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/formats/common/testutils" ) var updateTmpl = flag.Bool("update-tmpl", false, "update the *.golden files for json encoders") diff --git a/internal/formats/template/format.go b/syft/formats/template/format.go similarity index 94% rename from internal/formats/template/format.go rename to syft/formats/template/format.go index 4b8f28a5ed17..9fe7ad20a317 100644 --- a/internal/formats/template/format.go +++ b/syft/formats/template/format.go @@ -3,7 +3,7 @@ package template import ( "io" - "github.com/anchore/syft/internal/formats/syftjson" + "github.com/anchore/syft/syft/formats/syftjson" "github.com/anchore/syft/syft/sbom" ) diff --git a/internal/formats/template/test-fixtures/csv.template b/syft/formats/template/test-fixtures/csv.template similarity index 100% rename from internal/formats/template/test-fixtures/csv.template rename to syft/formats/template/test-fixtures/csv.template diff --git a/internal/formats/template/test-fixtures/snapshot/TestFormatWithOption.golden b/syft/formats/template/test-fixtures/snapshot/TestFormatWithOption.golden similarity index 100% rename from internal/formats/template/test-fixtures/snapshot/TestFormatWithOption.golden rename to syft/formats/template/test-fixtures/snapshot/TestFormatWithOption.golden diff --git a/internal/formats/text/encoder.go b/syft/formats/text/encoder.go similarity index 99% rename from internal/formats/text/encoder.go rename to syft/formats/text/encoder.go index ee97abd4a2cf..49619346e8ba 100644 --- a/internal/formats/text/encoder.go +++ b/syft/formats/text/encoder.go @@ -6,7 +6,6 @@ import ( "text/tabwriter" "github.com/anchore/syft/syft/sbom" - "github.com/anchore/syft/syft/source" ) diff --git a/internal/formats/text/encoder_test.go b/syft/formats/text/encoder_test.go similarity index 90% rename from internal/formats/text/encoder_test.go rename to syft/formats/text/encoder_test.go index 7d4a4cd7094b..3da100b4db3e 100644 --- a/internal/formats/text/encoder_test.go +++ b/syft/formats/text/encoder_test.go @@ -4,7 +4,7 @@ import ( "flag" "testing" - "github.com/anchore/syft/internal/formats/common/testutils" + "github.com/anchore/syft/syft/formats/common/testutils" ) var updateTextEncoderGoldenFiles = flag.Bool("update-text", false, "update the *.golden files for text encoder") diff --git a/internal/formats/text/format.go b/syft/formats/text/format.go similarity index 100% rename from internal/formats/text/format.go rename to syft/formats/text/format.go diff --git a/internal/formats/text/test-fixtures/image-simple/Dockerfile b/syft/formats/text/test-fixtures/image-simple/Dockerfile similarity index 100% rename from internal/formats/text/test-fixtures/image-simple/Dockerfile rename to syft/formats/text/test-fixtures/image-simple/Dockerfile diff --git a/internal/formats/text/test-fixtures/image-simple/file-1.txt b/syft/formats/text/test-fixtures/image-simple/file-1.txt similarity index 100% rename from internal/formats/text/test-fixtures/image-simple/file-1.txt rename to syft/formats/text/test-fixtures/image-simple/file-1.txt diff --git a/internal/formats/text/test-fixtures/image-simple/file-2.txt b/syft/formats/text/test-fixtures/image-simple/file-2.txt similarity index 100% rename from internal/formats/text/test-fixtures/image-simple/file-2.txt rename to syft/formats/text/test-fixtures/image-simple/file-2.txt diff --git a/internal/formats/text/test-fixtures/snapshot/TestTextDirectoryEncoder.golden b/syft/formats/text/test-fixtures/snapshot/TestTextDirectoryEncoder.golden similarity index 100% rename from internal/formats/text/test-fixtures/snapshot/TestTextDirectoryEncoder.golden rename to syft/formats/text/test-fixtures/snapshot/TestTextDirectoryEncoder.golden diff --git a/internal/formats/text/test-fixtures/snapshot/TestTextImageEncoder.golden b/syft/formats/text/test-fixtures/snapshot/TestTextImageEncoder.golden similarity index 100% rename from internal/formats/text/test-fixtures/snapshot/TestTextImageEncoder.golden rename to syft/formats/text/test-fixtures/snapshot/TestTextImageEncoder.golden diff --git a/internal/formats/text/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden b/syft/formats/text/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden similarity index 100% rename from internal/formats/text/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden rename to syft/formats/text/test-fixtures/snapshot/stereoscope-fixture-image-simple.golden diff --git a/syft/formats_test.go b/syft/formats_test.go index 9596abd6ba5c..36b1d1dd9912 100644 --- a/syft/formats_test.go +++ b/syft/formats_test.go @@ -6,19 +6,19 @@ import ( "os" "testing" - "github.com/anchore/syft/internal/formats/cyclonedxjson" - "github.com/anchore/syft/internal/formats/cyclonedxxml" - "github.com/anchore/syft/internal/formats/github" - "github.com/anchore/syft/internal/formats/spdx22json" - "github.com/anchore/syft/internal/formats/spdx22tagvalue" - "github.com/anchore/syft/internal/formats/syftjson" - "github.com/anchore/syft/internal/formats/table" - "github.com/anchore/syft/internal/formats/template" - "github.com/anchore/syft/internal/formats/text" - "github.com/anchore/syft/syft/sbom" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/stretchr/testify/assert" + "github.com/anchore/syft/syft/formats/cyclonedxjson" + "github.com/anchore/syft/syft/formats/cyclonedxxml" + "github.com/anchore/syft/syft/formats/github" + "github.com/anchore/syft/syft/formats/spdx22json" + "github.com/anchore/syft/syft/formats/spdx22tagvalue" + "github.com/anchore/syft/syft/formats/syftjson" + "github.com/anchore/syft/syft/formats/table" + "github.com/anchore/syft/syft/formats/template" + "github.com/anchore/syft/syft/formats/text" + "github.com/anchore/syft/syft/sbom" ) func TestIdentify(t *testing.T) { diff --git a/syft/lib.go b/syft/lib.go index d0a1fdf4d6d3..12aa339605c7 100644 --- a/syft/lib.go +++ b/syft/lib.go @@ -19,16 +19,16 @@ package syft import ( "fmt" - "github.com/anchore/syft/syft/artifact" + "github.com/wagoodman/go-partybus" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/logger" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger" "github.com/anchore/syft/syft/source" - "github.com/wagoodman/go-partybus" ) // CatalogPackages takes an inventory of packages from the given image from a particular perspective diff --git a/syft/linux/identify_release.go b/syft/linux/identify_release.go index 2b0fbfa48f00..8b24cae8d88c 100644 --- a/syft/linux/identify_release.go +++ b/syft/linux/identify_release.go @@ -7,10 +7,11 @@ import ( "strings" "github.com/acobaugh/osrelease" + "github.com/google/go-cmp/cmp" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/source" - "github.com/google/go-cmp/cmp" ) // returns a distro or nil diff --git a/syft/linux/identify_release_test.go b/syft/linux/identify_release_test.go index 687af079dc8f..09b6b657da83 100644 --- a/syft/linux/identify_release_test.go +++ b/syft/linux/identify_release_test.go @@ -5,9 +5,10 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/source" ) func TestIdentifyRelease(t *testing.T) { diff --git a/syft/pkg/alpm_metadata.go b/syft/pkg/alpm_metadata.go index 0867915c651a..567b9fd811cd 100644 --- a/syft/pkg/alpm_metadata.go +++ b/syft/pkg/alpm_metadata.go @@ -4,10 +4,11 @@ import ( "sort" "time" + "github.com/scylladb/go-set/strset" + "github.com/anchore/packageurl-go" "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/linux" - "github.com/scylladb/go-set/strset" ) const AlpmDBGlob = "**/var/lib/pacman/local/**/desc" diff --git a/syft/pkg/alpm_metadata_test.go b/syft/pkg/alpm_metadata_test.go index 8adae54b1642..e31ad02a1121 100644 --- a/syft/pkg/alpm_metadata_test.go +++ b/syft/pkg/alpm_metadata_test.go @@ -3,9 +3,10 @@ package pkg import ( "testing" + "github.com/sergi/go-diff/diffmatchpatch" + "github.com/anchore/packageurl-go" "github.com/anchore/syft/syft/linux" - "github.com/sergi/go-diff/diffmatchpatch" ) func TestAlpmMetadata_pURL(t *testing.T) { diff --git a/syft/pkg/apk_metadata.go b/syft/pkg/apk_metadata.go index da71982342a9..64b03bbc4d02 100644 --- a/syft/pkg/apk_metadata.go +++ b/syft/pkg/apk_metadata.go @@ -3,10 +3,11 @@ package pkg import ( "sort" + "github.com/scylladb/go-set/strset" + "github.com/anchore/packageurl-go" "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/linux" - "github.com/scylladb/go-set/strset" ) const ApkDBGlob = "**/lib/apk/db/installed" diff --git a/syft/pkg/apk_metadata_test.go b/syft/pkg/apk_metadata_test.go index 1e981201f28b..05c463530d5d 100644 --- a/syft/pkg/apk_metadata_test.go +++ b/syft/pkg/apk_metadata_test.go @@ -4,11 +4,11 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/linux" - - "github.com/anchore/packageurl-go" "github.com/go-test/deep" "github.com/sergi/go-diff/diffmatchpatch" + + "github.com/anchore/packageurl-go" + "github.com/anchore/syft/syft/linux" ) func TestApkMetadata_pURL(t *testing.T) { diff --git a/syft/pkg/catalog.go b/syft/pkg/catalog.go index 7dfff5126d0a..59ff0292a43d 100644 --- a/syft/pkg/catalog.go +++ b/syft/pkg/catalog.go @@ -4,10 +4,11 @@ import ( "sort" "sync" + "github.com/jinzhu/copier" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" - "github.com/jinzhu/copier" ) type orderedIDSet struct { diff --git a/syft/pkg/catalog_test.go b/syft/pkg/catalog_test.go index 43f52b87bd13..71c3a6d0f0cb 100644 --- a/syft/pkg/catalog_test.go +++ b/syft/pkg/catalog_test.go @@ -3,11 +3,12 @@ package pkg import ( "testing" - "github.com/anchore/syft/syft/artifact" - "github.com/anchore/syft/syft/source" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/source" ) type expectedIndexes struct { diff --git a/syft/pkg/cataloger/alpm/parse_alpm_db.go b/syft/pkg/cataloger/alpm/parse_alpm_db.go index 5125cc1d5f6a..bf40fb3a3eb1 100644 --- a/syft/pkg/cataloger/alpm/parse_alpm_db.go +++ b/syft/pkg/cataloger/alpm/parse_alpm_db.go @@ -10,11 +10,12 @@ import ( "strings" "time" + "github.com/mitchellh/mapstructure" + "github.com/vbatts/go-mtree" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/mitchellh/mapstructure" - "github.com/vbatts/go-mtree" ) var ( diff --git a/syft/pkg/cataloger/alpm/parse_alpm_db_test.go b/syft/pkg/cataloger/alpm/parse_alpm_db_test.go index fd5e28a0cacb..5dd56f0519d3 100644 --- a/syft/pkg/cataloger/alpm/parse_alpm_db_test.go +++ b/syft/pkg/cataloger/alpm/parse_alpm_db_test.go @@ -6,9 +6,10 @@ import ( "testing" "time" + "github.com/go-test/deep" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" - "github.com/go-test/deep" ) func TestDatabaseParser(t *testing.T) { diff --git a/syft/pkg/cataloger/apkdb/parse_apk_db.go b/syft/pkg/cataloger/apkdb/parse_apk_db.go index b5daa99cd711..45100e9f672e 100644 --- a/syft/pkg/cataloger/apkdb/parse_apk_db.go +++ b/syft/pkg/cataloger/apkdb/parse_apk_db.go @@ -8,14 +8,13 @@ import ( "strconv" "strings" - "github.com/anchore/syft/syft/artifact" - - "github.com/anchore/syft/syft/file" + "github.com/mitchellh/mapstructure" "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "github.com/mitchellh/mapstructure" ) // integrity check diff --git a/syft/pkg/cataloger/apkdb/parse_apk_db_test.go b/syft/pkg/cataloger/apkdb/parse_apk_db_test.go index da927ad4700f..41bfac65752e 100644 --- a/syft/pkg/cataloger/apkdb/parse_apk_db_test.go +++ b/syft/pkg/cataloger/apkdb/parse_apk_db_test.go @@ -8,13 +8,11 @@ import ( "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/source" + "github.com/go-test/deep" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/anchore/syft/syft/file" - - "github.com/go-test/deep" - "github.com/anchore/syft/syft/pkg" ) diff --git a/syft/pkg/cataloger/catalog.go b/syft/pkg/cataloger/catalog.go index c9bd4f51a4f4..b844b1d9720e 100644 --- a/syft/pkg/cataloger/catalog.go +++ b/syft/pkg/cataloger/catalog.go @@ -3,6 +3,10 @@ package cataloger import ( "fmt" + "github.com/hashicorp/go-multierror" + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" + "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" @@ -11,9 +15,6 @@ import ( "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common/cpe" "github.com/anchore/syft/syft/source" - "github.com/hashicorp/go-multierror" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/go-progress" ) // Monitor provides progress-related data for observing the progress of a Catalog() call (published on the event bus). diff --git a/syft/pkg/cataloger/cataloger_test.go b/syft/pkg/cataloger/cataloger_test.go index e47944dab823..071e7bd30651 100644 --- a/syft/pkg/cataloger/cataloger_test.go +++ b/syft/pkg/cataloger/cataloger_test.go @@ -1,11 +1,13 @@ package cataloger import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/assert" - "testing" ) var _ Cataloger = (*dummy)(nil) diff --git a/syft/pkg/cataloger/common/cpe/candidate_by_package_type_test.go b/syft/pkg/cataloger/common/cpe/candidate_by_package_type_test.go index 497d298a6a0a..90e2c1cdc580 100644 --- a/syft/pkg/cataloger/common/cpe/candidate_by_package_type_test.go +++ b/syft/pkg/cataloger/common/cpe/candidate_by_package_type_test.go @@ -3,8 +3,9 @@ package cpe import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_additionalProducts(t *testing.T) { diff --git a/syft/pkg/cataloger/common/cpe/filter.go b/syft/pkg/cataloger/common/cpe/filter.go index cfb696c7d3db..69be278c1cf1 100644 --- a/syft/pkg/cataloger/common/cpe/filter.go +++ b/syft/pkg/cataloger/common/cpe/filter.go @@ -3,8 +3,9 @@ package cpe import ( "strings" - "github.com/anchore/syft/syft/pkg" "github.com/facebookincubator/nvdtools/wfn" + + "github.com/anchore/syft/syft/pkg" ) const jenkinsName = "jenkins" diff --git a/syft/pkg/cataloger/common/cpe/filter_test.go b/syft/pkg/cataloger/common/cpe/filter_test.go index d57bc8b72150..f0727a7c9504 100644 --- a/syft/pkg/cataloger/common/cpe/filter_test.go +++ b/syft/pkg/cataloger/common/cpe/filter_test.go @@ -3,8 +3,9 @@ package cpe import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_disallowJenkinsServerCPEForPluginPackage(t *testing.T) { diff --git a/syft/pkg/cataloger/common/cpe/generate.go b/syft/pkg/cataloger/common/cpe/generate.go index a93bf343a40d..5de119b54fa2 100644 --- a/syft/pkg/cataloger/common/cpe/generate.go +++ b/syft/pkg/cataloger/common/cpe/generate.go @@ -7,9 +7,10 @@ import ( "sort" "strings" + "github.com/facebookincubator/nvdtools/wfn" + "github.com/anchore/syft/internal" "github.com/anchore/syft/syft/pkg" - "github.com/facebookincubator/nvdtools/wfn" ) func newCPE(product, vendor, version, targetSW string) *wfn.Attributes { diff --git a/syft/pkg/cataloger/common/cpe/generate_test.go b/syft/pkg/cataloger/common/cpe/generate_test.go index 52676b5285f7..518ed6f26ec0 100644 --- a/syft/pkg/cataloger/common/cpe/generate_test.go +++ b/syft/pkg/cataloger/common/cpe/generate_test.go @@ -6,10 +6,11 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/scylladb/go-set" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func TestGeneratePackageCPEs(t *testing.T) { diff --git a/syft/pkg/cataloger/common/cpe/java.go b/syft/pkg/cataloger/common/cpe/java.go index 552e04f4e27b..7975e80e4bf8 100644 --- a/syft/pkg/cataloger/common/cpe/java.go +++ b/syft/pkg/cataloger/common/cpe/java.go @@ -3,9 +3,10 @@ package cpe import ( "strings" + "github.com/scylladb/go-set/strset" + "github.com/anchore/syft/internal" "github.com/anchore/syft/syft/pkg" - "github.com/scylladb/go-set/strset" ) var ( diff --git a/syft/pkg/cataloger/common/cpe/java_test.go b/syft/pkg/cataloger/common/cpe/java_test.go index 0f87e5b56fe5..c27e2ac5b578 100644 --- a/syft/pkg/cataloger/common/cpe/java_test.go +++ b/syft/pkg/cataloger/common/cpe/java_test.go @@ -4,8 +4,9 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_productsFromArtifactAndGroupIDs(t *testing.T) { diff --git a/syft/pkg/cataloger/cpp/parse_conanfile_test.go b/syft/pkg/cataloger/cpp/parse_conanfile_test.go index bdcb0322b915..4500f0bd8dbd 100644 --- a/syft/pkg/cataloger/cpp/parse_conanfile_test.go +++ b/syft/pkg/cataloger/cpp/parse_conanfile_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseConanfile(t *testing.T) { diff --git a/syft/pkg/cataloger/dart/parse_pubspec_lock.go b/syft/pkg/cataloger/dart/parse_pubspec_lock.go index 2ecd8177c68b..38dfe87084de 100644 --- a/syft/pkg/cataloger/dart/parse_pubspec_lock.go +++ b/syft/pkg/cataloger/dart/parse_pubspec_lock.go @@ -5,11 +5,12 @@ import ( "io" "net/url" + "gopkg.in/yaml.v2" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "gopkg.in/yaml.v2" ) // integrity check diff --git a/syft/pkg/cataloger/deb/cataloger.go b/syft/pkg/cataloger/deb/cataloger.go index 4b9146fd73b9..a9db587b7e45 100644 --- a/syft/pkg/cataloger/deb/cataloger.go +++ b/syft/pkg/cataloger/deb/cataloger.go @@ -11,7 +11,6 @@ import ( "sort" "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" diff --git a/syft/pkg/cataloger/deb/cataloger_test.go b/syft/pkg/cataloger/deb/cataloger_test.go index 4373f5620acc..8744ec561ca1 100644 --- a/syft/pkg/cataloger/deb/cataloger_test.go +++ b/syft/pkg/cataloger/deb/cataloger_test.go @@ -1,15 +1,15 @@ package deb import ( - "github.com/stretchr/testify/assert" "testing" - "github.com/anchore/syft/syft/file" + "github.com/go-test/deep" + "github.com/stretchr/testify/assert" "github.com/anchore/stereoscope/pkg/imagetest" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/go-test/deep" ) func TestDpkgCataloger(t *testing.T) { diff --git a/syft/pkg/cataloger/deb/parse_dpkg_info_files_test.go b/syft/pkg/cataloger/deb/parse_dpkg_info_files_test.go index c345c714eabb..f3e097b7233c 100644 --- a/syft/pkg/cataloger/deb/parse_dpkg_info_files_test.go +++ b/syft/pkg/cataloger/deb/parse_dpkg_info_files_test.go @@ -4,10 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/file" - "github.com/go-test/deep" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" ) diff --git a/syft/pkg/cataloger/deb/parse_dpkg_status.go b/syft/pkg/cataloger/deb/parse_dpkg_status.go index 3be24015163a..9bc4023ab935 100644 --- a/syft/pkg/cataloger/deb/parse_dpkg_status.go +++ b/syft/pkg/cataloger/deb/parse_dpkg_status.go @@ -8,11 +8,12 @@ import ( "regexp" "strings" + "github.com/dustin/go-humanize" + "github.com/mitchellh/mapstructure" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/pkg" - "github.com/dustin/go-humanize" - "github.com/mitchellh/mapstructure" ) var ( diff --git a/syft/pkg/cataloger/deb/parse_dpkg_status_test.go b/syft/pkg/cataloger/deb/parse_dpkg_status_test.go index ed1dd9487422..46d928ca0e3e 100644 --- a/syft/pkg/cataloger/deb/parse_dpkg_status_test.go +++ b/syft/pkg/cataloger/deb/parse_dpkg_status_test.go @@ -9,11 +9,11 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/file" + "github.com/go-test/deep" "github.com/stretchr/testify/assert" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" - "github.com/go-test/deep" ) func compareEntries(t *testing.T, left, right pkg.DpkgMetadata) { diff --git a/syft/pkg/cataloger/golang/internal/xcoff/file.go b/syft/pkg/cataloger/golang/internal/xcoff/file.go index 76a39a34f741..e4eb8876a745 100644 --- a/syft/pkg/cataloger/golang/internal/xcoff/file.go +++ b/syft/pkg/cataloger/golang/internal/xcoff/file.go @@ -4,7 +4,7 @@ // Package xcoff implements access to XCOFF (Extended Common Object File Format) files. -//nolint //this is an internal golang lib +//nolint:all package xcoff import ( diff --git a/syft/pkg/cataloger/golang/internal/xcoff/xcoff.go b/syft/pkg/cataloger/golang/internal/xcoff/xcoff.go index 96cf01d25b6c..5500269c54e9 100644 --- a/syft/pkg/cataloger/golang/internal/xcoff/xcoff.go +++ b/syft/pkg/cataloger/golang/internal/xcoff/xcoff.go @@ -7,7 +7,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//nolint // this is an internal golang lib +//nolint:all package xcoff // File Header. diff --git a/syft/pkg/cataloger/golang/parse_go_bin.go b/syft/pkg/cataloger/golang/parse_go_bin.go index 5dd726783a67..cabf30f32241 100644 --- a/syft/pkg/cataloger/golang/parse_go_bin.go +++ b/syft/pkg/cataloger/golang/parse_go_bin.go @@ -12,11 +12,12 @@ import ( "strings" "time" + "golang.org/x/mod/module" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/golang/internal/xcoff" "github.com/anchore/syft/syft/source" - "golang.org/x/mod/module" ) const GOARCH = "GOARCH" diff --git a/syft/pkg/cataloger/golang/parse_go_bin_test.go b/syft/pkg/cataloger/golang/parse_go_bin_test.go index 2c2a383aea95..6f48c02b9ad3 100644 --- a/syft/pkg/cataloger/golang/parse_go_bin_test.go +++ b/syft/pkg/cataloger/golang/parse_go_bin_test.go @@ -11,10 +11,11 @@ import ( "syscall" "testing" - "github.com/anchore/syft/syft/pkg" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) // make will run the default make target for the given test fixture path diff --git a/syft/pkg/cataloger/golang/parse_go_mod.go b/syft/pkg/cataloger/golang/parse_go_mod.go index 61c52c93e7f4..db03f4a9914c 100644 --- a/syft/pkg/cataloger/golang/parse_go_mod.go +++ b/syft/pkg/cataloger/golang/parse_go_mod.go @@ -5,9 +5,10 @@ import ( "io" "sort" + "golang.org/x/mod/modfile" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" - "golang.org/x/mod/modfile" ) // parseGoMod takes a go.mod and lists all packages discovered. diff --git a/syft/pkg/cataloger/haskell/parse_cabal_freeze_test.go b/syft/pkg/cataloger/haskell/parse_cabal_freeze_test.go index 162d0d8cb4bc..3f898dffff71 100644 --- a/syft/pkg/cataloger/haskell/parse_cabal_freeze_test.go +++ b/syft/pkg/cataloger/haskell/parse_cabal_freeze_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseCabalFreeze(t *testing.T) { diff --git a/syft/pkg/cataloger/haskell/parse_stack_lock.go b/syft/pkg/cataloger/haskell/parse_stack_lock.go index 0d08c25ffa64..0cbbda80b608 100644 --- a/syft/pkg/cataloger/haskell/parse_stack_lock.go +++ b/syft/pkg/cataloger/haskell/parse_stack_lock.go @@ -5,10 +5,11 @@ import ( "io" "strings" + "gopkg.in/yaml.v3" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "gopkg.in/yaml.v3" ) // integrity check diff --git a/syft/pkg/cataloger/haskell/parse_stack_lock_test.go b/syft/pkg/cataloger/haskell/parse_stack_lock_test.go index 3ad296b2c9b7..0f1cfde40ae4 100644 --- a/syft/pkg/cataloger/haskell/parse_stack_lock_test.go +++ b/syft/pkg/cataloger/haskell/parse_stack_lock_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func fixtureP(str string) *string { diff --git a/syft/pkg/cataloger/haskell/parse_stack_yaml.go b/syft/pkg/cataloger/haskell/parse_stack_yaml.go index eb71f51ca210..3fceb15cc373 100644 --- a/syft/pkg/cataloger/haskell/parse_stack_yaml.go +++ b/syft/pkg/cataloger/haskell/parse_stack_yaml.go @@ -4,10 +4,11 @@ import ( "fmt" "io" + "gopkg.in/yaml.v3" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "gopkg.in/yaml.v3" ) // integrity check diff --git a/syft/pkg/cataloger/haskell/parse_stack_yaml_test.go b/syft/pkg/cataloger/haskell/parse_stack_yaml_test.go index 351630b71578..cdf7c0359ab5 100644 --- a/syft/pkg/cataloger/haskell/parse_stack_yaml_test.go +++ b/syft/pkg/cataloger/haskell/parse_stack_yaml_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseStackYaml(t *testing.T) { diff --git a/syft/pkg/cataloger/java/archive_filename.go b/syft/pkg/cataloger/java/archive_filename.go index cb4d14216290..519cd7dd044e 100644 --- a/syft/pkg/cataloger/java/archive_filename.go +++ b/syft/pkg/cataloger/java/archive_filename.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/anchore/syft/internal/log" - "github.com/anchore/syft/syft/pkg" ) diff --git a/syft/pkg/cataloger/java/archive_filename_test.go b/syft/pkg/cataloger/java/archive_filename_test.go index da3c959074b1..f1c34aaa7d06 100644 --- a/syft/pkg/cataloger/java/archive_filename_test.go +++ b/syft/pkg/cataloger/java/archive_filename_test.go @@ -3,8 +3,9 @@ package java import ( "testing" - "github.com/anchore/syft/syft/pkg" "github.com/sergi/go-diff/diffmatchpatch" + + "github.com/anchore/syft/syft/pkg" ) func TestExtractInfoFromJavaArchiveFilename(t *testing.T) { diff --git a/syft/pkg/cataloger/java/archive_parser_test.go b/syft/pkg/cataloger/java/archive_parser_test.go index 64d181496976..30c67f0e9da1 100644 --- a/syft/pkg/cataloger/java/archive_parser_test.go +++ b/syft/pkg/cataloger/java/archive_parser_test.go @@ -12,11 +12,12 @@ import ( "syscall" "testing" - "github.com/anchore/syft/internal" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" "github.com/gookit/color" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/internal" + "github.com/anchore/syft/syft/pkg" ) func generateJavaBuildFixture(t *testing.T, fixturePath string) { diff --git a/syft/pkg/cataloger/java/package_url_test.go b/syft/pkg/cataloger/java/package_url_test.go index 27cf46ef91ae..b3785a4dfcab 100644 --- a/syft/pkg/cataloger/java/package_url_test.go +++ b/syft/pkg/cataloger/java/package_url_test.go @@ -1,9 +1,11 @@ package java import ( - "github.com/anchore/syft/syft/pkg" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func Test_packageURL(t *testing.T) { diff --git a/syft/pkg/cataloger/java/parse_java_manifest.go b/syft/pkg/cataloger/java/parse_java_manifest.go index 688595b030f6..93e2823ff4c2 100644 --- a/syft/pkg/cataloger/java/parse_java_manifest.go +++ b/syft/pkg/cataloger/java/parse_java_manifest.go @@ -8,7 +8,6 @@ import ( "strings" "github.com/anchore/syft/internal/log" - "github.com/anchore/syft/syft/pkg" ) diff --git a/syft/pkg/cataloger/java/parse_java_manifest_test.go b/syft/pkg/cataloger/java/parse_java_manifest_test.go index 0982e35b2a32..231cd7c981b5 100644 --- a/syft/pkg/cataloger/java/parse_java_manifest_test.go +++ b/syft/pkg/cataloger/java/parse_java_manifest_test.go @@ -5,10 +5,10 @@ import ( "os" "testing" + "github.com/go-test/deep" "github.com/stretchr/testify/assert" "github.com/anchore/syft/syft/pkg" - "github.com/go-test/deep" ) func TestParseJavaManifest(t *testing.T) { diff --git a/syft/pkg/cataloger/java/parse_pom_properties.go b/syft/pkg/cataloger/java/parse_pom_properties.go index 93ccec636b34..576c7d2483a0 100644 --- a/syft/pkg/cataloger/java/parse_pom_properties.go +++ b/syft/pkg/cataloger/java/parse_pom_properties.go @@ -6,8 +6,9 @@ import ( "io" "strings" - "github.com/anchore/syft/syft/pkg" "github.com/mitchellh/mapstructure" + + "github.com/anchore/syft/syft/pkg" ) const pomPropertiesGlob = "*pom.properties" diff --git a/syft/pkg/cataloger/java/parse_pom_properties_test.go b/syft/pkg/cataloger/java/parse_pom_properties_test.go index ab7a3d2b2a42..63b9e4c0cd59 100644 --- a/syft/pkg/cataloger/java/parse_pom_properties_test.go +++ b/syft/pkg/cataloger/java/parse_pom_properties_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func TestParseJavaPomProperties(t *testing.T) { diff --git a/syft/pkg/cataloger/java/parse_pom_xml.go b/syft/pkg/cataloger/java/parse_pom_xml.go index 1f7b932b6b43..b343c8f46d33 100644 --- a/syft/pkg/cataloger/java/parse_pom_xml.go +++ b/syft/pkg/cataloger/java/parse_pom_xml.go @@ -6,10 +6,11 @@ import ( "io" "strings" - "github.com/anchore/syft/syft/artifact" - "github.com/anchore/syft/syft/pkg" "github.com/vifraa/gopom" "golang.org/x/net/html/charset" + + "github.com/anchore/syft/syft/artifact" + "github.com/anchore/syft/syft/pkg" ) const pomXMLGlob = "*pom.xml" diff --git a/syft/pkg/cataloger/java/parse_pom_xml_test.go b/syft/pkg/cataloger/java/parse_pom_xml_test.go index e314716f477c..8c25cad9d679 100644 --- a/syft/pkg/cataloger/java/parse_pom_xml_test.go +++ b/syft/pkg/cataloger/java/parse_pom_xml_test.go @@ -4,10 +4,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/assert" "github.com/vifraa/gopom" "github.com/anchore/syft/syft/pkg" - "github.com/stretchr/testify/assert" ) func Test_parserPomXML(t *testing.T) { diff --git a/syft/pkg/cataloger/java/save_archive_to_tmp.go b/syft/pkg/cataloger/java/save_archive_to_tmp.go index e8a4abe47499..c602170a7e00 100644 --- a/syft/pkg/cataloger/java/save_archive_to_tmp.go +++ b/syft/pkg/cataloger/java/save_archive_to_tmp.go @@ -3,7 +3,6 @@ package java import ( "fmt" "io" - "io/ioutil" "os" "path/filepath" @@ -12,7 +11,7 @@ import ( func saveArchiveToTmp(archiveVirtualPath string, reader io.Reader) (string, string, func(), error) { name := filepath.Base(archiveVirtualPath) - tempDir, err := ioutil.TempDir("", "syft-archive-contents-") + tempDir, err := os.MkdirTemp("", "syft-archive-contents-") if err != nil { return "", "", func() {}, fmt.Errorf("unable to create tempdir for archive processing: %w", err) } diff --git a/syft/pkg/cataloger/java/tar_wrapped_archive_parser.go b/syft/pkg/cataloger/java/tar_wrapped_archive_parser.go index 4d0a6042046d..fd6091515a7d 100644 --- a/syft/pkg/cataloger/java/tar_wrapped_archive_parser.go +++ b/syft/pkg/cataloger/java/tar_wrapped_archive_parser.go @@ -5,7 +5,6 @@ import ( "io" "github.com/anchore/syft/internal/file" - "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" diff --git a/syft/pkg/cataloger/java/tar_wrapped_archive_parser_test.go b/syft/pkg/cataloger/java/tar_wrapped_archive_parser_test.go index 8a1f73162d54..7073599958a4 100644 --- a/syft/pkg/cataloger/java/tar_wrapped_archive_parser_test.go +++ b/syft/pkg/cataloger/java/tar_wrapped_archive_parser_test.go @@ -5,9 +5,8 @@ import ( "path" "testing" - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func Test_parseTarWrappedJavaArchive(t *testing.T) { diff --git a/syft/pkg/cataloger/java/zip_wrapped_archive_parser.go b/syft/pkg/cataloger/java/zip_wrapped_archive_parser.go index 6e32ed428816..0b8c9b641e48 100644 --- a/syft/pkg/cataloger/java/zip_wrapped_archive_parser.go +++ b/syft/pkg/cataloger/java/zip_wrapped_archive_parser.go @@ -5,7 +5,6 @@ import ( "io" "github.com/anchore/syft/internal/file" - "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" diff --git a/syft/pkg/cataloger/javascript/parse_package_json.go b/syft/pkg/cataloger/javascript/parse_package_json.go index 32a67b5072a3..31a9f2c667cd 100644 --- a/syft/pkg/cataloger/javascript/parse_package_json.go +++ b/syft/pkg/cataloger/javascript/parse_package_json.go @@ -7,12 +7,10 @@ import ( "io" "regexp" - "github.com/anchore/syft/internal/log" - - "github.com/anchore/syft/internal" - "github.com/mitchellh/mapstructure" + "github.com/anchore/syft/internal" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" diff --git a/syft/pkg/cataloger/javascript/parse_package_json_test.go b/syft/pkg/cataloger/javascript/parse_package_json_test.go index 60a2a06cbc5a..9225737eedec 100644 --- a/syft/pkg/cataloger/javascript/parse_package_json_test.go +++ b/syft/pkg/cataloger/javascript/parse_package_json_test.go @@ -4,9 +4,10 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/pkg" ) func TestParsePackageJSON(t *testing.T) { diff --git a/syft/pkg/cataloger/javascript/parse_pnpm_lock.go b/syft/pkg/cataloger/javascript/parse_pnpm_lock.go index fc0cb2cb4931..aa1cc169b083 100644 --- a/syft/pkg/cataloger/javascript/parse_pnpm_lock.go +++ b/syft/pkg/cataloger/javascript/parse_pnpm_lock.go @@ -4,10 +4,11 @@ import ( "fmt" "io" + "gopkg.in/yaml.v3" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "gopkg.in/yaml.v3" ) // integrity check diff --git a/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go b/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go index af626eef2083..49118075edc3 100644 --- a/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go +++ b/syft/pkg/cataloger/javascript/parse_pnpm_lock_test.go @@ -5,8 +5,9 @@ import ( "sort" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func fixtureP(str string) *string { diff --git a/syft/pkg/cataloger/javascript/parse_yarn_lock_test.go b/syft/pkg/cataloger/javascript/parse_yarn_lock_test.go index fbe2ce7a7a25..da54f19a37b4 100644 --- a/syft/pkg/cataloger/javascript/parse_yarn_lock_test.go +++ b/syft/pkg/cataloger/javascript/parse_yarn_lock_test.go @@ -4,9 +4,10 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/pkg" ) func TestParseYarnBerry(t *testing.T) { diff --git a/syft/pkg/cataloger/php/parse_composer_lock_test.go b/syft/pkg/cataloger/php/parse_composer_lock_test.go index c0658aa51c4a..b5522d15d8ad 100644 --- a/syft/pkg/cataloger/php/parse_composer_lock_test.go +++ b/syft/pkg/cataloger/php/parse_composer_lock_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseComposerFileLock(t *testing.T) { diff --git a/syft/pkg/cataloger/php/parse_installed_json_test.go b/syft/pkg/cataloger/php/parse_installed_json_test.go index 9c925afce275..45c40d6b918e 100644 --- a/syft/pkg/cataloger/php/parse_installed_json_test.go +++ b/syft/pkg/cataloger/php/parse_installed_json_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) var expectedInstalledJsonPackages = []*pkg.Package{ diff --git a/syft/pkg/cataloger/portage/cataloger_test.go b/syft/pkg/cataloger/portage/cataloger_test.go index 26aad66fbe07..c0e6f71bba88 100644 --- a/syft/pkg/cataloger/portage/cataloger_test.go +++ b/syft/pkg/cataloger/portage/cataloger_test.go @@ -3,12 +3,12 @@ package portage import ( "testing" - "github.com/anchore/syft/syft/file" + "github.com/go-test/deep" "github.com/anchore/stereoscope/pkg/imagetest" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/go-test/deep" ) func TestPortageCataloger(t *testing.T) { diff --git a/syft/pkg/cataloger/python/package_cataloger.go b/syft/pkg/cataloger/python/package_cataloger.go index d58fe7ccd3b9..e27610fd41eb 100644 --- a/syft/pkg/cataloger/python/package_cataloger.go +++ b/syft/pkg/cataloger/python/package_cataloger.go @@ -4,14 +4,12 @@ import ( "bufio" "encoding/json" "fmt" - "io/ioutil" + "io" "path/filepath" "github.com/anchore/syft/internal" - "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" - "github.com/anchore/syft/syft/source" ) @@ -171,7 +169,7 @@ func (c *PackageCataloger) fetchDirectURLData(resolver source.FileResolver, meta } defer internal.CloseAndLogError(directURLContents, directURLLocation.VirtualPath) - buffer, err := ioutil.ReadAll(directURLContents) + buffer, err := io.ReadAll(directURLContents) if err != nil { return nil, nil, err } diff --git a/syft/pkg/cataloger/python/package_cataloger_test.go b/syft/pkg/cataloger/python/package_cataloger_test.go index fa6917ac3f8e..f5140e64461e 100644 --- a/syft/pkg/cataloger/python/package_cataloger_test.go +++ b/syft/pkg/cataloger/python/package_cataloger_test.go @@ -3,9 +3,10 @@ package python import ( "testing" + "github.com/go-test/deep" + "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/go-test/deep" ) func TestPythonPackageWheelCataloger(t *testing.T) { diff --git a/syft/pkg/cataloger/python/parse_pipfile_lock_test.go b/syft/pkg/cataloger/python/parse_pipfile_lock_test.go index d9fd1a02d340..42495a1f850f 100644 --- a/syft/pkg/cataloger/python/parse_pipfile_lock_test.go +++ b/syft/pkg/cataloger/python/parse_pipfile_lock_test.go @@ -1,13 +1,13 @@ package python import ( - "github.com/anchore/syft/syft/source" "os" "testing" "github.com/google/go-cmp/cmp" "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestParsePipFileLock(t *testing.T) { diff --git a/syft/pkg/cataloger/python/parse_poetry_lock.go b/syft/pkg/cataloger/python/parse_poetry_lock.go index 8cae5ed9ea2f..cee921f4c2d8 100644 --- a/syft/pkg/cataloger/python/parse_poetry_lock.go +++ b/syft/pkg/cataloger/python/parse_poetry_lock.go @@ -4,10 +4,11 @@ import ( "fmt" "io" + "github.com/pelletier/go-toml" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "github.com/pelletier/go-toml" ) // integrity check diff --git a/syft/pkg/cataloger/python/parse_poetry_lock_test.go b/syft/pkg/cataloger/python/parse_poetry_lock_test.go index a582a8344041..3abdf60610ac 100644 --- a/syft/pkg/cataloger/python/parse_poetry_lock_test.go +++ b/syft/pkg/cataloger/python/parse_poetry_lock_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParsePoetryLock(t *testing.T) { diff --git a/syft/pkg/cataloger/python/parse_requirements_test.go b/syft/pkg/cataloger/python/parse_requirements_test.go index 3a187105996b..9d60f9575ddb 100644 --- a/syft/pkg/cataloger/python/parse_requirements_test.go +++ b/syft/pkg/cataloger/python/parse_requirements_test.go @@ -1,13 +1,13 @@ package python import ( - "github.com/anchore/syft/syft/source" "os" "testing" "github.com/google/go-cmp/cmp" "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestParseRequirementsTxt(t *testing.T) { diff --git a/syft/pkg/cataloger/python/parse_setup_test.go b/syft/pkg/cataloger/python/parse_setup_test.go index b5614fa3d197..685af622c617 100644 --- a/syft/pkg/cataloger/python/parse_setup_test.go +++ b/syft/pkg/cataloger/python/parse_setup_test.go @@ -1,13 +1,13 @@ package python import ( - "github.com/anchore/syft/syft/source" "os" "testing" "github.com/google/go-cmp/cmp" "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestParseSetup(t *testing.T) { diff --git a/syft/pkg/cataloger/python/parse_wheel_egg_metadata.go b/syft/pkg/cataloger/python/parse_wheel_egg_metadata.go index 4c6a880f1d87..f21c31bfa64e 100644 --- a/syft/pkg/cataloger/python/parse_wheel_egg_metadata.go +++ b/syft/pkg/cataloger/python/parse_wheel_egg_metadata.go @@ -7,11 +7,10 @@ import ( "path/filepath" "strings" - "github.com/anchore/syft/internal/file" - "github.com/anchore/syft/internal/log" - "github.com/mitchellh/mapstructure" + "github.com/anchore/syft/internal/file" + "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/pkg" ) diff --git a/syft/pkg/cataloger/python/parse_wheel_egg_metadata_test.go b/syft/pkg/cataloger/python/parse_wheel_egg_metadata_test.go index 737da67f9618..7159962b8279 100644 --- a/syft/pkg/cataloger/python/parse_wheel_egg_metadata_test.go +++ b/syft/pkg/cataloger/python/parse_wheel_egg_metadata_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseWheelEggMetadata(t *testing.T) { diff --git a/syft/pkg/cataloger/python/parse_wheel_egg_record_test.go b/syft/pkg/cataloger/python/parse_wheel_egg_record_test.go index 7b178d9f02ab..5090d4bd3691 100644 --- a/syft/pkg/cataloger/python/parse_wheel_egg_record_test.go +++ b/syft/pkg/cataloger/python/parse_wheel_egg_record_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseWheelEggRecord(t *testing.T) { diff --git a/syft/pkg/cataloger/rpm/parse_rpmdb.go b/syft/pkg/cataloger/rpm/parse_rpmdb.go index c1ae7d4cacfc..96ffd08fb490 100644 --- a/syft/pkg/cataloger/rpm/parse_rpmdb.go +++ b/syft/pkg/cataloger/rpm/parse_rpmdb.go @@ -3,20 +3,20 @@ package rpm import ( "fmt" "io" - "io/ioutil" "os" + rpmdb "github.com/knqyf263/go-rpmdb/pkg" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - rpmdb "github.com/knqyf263/go-rpmdb/pkg" ) // parseRpmDb parses an "Packages" RPM DB and returns the Packages listed within it. func parseRpmDB(resolver source.FilePathResolver, dbLocation source.Location, reader io.Reader) ([]pkg.Package, error) { - f, err := ioutil.TempFile("", internal.ApplicationName+"-rpmdb") + f, err := os.CreateTemp("", internal.ApplicationName+"-rpmdb") if err != nil { return nil, fmt.Errorf("failed to create temp rpmdb file: %w", err) } @@ -46,28 +46,21 @@ func parseRpmDB(resolver source.FilePathResolver, dbLocation source.Location, re var allPkgs []pkg.Package for _, entry := range pkgList { - p, err := newPkg(resolver, dbLocation, entry) - if err != nil { - return nil, err - } + p := newPkg(resolver, dbLocation, entry) - if !pkg.IsValid(p) { + if !pkg.IsValid(&p) { + log.Warnf("ignoring invalid package found in RPM DB: location=%q name=%q version=%q", dbLocation, entry.Name, entry.Version) continue } p.SetID() - allPkgs = append(allPkgs, *p) + allPkgs = append(allPkgs, p) } return allPkgs, nil } -func newPkg(resolver source.FilePathResolver, dbLocation source.Location, entry *rpmdb.PackageInfo) (*pkg.Package, error) { - fileRecords, err := extractRpmdbFileRecords(resolver, entry) - if err != nil { - return nil, err - } - +func newPkg(resolver source.FilePathResolver, dbLocation source.Location, entry *rpmdb.PackageInfo) pkg.Package { metadata := pkg.RpmMetadata{ Name: entry.Name, Version: entry.Version, @@ -79,7 +72,7 @@ func newPkg(resolver source.FilePathResolver, dbLocation source.Location, entry License: entry.License, Size: entry.Size, ModularityLabel: entry.Modularitylabel, - Files: fileRecords, + Files: extractRpmdbFileRecords(resolver, entry), } p := pkg.Package{ @@ -97,7 +90,7 @@ func newPkg(resolver source.FilePathResolver, dbLocation source.Location, entry } p.SetID() - return &p, nil + return p } // The RPM naming scheme is [name]-[version]-[release]-[arch], where version is implicitly expands to [epoch]:[version]. @@ -113,12 +106,13 @@ func toELVersion(metadata pkg.RpmMetadata) string { return fmt.Sprintf("%s-%s", metadata.Version, metadata.Release) } -func extractRpmdbFileRecords(resolver source.FilePathResolver, entry *rpmdb.PackageInfo) ([]pkg.RpmdbFileRecord, error) { +func extractRpmdbFileRecords(resolver source.FilePathResolver, entry *rpmdb.PackageInfo) []pkg.RpmdbFileRecord { var records = make([]pkg.RpmdbFileRecord, 0) files, err := entry.InstalledFiles() if err != nil { - return nil, err + log.Warnf("unable to parse listing of installed files for RPM DB entry: %s", err.Error()) + return records } for _, record := range files { @@ -138,5 +132,5 @@ func extractRpmdbFileRecords(resolver source.FilePathResolver, entry *rpmdb.Pack }) } } - return records, nil + return records } diff --git a/syft/pkg/cataloger/rpm/parse_rpmdb_test.go b/syft/pkg/cataloger/rpm/parse_rpmdb_test.go index 4838c0d96d71..8b8571120077 100644 --- a/syft/pkg/cataloger/rpm/parse_rpmdb_test.go +++ b/syft/pkg/cataloger/rpm/parse_rpmdb_test.go @@ -5,14 +5,12 @@ import ( "os" "testing" + "github.com/go-test/deep" "github.com/stretchr/testify/assert" "github.com/anchore/syft/syft/file" - - "github.com/anchore/syft/syft/source" - "github.com/anchore/syft/syft/pkg" - "github.com/go-test/deep" + "github.com/anchore/syft/syft/source" ) type rpmdbTestFileResolverMock struct { diff --git a/syft/pkg/cataloger/rpm/parse_rpmmanifest_test.go b/syft/pkg/cataloger/rpm/parse_rpmmanifest_test.go index a9b73df42712..977a1077d175 100644 --- a/syft/pkg/cataloger/rpm/parse_rpmmanifest_test.go +++ b/syft/pkg/cataloger/rpm/parse_rpmmanifest_test.go @@ -4,9 +4,10 @@ import ( "os" "testing" + "github.com/go-test/deep" + "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/source" - "github.com/go-test/deep" ) func TestParseRpmManifest(t *testing.T) { diff --git a/syft/pkg/cataloger/ruby/parse_gemspec.go b/syft/pkg/cataloger/ruby/parse_gemspec.go index e175c417b876..a61d95518613 100644 --- a/syft/pkg/cataloger/ruby/parse_gemspec.go +++ b/syft/pkg/cataloger/ruby/parse_gemspec.go @@ -8,10 +8,9 @@ import ( "regexp" "strings" - "github.com/anchore/syft/internal" - "github.com/mitchellh/mapstructure" + "github.com/anchore/syft/internal" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" diff --git a/syft/pkg/cataloger/ruby/parse_gemspec_test.go b/syft/pkg/cataloger/ruby/parse_gemspec_test.go index 75e3fa24ef24..748394594673 100644 --- a/syft/pkg/cataloger/ruby/parse_gemspec_test.go +++ b/syft/pkg/cataloger/ruby/parse_gemspec_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseGemspec(t *testing.T) { diff --git a/syft/pkg/cataloger/rust/audit_binary_cataloger.go b/syft/pkg/cataloger/rust/audit_binary_cataloger.go index eeab99cf1d28..700b0f2ecb81 100644 --- a/syft/pkg/cataloger/rust/audit_binary_cataloger.go +++ b/syft/pkg/cataloger/rust/audit_binary_cataloger.go @@ -3,13 +3,14 @@ package rust import ( "fmt" + rustaudit "github.com/microsoft/go-rustaudit" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/internal/unionreader" "github.com/anchore/syft/syft/source" - rustaudit "github.com/microsoft/go-rustaudit" ) const catalogerName = "cargo-auditable-binary-cataloger" diff --git a/syft/pkg/cataloger/rust/parse_cargo_lock.go b/syft/pkg/cataloger/rust/parse_cargo_lock.go index 8910a70dd1a0..fa40e53c9a6d 100644 --- a/syft/pkg/cataloger/rust/parse_cargo_lock.go +++ b/syft/pkg/cataloger/rust/parse_cargo_lock.go @@ -4,10 +4,11 @@ import ( "fmt" "io" + "github.com/pelletier/go-toml" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "github.com/pelletier/go-toml" ) // integrity check diff --git a/syft/pkg/cataloger/rust/parse_cargo_lock_test.go b/syft/pkg/cataloger/rust/parse_cargo_lock_test.go index 4bf2cd3e2274..579c591cdba6 100644 --- a/syft/pkg/cataloger/rust/parse_cargo_lock_test.go +++ b/syft/pkg/cataloger/rust/parse_cargo_lock_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParseCargoLock(t *testing.T) { diff --git a/syft/pkg/cataloger/swift/parse_podfile_lock.go b/syft/pkg/cataloger/swift/parse_podfile_lock.go index 31819bef14e8..0bde98ece832 100644 --- a/syft/pkg/cataloger/swift/parse_podfile_lock.go +++ b/syft/pkg/cataloger/swift/parse_podfile_lock.go @@ -3,13 +3,13 @@ package swift import ( "fmt" "io" - "io/ioutil" "strings" + "gopkg.in/yaml.v3" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/pkg" "github.com/anchore/syft/syft/pkg/cataloger/common" - "gopkg.in/yaml.v3" ) // integrity check @@ -17,7 +17,7 @@ var _ common.ParserFn = parsePodfileLock // parsePodfileLock is a parser function for Podfile.lock contents, returning all cocoapods pods discovered. func parsePodfileLock(_ string, reader io.Reader) ([]*pkg.Package, []artifact.Relationship, error) { - bytes, err := ioutil.ReadAll(reader) + bytes, err := io.ReadAll(reader) if err != nil { return nil, nil, fmt.Errorf("unable to read file: %w", err) } diff --git a/syft/pkg/cataloger/swift/parse_podfile_lock_test.go b/syft/pkg/cataloger/swift/parse_podfile_lock_test.go index 8592eb4f82c2..a434d904e3d0 100644 --- a/syft/pkg/cataloger/swift/parse_podfile_lock_test.go +++ b/syft/pkg/cataloger/swift/parse_podfile_lock_test.go @@ -4,8 +4,9 @@ import ( "os" "testing" - "github.com/anchore/syft/syft/pkg" "github.com/go-test/deep" + + "github.com/anchore/syft/syft/pkg" ) func TestParsePodfileLock(t *testing.T) { diff --git a/syft/pkg/dpkg_metadata.go b/syft/pkg/dpkg_metadata.go index cc69a61732f0..fb405a85bdd8 100644 --- a/syft/pkg/dpkg_metadata.go +++ b/syft/pkg/dpkg_metadata.go @@ -4,11 +4,11 @@ import ( "fmt" "sort" - "github.com/anchore/syft/syft/file" + "github.com/scylladb/go-set/strset" "github.com/anchore/packageurl-go" + "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/linux" - "github.com/scylladb/go-set/strset" ) const DpkgDBGlob = "**/var/lib/dpkg/{status,status.d/**}" diff --git a/syft/pkg/dpkg_metadata_test.go b/syft/pkg/dpkg_metadata_test.go index 145baf3087b3..088e4100066e 100644 --- a/syft/pkg/dpkg_metadata_test.go +++ b/syft/pkg/dpkg_metadata_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/go-test/deep" + "github.com/sergi/go-diff/diffmatchpatch" "github.com/anchore/syft/syft/linux" - "github.com/sergi/go-diff/diffmatchpatch" ) func TestDpkgMetadata_pURL(t *testing.T) { diff --git a/syft/pkg/java_metadata.go b/syft/pkg/java_metadata.go index 4e606a03d3fe..779845b5461f 100644 --- a/syft/pkg/java_metadata.go +++ b/syft/pkg/java_metadata.go @@ -3,10 +3,9 @@ package pkg import ( "strings" + "github.com/anchore/syft/internal" "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/linux" - - "github.com/anchore/syft/internal" ) var _ urlIdentifier = (*JavaMetadata)(nil) diff --git a/syft/pkg/npm_package_json_metadata_test.go b/syft/pkg/npm_package_json_metadata_test.go index ff5e5f0e661a..4557c29d0f58 100644 --- a/syft/pkg/npm_package_json_metadata_test.go +++ b/syft/pkg/npm_package_json_metadata_test.go @@ -4,9 +4,10 @@ import ( "fmt" "testing" - "github.com/anchore/packageurl-go" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/packageurl-go" ) func TestNpmPackageJSONMetadata_PackageURL(t *testing.T) { diff --git a/syft/pkg/package_test.go b/syft/pkg/package_test.go index 6e95e3896894..7c3246a08ce9 100644 --- a/syft/pkg/package_test.go +++ b/syft/pkg/package_test.go @@ -3,11 +3,12 @@ package pkg import ( "testing" - "github.com/anchore/stereoscope/pkg/file" - "github.com/anchore/syft/syft/source" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/stereoscope/pkg/file" + "github.com/anchore/syft/syft/source" ) func TestIDUniqueness(t *testing.T) { diff --git a/syft/pkg/php_composer_json_metadata_test.go b/syft/pkg/php_composer_json_metadata_test.go index 81453a7d02e0..ee38ad87152b 100644 --- a/syft/pkg/php_composer_json_metadata_test.go +++ b/syft/pkg/php_composer_json_metadata_test.go @@ -1,9 +1,11 @@ package pkg import ( - "github.com/anchore/syft/syft/linux" - "github.com/sergi/go-diff/diffmatchpatch" "testing" + + "github.com/sergi/go-diff/diffmatchpatch" + + "github.com/anchore/syft/syft/linux" ) func TestPhpComposerJsonMetadata_pURL(t *testing.T) { diff --git a/syft/pkg/python_package_metadata.go b/syft/pkg/python_package_metadata.go index de5664d48c4d..cacfb5ab4feb 100644 --- a/syft/pkg/python_package_metadata.go +++ b/syft/pkg/python_package_metadata.go @@ -4,10 +4,10 @@ import ( "fmt" "sort" - "github.com/anchore/syft/syft/linux" + "github.com/scylladb/go-set/strset" "github.com/anchore/packageurl-go" - "github.com/scylladb/go-set/strset" + "github.com/anchore/syft/syft/linux" ) var ( diff --git a/syft/pkg/python_package_metadata_test.go b/syft/pkg/python_package_metadata_test.go index f4e61b05d14f..4798ef37311f 100644 --- a/syft/pkg/python_package_metadata_test.go +++ b/syft/pkg/python_package_metadata_test.go @@ -1,12 +1,13 @@ package pkg import ( - "github.com/anchore/syft/syft/linux" - "github.com/sergi/go-diff/diffmatchpatch" "strings" "testing" "github.com/go-test/deep" + "github.com/sergi/go-diff/diffmatchpatch" + + "github.com/anchore/syft/syft/linux" ) func TestPythonPackageMetadata_pURL(t *testing.T) { diff --git a/syft/pkg/relationships_by_file_ownership.go b/syft/pkg/relationships_by_file_ownership.go index 5738b85c1076..564952f93302 100644 --- a/syft/pkg/relationships_by_file_ownership.go +++ b/syft/pkg/relationships_by_file_ownership.go @@ -3,10 +3,11 @@ package pkg import ( "sort" - "github.com/anchore/syft/internal/log" - "github.com/anchore/syft/syft/artifact" "github.com/bmatcuk/doublestar/v4" "github.com/scylladb/go-set/strset" + + "github.com/anchore/syft/internal/log" + "github.com/anchore/syft/syft/artifact" ) // AltRpmDBGlob allows db matches against new locations introduced in fedora:{36,37} diff --git a/syft/pkg/relationships_by_file_ownership_test.go b/syft/pkg/relationships_by_file_ownership_test.go index ff0f71f9e609..e9de69e6b5db 100644 --- a/syft/pkg/relationships_by_file_ownership_test.go +++ b/syft/pkg/relationships_by_file_ownership_test.go @@ -3,9 +3,10 @@ package pkg import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/anchore/syft/syft/artifact" "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/assert" ) func TestOwnershipByFilesRelationship(t *testing.T) { diff --git a/syft/pkg/rpm_metadata.go b/syft/pkg/rpm_metadata.go index 684de377c580..f2d8880d630b 100644 --- a/syft/pkg/rpm_metadata.go +++ b/syft/pkg/rpm_metadata.go @@ -5,10 +5,11 @@ import ( "sort" "strconv" + "github.com/scylladb/go-set/strset" + "github.com/anchore/packageurl-go" "github.com/anchore/syft/syft/file" "github.com/anchore/syft/syft/linux" - "github.com/scylladb/go-set/strset" ) // Packages is the legacy Berkely db based format diff --git a/syft/pkg/rpm_metadata_test.go b/syft/pkg/rpm_metadata_test.go index 85f36212edb5..84ddef60d3e6 100644 --- a/syft/pkg/rpm_metadata_test.go +++ b/syft/pkg/rpm_metadata_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/go-test/deep" + "github.com/sergi/go-diff/diffmatchpatch" "github.com/anchore/syft/syft/linux" - "github.com/sergi/go-diff/diffmatchpatch" ) func TestRpmMetadata_pURL(t *testing.T) { diff --git a/syft/pkg/type_test.go b/syft/pkg/type_test.go index 2b25749ae51e..5902185dc84b 100644 --- a/syft/pkg/type_test.go +++ b/syft/pkg/type_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/scylladb/go-set/strset" - "github.com/stretchr/testify/assert" ) diff --git a/syft/pkg/url_test.go b/syft/pkg/url_test.go index 85be8241f686..03b689d2d64a 100644 --- a/syft/pkg/url_test.go +++ b/syft/pkg/url_test.go @@ -3,10 +3,11 @@ package pkg import ( "testing" - "github.com/anchore/syft/syft/linux" "github.com/scylladb/go-set/strset" "github.com/sergi/go-diff/diffmatchpatch" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/syft/linux" ) func TestPackageURL(t *testing.T) { diff --git a/syft/sbom/multi_writer.go b/syft/sbom/multi_writer.go index 9dbb1124ff45..fc7eb8c4da53 100644 --- a/syft/sbom/multi_writer.go +++ b/syft/sbom/multi_writer.go @@ -5,9 +5,10 @@ import ( "os" "path" - "github.com/anchore/syft/internal/log" "github.com/hashicorp/go-multierror" "github.com/mitchellh/go-homedir" + + "github.com/anchore/syft/internal/log" ) // multiWriter holds a list of child sbom.Writers to apply all Write and Close operations to diff --git a/syft/source/all_layers_resolver_test.go b/syft/source/all_layers_resolver_test.go index e9e0780125f6..2eb17b82b24d 100644 --- a/syft/source/all_layers_resolver_test.go +++ b/syft/source/all_layers_resolver_test.go @@ -1,11 +1,11 @@ package source import ( - "github.com/stretchr/testify/require" "io" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/anchore/stereoscope/pkg/imagetest" ) diff --git a/syft/source/coordinate_set_test.go b/syft/source/coordinate_set_test.go index 5601cdc9152e..7f50a61ffd24 100644 --- a/syft/source/coordinate_set_test.go +++ b/syft/source/coordinate_set_test.go @@ -1,11 +1,12 @@ package source import ( - "github.com/anchore/syft/syft/artifact" - "github.com/stretchr/testify/require" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/artifact" ) func TestCoordinatesSet(t *testing.T) { diff --git a/syft/source/directory_resolver.go b/syft/source/directory_resolver.go index be90dd82a26c..700d1383e213 100644 --- a/syft/source/directory_resolver.go +++ b/syft/source/directory_resolver.go @@ -11,15 +11,15 @@ import ( "runtime" "strings" - "github.com/anchore/syft/internal" + "github.com/wagoodman/go-partybus" + "github.com/wagoodman/go-progress" "github.com/anchore/stereoscope/pkg/file" "github.com/anchore/stereoscope/pkg/filetree" + "github.com/anchore/syft/internal" "github.com/anchore/syft/internal/bus" "github.com/anchore/syft/internal/log" "github.com/anchore/syft/syft/event" - "github.com/wagoodman/go-partybus" - "github.com/wagoodman/go-progress" ) const WindowsOS = "windows" diff --git a/syft/source/directory_resolver_test.go b/syft/source/directory_resolver_test.go index f178414c55b2..bd67ec7443bb 100644 --- a/syft/source/directory_resolver_test.go +++ b/syft/source/directory_resolver_test.go @@ -15,13 +15,12 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/scylladb/go-set/strset" - - "github.com/anchore/stereoscope/pkg/file" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/wagoodman/go-progress" + + "github.com/anchore/stereoscope/pkg/file" ) func TestDirectoryResolver_FilesByPath_relativeRoot(t *testing.T) { diff --git a/syft/source/excluding_file_resolver_test.go b/syft/source/excluding_file_resolver_test.go index 4cfe187279be..958864e29209 100644 --- a/syft/source/excluding_file_resolver_test.go +++ b/syft/source/excluding_file_resolver_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/anchore/stereoscope/pkg/file" - "github.com/stretchr/testify/assert" + + "github.com/anchore/stereoscope/pkg/file" ) func TestExcludingResolver(t *testing.T) { diff --git a/syft/source/file_metadata.go b/syft/source/file_metadata.go index 432a1d8f4e08..8082c7512692 100644 --- a/syft/source/file_metadata.go +++ b/syft/source/file_metadata.go @@ -4,10 +4,8 @@ import ( "os" "github.com/anchore/stereoscope/pkg/file" - - "github.com/anchore/syft/internal/log" - "github.com/anchore/stereoscope/pkg/image" + "github.com/anchore/syft/internal/log" ) type FileMetadata struct { diff --git a/syft/source/image_squash_resolver_test.go b/syft/source/image_squash_resolver_test.go index 7f0819b9ec77..7bb7c9587691 100644 --- a/syft/source/image_squash_resolver_test.go +++ b/syft/source/image_squash_resolver_test.go @@ -1,12 +1,12 @@ package source import ( - "github.com/stretchr/testify/require" "io" "testing" "github.com/scylladb/go-set/strset" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/anchore/stereoscope/pkg/imagetest" ) diff --git a/syft/source/location_set_test.go b/syft/source/location_set_test.go index dc80a4962ca5..e9a98fe2bcbf 100644 --- a/syft/source/location_set_test.go +++ b/syft/source/location_set_test.go @@ -1,11 +1,12 @@ package source import ( - "github.com/anchore/syft/syft/artifact" - "github.com/stretchr/testify/require" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/artifact" ) func TestLocationSet(t *testing.T) { diff --git a/syft/source/location_test.go b/syft/source/location_test.go index eb3532058553..92b6ee45b9b7 100644 --- a/syft/source/location_test.go +++ b/syft/source/location_test.go @@ -3,8 +3,9 @@ package source import ( "testing" - "github.com/anchore/stereoscope/pkg/file" "github.com/stretchr/testify/assert" + + "github.com/anchore/stereoscope/pkg/file" ) func TestLocation_ID(t *testing.T) { diff --git a/syft/source/scheme.go b/syft/source/scheme.go index 1c90dba033a4..46a6214782cd 100644 --- a/syft/source/scheme.go +++ b/syft/source/scheme.go @@ -4,9 +4,10 @@ import ( "fmt" "strings" - "github.com/anchore/stereoscope/pkg/image" "github.com/mitchellh/go-homedir" "github.com/spf13/afero" + + "github.com/anchore/stereoscope/pkg/image" ) // Scheme represents the optional prefixed string at the beginning of a user request (e.g. "docker:"). diff --git a/syft/source/scheme_test.go b/syft/source/scheme_test.go index 4e94f602c37f..0523f977ec1b 100644 --- a/syft/source/scheme_test.go +++ b/syft/source/scheme_test.go @@ -4,10 +4,11 @@ import ( "os" "testing" - "github.com/anchore/stereoscope/pkg/image" "github.com/mitchellh/go-homedir" "github.com/spf13/afero" "github.com/stretchr/testify/assert" + + "github.com/anchore/stereoscope/pkg/image" ) func TestDetectScheme(t *testing.T) { diff --git a/syft/source/source.go b/syft/source/source.go index 855cbae0f9d4..2a27d8ae3c0e 100644 --- a/syft/source/source.go +++ b/syft/source/source.go @@ -13,12 +13,13 @@ import ( "strings" "sync" - "github.com/anchore/stereoscope" - "github.com/anchore/stereoscope/pkg/image" - "github.com/anchore/syft/internal/log" "github.com/bmatcuk/doublestar/v4" "github.com/mholt/archiver/v3" "github.com/spf13/afero" + + "github.com/anchore/stereoscope" + "github.com/anchore/stereoscope/pkg/image" + "github.com/anchore/syft/internal/log" ) // Source is an object that captures the data source to be cataloged, configuration, and a specific resolver used diff --git a/syft/source/source_test.go b/syft/source/source_test.go index 8945e36cd432..b7e960fcb457 100644 --- a/syft/source/source_test.go +++ b/syft/source/source_test.go @@ -13,13 +13,11 @@ import ( "syscall" "testing" - "github.com/anchore/stereoscope/pkg/imagetest" - - "github.com/stretchr/testify/require" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/anchore/stereoscope/pkg/image" + "github.com/anchore/stereoscope/pkg/imagetest" ) func TestParseInput(t *testing.T) { diff --git a/test/cli/all_formats_expressible_test.go b/test/cli/all_formats_expressible_test.go index a48639d765fa..7a70da16c3a1 100644 --- a/test/cli/all_formats_expressible_test.go +++ b/test/cli/all_formats_expressible_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/anchore/syft/internal/formats/template" "github.com/anchore/syft/syft" + "github.com/anchore/syft/syft/formats/template" ) func TestAllFormatsExpressible(t *testing.T) { diff --git a/test/cli/attest_cmd_test.go b/test/cli/attest_cmd_test.go index 43a1d0404502..ef264c7aa082 100644 --- a/test/cli/attest_cmd_test.go +++ b/test/cli/attest_cmd_test.go @@ -40,6 +40,14 @@ func TestAttestCmd(t *testing.T) { }, pw: "", }, + { + name: "can encode syft.json as the predicate given a user format typo", + args: []string{"attest", "-o", "spdx-jsonx", "--key", "cosign.key", img}, + assertions: []traitAssertion{ + assertSuccessfulReturnCode, + }, + pw: "", + }, } for _, test := range tests { diff --git a/test/cli/json_schema_test.go b/test/cli/json_schema_test.go index d4ea995df7f3..508e7c5fa42c 100644 --- a/test/cli/json_schema_test.go +++ b/test/cli/json_schema_test.go @@ -6,9 +6,10 @@ import ( "strings" "testing" + "github.com/xeipuuv/gojsonschema" + "github.com/anchore/stereoscope/pkg/imagetest" "github.com/anchore/syft/internal" - "github.com/xeipuuv/gojsonschema" ) // this is the path to the json schema directory relative to the root of the repo diff --git a/test/cli/spdx_json_schema_test.go b/test/cli/spdx_json_schema_test.go index f9d036c0518b..25c7d18c882e 100644 --- a/test/cli/spdx_json_schema_test.go +++ b/test/cli/spdx_json_schema_test.go @@ -6,8 +6,9 @@ import ( "strings" "testing" - "github.com/anchore/stereoscope/pkg/imagetest" "github.com/xeipuuv/gojsonschema" + + "github.com/anchore/stereoscope/pkg/imagetest" ) // this is the path to the json schema directory relative to the root of the repo diff --git a/test/integration/catalog_packages_test.go b/test/integration/catalog_packages_test.go index 3b2cd76931b3..71f5e0c8eb24 100644 --- a/test/integration/catalog_packages_test.go +++ b/test/integration/catalog_packages_test.go @@ -3,18 +3,16 @@ package integration import ( "testing" + "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/anchore/syft/syft/linux" - "github.com/anchore/syft/syft/pkg/cataloger" - "github.com/google/go-cmp/cmp" - "github.com/anchore/stereoscope/pkg/imagetest" - "github.com/anchore/syft/syft/source" - "github.com/anchore/syft/internal" + "github.com/anchore/syft/syft/linux" "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/pkg/cataloger" + "github.com/anchore/syft/syft/source" ) func BenchmarkImagePackageCatalogers(b *testing.B) { diff --git a/test/integration/convert_test.go b/test/integration/convert_test.go index 1efed8a5a7a6..c50d4fd098b4 100644 --- a/test/integration/convert_test.go +++ b/test/integration/convert_test.go @@ -6,18 +6,19 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/anchore/syft/cmd/syft/cli/convert" "github.com/anchore/syft/internal/config" - "github.com/anchore/syft/internal/formats/cyclonedxjson" - "github.com/anchore/syft/internal/formats/cyclonedxxml" - "github.com/anchore/syft/internal/formats/spdx22json" - "github.com/anchore/syft/internal/formats/spdx22tagvalue" - "github.com/anchore/syft/internal/formats/syftjson" - "github.com/anchore/syft/internal/formats/table" "github.com/anchore/syft/syft" + "github.com/anchore/syft/syft/formats/cyclonedxjson" + "github.com/anchore/syft/syft/formats/cyclonedxxml" + "github.com/anchore/syft/syft/formats/spdx22json" + "github.com/anchore/syft/syft/formats/spdx22tagvalue" + "github.com/anchore/syft/syft/formats/syftjson" + "github.com/anchore/syft/syft/formats/table" "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/require" ) var convertibleFormats = []sbom.Format{ diff --git a/test/integration/distro_test.go b/test/integration/distro_test.go index 07360f6ebfbe..d2159660ff8f 100644 --- a/test/integration/distro_test.go +++ b/test/integration/distro_test.go @@ -3,11 +3,10 @@ package integration import ( "testing" - "github.com/anchore/syft/syft/source" - "github.com/stretchr/testify/assert" "github.com/anchore/syft/syft/linux" + "github.com/anchore/syft/syft/source" ) func TestDistroImage(t *testing.T) { diff --git a/test/integration/encode_decode_cycle_test.go b/test/integration/encode_decode_cycle_test.go index bc9f0b4151e0..5b9e82dfb857 100644 --- a/test/integration/encode_decode_cycle_test.go +++ b/test/integration/encode_decode_cycle_test.go @@ -6,20 +6,17 @@ import ( "regexp" "testing" - "github.com/anchore/syft/internal/formats/cyclonedxjson" - "github.com/anchore/syft/internal/formats/cyclonedxxml" - "github.com/anchore/syft/internal/formats/syftjson" - "github.com/anchore/syft/syft/source" "github.com/google/go-cmp/cmp" - - "github.com/anchore/syft/syft/sbom" + "github.com/sergi/go-diff/diffmatchpatch" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/anchore/syft/syft" - - "github.com/sergi/go-diff/diffmatchpatch" - - "github.com/stretchr/testify/assert" + "github.com/anchore/syft/syft/formats/cyclonedxjson" + "github.com/anchore/syft/syft/formats/cyclonedxxml" + "github.com/anchore/syft/syft/formats/syftjson" + "github.com/anchore/syft/syft/sbom" + "github.com/anchore/syft/syft/source" ) // TestEncodeDecodeEncodeCycleComparison is testing for differences in how SBOM documents get encoded on multiple cycles. diff --git a/test/integration/license_list_test.go b/test/integration/license_list_test.go index e0e384123b87..7a441e953778 100644 --- a/test/integration/license_list_test.go +++ b/test/integration/license_list_test.go @@ -5,8 +5,9 @@ import ( "net/http" "testing" - "github.com/anchore/syft/internal/spdxlicense" "github.com/stretchr/testify/assert" + + "github.com/anchore/syft/internal/spdxlicense" ) func TestSPDXLicenseListIsTheLatest(t *testing.T) { diff --git a/test/integration/package_deduplication_test.go b/test/integration/package_deduplication_test.go index 4e9171b18f89..f00e854a6e07 100644 --- a/test/integration/package_deduplication_test.go +++ b/test/integration/package_deduplication_test.go @@ -6,9 +6,10 @@ import ( "fmt" "testing" - "github.com/anchore/syft/syft/source" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/anchore/syft/syft/source" ) func TestPackageDeduplication(t *testing.T) { diff --git a/test/integration/package_ownership_relationship_test.go b/test/integration/package_ownership_relationship_test.go index e85cd88db43c..4ca1873a1ef9 100644 --- a/test/integration/package_ownership_relationship_test.go +++ b/test/integration/package_ownership_relationship_test.go @@ -5,10 +5,9 @@ import ( "encoding/json" "testing" + "github.com/anchore/syft/syft/formats/syftjson" + syftjsonModel "github.com/anchore/syft/syft/formats/syftjson/model" "github.com/anchore/syft/syft/source" - - "github.com/anchore/syft/internal/formats/syftjson" - syftjsonModel "github.com/anchore/syft/internal/formats/syftjson/model" ) func TestPackageOwnershipRelationships(t *testing.T) { diff --git a/test/integration/regression_apk_scanner_buffer_size_test.go b/test/integration/regression_apk_scanner_buffer_size_test.go index e6fdf58dd0c4..a04cbe3e64c3 100644 --- a/test/integration/regression_apk_scanner_buffer_size_test.go +++ b/test/integration/regression_apk_scanner_buffer_size_test.go @@ -3,9 +3,8 @@ package integration import ( "testing" - "github.com/anchore/syft/syft/source" - "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestRegression212ApkBufferSize(t *testing.T) { diff --git a/test/integration/regression_go_bin_scanner_arch_test.go b/test/integration/regression_go_bin_scanner_arch_test.go index a0ae70c85268..2465d5dabd15 100644 --- a/test/integration/regression_go_bin_scanner_arch_test.go +++ b/test/integration/regression_go_bin_scanner_arch_test.go @@ -4,9 +4,8 @@ import ( "strings" "testing" - "github.com/anchore/syft/syft/source" - "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestRegressionGoArchDiscovery(t *testing.T) { diff --git a/test/integration/sqlite_rpmdb_test.go b/test/integration/sqlite_rpmdb_test.go index 73b78045104b..b476423902bb 100644 --- a/test/integration/sqlite_rpmdb_test.go +++ b/test/integration/sqlite_rpmdb_test.go @@ -3,9 +3,8 @@ package integration import ( "testing" - "github.com/anchore/syft/syft/source" - "github.com/anchore/syft/syft/pkg" + "github.com/anchore/syft/syft/source" ) func TestSqliteRpm(t *testing.T) { diff --git a/test/integration/utils_test.go b/test/integration/utils_test.go index 81bd76061b27..c3f6abf461c0 100644 --- a/test/integration/utils_test.go +++ b/test/integration/utils_test.go @@ -5,12 +5,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/anchore/syft/syft/pkg/cataloger" - - "github.com/anchore/syft/syft/sbom" - "github.com/anchore/stereoscope/pkg/imagetest" "github.com/anchore/syft/syft" + "github.com/anchore/syft/syft/pkg/cataloger" + "github.com/anchore/syft/syft/sbom" "github.com/anchore/syft/syft/source" ) diff --git a/ui/event_handlers.go b/ui/event_handlers.go index 43c04a9fb2dd..0fa56fd435b4 100644 --- a/ui/event_handlers.go +++ b/ui/event_handlers.go @@ -8,17 +8,18 @@ import ( "sync" "time" - stereoEventParsers "github.com/anchore/stereoscope/pkg/event/parsers" - "github.com/anchore/stereoscope/pkg/image/docker" - "github.com/anchore/syft/internal" - "github.com/anchore/syft/internal/ui/components" - syftEventParsers "github.com/anchore/syft/syft/event/parsers" "github.com/dustin/go-humanize" "github.com/gookit/color" "github.com/wagoodman/go-partybus" "github.com/wagoodman/go-progress" "github.com/wagoodman/go-progress/format" "github.com/wagoodman/jotframe/pkg/frame" + + stereoEventParsers "github.com/anchore/stereoscope/pkg/event/parsers" + "github.com/anchore/stereoscope/pkg/image/docker" + "github.com/anchore/syft/internal" + "github.com/anchore/syft/internal/ui/components" + syftEventParsers "github.com/anchore/syft/syft/event/parsers" ) const maxBarWidth = 50 diff --git a/ui/handler.go b/ui/handler.go index bf9eb81d3641..c4c98a733428 100644 --- a/ui/handler.go +++ b/ui/handler.go @@ -9,10 +9,11 @@ import ( "context" "sync" - stereoscopeEvent "github.com/anchore/stereoscope/pkg/event" - syftEvent "github.com/anchore/syft/syft/event" "github.com/wagoodman/go-partybus" "github.com/wagoodman/jotframe/pkg/frame" + + stereoscopeEvent "github.com/anchore/stereoscope/pkg/event" + syftEvent "github.com/anchore/syft/syft/event" ) // Handler is an aggregated event handler for the set of supported events (PullDockerImage, ReadImage, FetchImage, PackageCatalogerStarted)