From 92600c02449c5f0d1d89faa0f07e4c86cf161f35 Mon Sep 17 00:00:00 2001 From: Bengt Wegner <87223648+Petzys@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:31:18 +0200 Subject: [PATCH] chore: Renamed go module to allow go install of the tool (#11) Signed-off-by: Bengt Wegner --- cbomkit-theia.go | 2 +- cbomkit-theia_test.go | 10 +++++----- cmd/dir.go | 7 ++++--- cmd/image/build.go | 2 +- cmd/image/get.go | 2 +- cmd/image/image.go | 9 +++++---- cmd/root.go | 5 +++-- cmd/server.go | 2 +- go.mod | 2 +- provider/docker/image.go | 2 +- provider/docker/layer.go | 4 ++-- provider/filesystem/filesystem.go | 3 ++- scanner/bom-dag/vertex.go | 2 +- .../componentwithconfidence-slice.go | 2 +- scanner/plugins/certificates/certificates.go | 11 ++++++----- scanner/plugins/certificates/x509.go | 4 ++-- scanner/plugins/javasecurity/config_parsing.go | 7 ++++--- scanner/plugins/javasecurity/config_parsing_test.go | 3 ++- scanner/plugins/javasecurity/javasecurity.go | 9 +++++---- .../plugins/javasecurity/protocol_restrictions.go | 7 ++++--- scanner/plugins/plugin.go | 3 ++- scanner/plugins/secrets/secrets.go | 9 +++++---- scanner/scanner.go | 13 +++++++------ server/server.go | 9 +++++---- 24 files changed, 71 insertions(+), 58 deletions(-) diff --git a/cbomkit-theia.go b/cbomkit-theia.go index 84fab6a..f2f2e7f 100644 --- a/cbomkit-theia.go +++ b/cbomkit-theia.go @@ -17,7 +17,7 @@ package main import ( - "ibm/cbomkit-theia/cmd" + "github.com/IBM/cbomkit-theia/cmd" "log/slog" "os" ) diff --git a/cbomkit-theia_test.go b/cbomkit-theia_test.go index 1f07a57..9468199 100644 --- a/cbomkit-theia_test.go +++ b/cbomkit-theia_test.go @@ -24,11 +24,11 @@ import ( "path/filepath" "testing" - "ibm/cbomkit-theia/provider/cyclonedx" - "ibm/cbomkit-theia/provider/docker" - "ibm/cbomkit-theia/provider/filesystem" - "ibm/cbomkit-theia/scanner" - "ibm/cbomkit-theia/scanner/hash" + "github.com/IBM/cbomkit-theia/provider/cyclonedx" + "github.com/IBM/cbomkit-theia/provider/docker" + "github.com/IBM/cbomkit-theia/provider/filesystem" + "github.com/IBM/cbomkit-theia/scanner" + "github.com/IBM/cbomkit-theia/scanner/hash" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" diff --git a/cmd/dir.go b/cmd/dir.go index 8a549dd..cd96b04 100644 --- a/cmd/dir.go +++ b/cmd/dir.go @@ -17,12 +17,13 @@ package cmd import ( - "ibm/cbomkit-theia/provider/filesystem" - "ibm/cbomkit-theia/scanner" - "ibm/cbomkit-theia/scanner/plugins" "io" "os" + "github.com/IBM/cbomkit-theia/provider/filesystem" + "github.com/IBM/cbomkit-theia/scanner" + "github.com/IBM/cbomkit-theia/scanner/plugins" + "github.com/spf13/cobra" "github.com/spf13/viper" "go.uber.org/dig" diff --git a/cmd/image/build.go b/cmd/image/build.go index f9f628d..0b2cab3 100644 --- a/cmd/image/build.go +++ b/cmd/image/build.go @@ -17,7 +17,7 @@ package image import ( - "ibm/cbomkit-theia/provider/docker" + "github.com/IBM/cbomkit-theia/provider/docker" "github.com/spf13/cobra" ) diff --git a/cmd/image/get.go b/cmd/image/get.go index ceb697e..eebf240 100644 --- a/cmd/image/get.go +++ b/cmd/image/get.go @@ -17,7 +17,7 @@ package image import ( - "ibm/cbomkit-theia/provider/docker" + "github.com/IBM/cbomkit-theia/provider/docker" "github.com/spf13/cobra" ) diff --git a/cmd/image/image.go b/cmd/image/image.go index 5f64afe..7e616fa 100644 --- a/cmd/image/image.go +++ b/cmd/image/image.go @@ -17,13 +17,14 @@ package image import ( - "ibm/cbomkit-theia/provider/docker" - "ibm/cbomkit-theia/provider/filesystem" - "ibm/cbomkit-theia/scanner" - "ibm/cbomkit-theia/scanner/plugins" "io" "os" + "github.com/IBM/cbomkit-theia/provider/docker" + "github.com/IBM/cbomkit-theia/provider/filesystem" + "github.com/IBM/cbomkit-theia/scanner" + "github.com/IBM/cbomkit-theia/scanner/plugins" + "github.com/spf13/cobra" "github.com/spf13/viper" "go.uber.org/dig" diff --git a/cmd/root.go b/cmd/root.go index 065ad3f..77a4924 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -18,11 +18,12 @@ package cmd import ( "fmt" - "ibm/cbomkit-theia/cmd/image" - "ibm/cbomkit-theia/scanner" "os" "path/filepath" + "github.com/IBM/cbomkit-theia/cmd/image" + "github.com/IBM/cbomkit-theia/scanner" + "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cmd/server.go b/cmd/server.go index 02eb2cf..a759efb 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -17,7 +17,7 @@ package cmd import ( - "ibm/cbomkit-theia/server" + "github.com/IBM/cbomkit-theia/server" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 813773d..26b641d 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module ibm/cbomkit-theia +module github.com/IBM/cbomkit-theia go 1.23.0 diff --git a/provider/docker/image.go b/provider/docker/image.go index fbb11ea..23614fd 100644 --- a/provider/docker/image.go +++ b/provider/docker/image.go @@ -27,7 +27,7 @@ import ( "path/filepath" "strings" - "ibm/cbomkit-theia/provider/filesystem" + "github.com/IBM/cbomkit-theia/provider/filesystem" "github.com/anchore/go-logger" "github.com/anchore/go-logger/adapter/logrus" diff --git a/provider/docker/layer.go b/provider/docker/layer.go index cc4ac9d..7745453 100644 --- a/provider/docker/layer.go +++ b/provider/docker/layer.go @@ -22,8 +22,8 @@ import ( "io" "log/slog" - "ibm/cbomkit-theia/provider/filesystem" - scanner_errors "ibm/cbomkit-theia/scanner/errors" + "github.com/IBM/cbomkit-theia/provider/filesystem" + scanner_errors "github.com/IBM/cbomkit-theia/scanner/errors" "github.com/anchore/stereoscope/pkg/file" "github.com/anchore/stereoscope/pkg/filetree/filenode" diff --git a/provider/filesystem/filesystem.go b/provider/filesystem/filesystem.go index c533477..8129695 100644 --- a/provider/filesystem/filesystem.go +++ b/provider/filesystem/filesystem.go @@ -19,13 +19,14 @@ package filesystem import ( go_errors "errors" "fmt" - scanner_errors "ibm/cbomkit-theia/scanner/errors" "io" "io/fs" "log/slog" "os" "path/filepath" + scanner_errors "github.com/IBM/cbomkit-theia/scanner/errors" + v1 "github.com/google/go-containerregistry/pkg/v1" ) diff --git a/scanner/bom-dag/vertex.go b/scanner/bom-dag/vertex.go index a01745b..3fc02d8 100644 --- a/scanner/bom-dag/vertex.go +++ b/scanner/bom-dag/vertex.go @@ -17,7 +17,7 @@ package bomdag import ( - "ibm/cbomkit-theia/scanner/hash" + "github.com/IBM/cbomkit-theia/scanner/hash" "github.com/dominikbraun/graph" ) diff --git a/scanner/componentwithconfidenceslice/componentwithconfidence-slice.go b/scanner/componentwithconfidenceslice/componentwithconfidence-slice.go index bdfe8aa..18f4dbf 100644 --- a/scanner/componentwithconfidenceslice/componentwithconfidence-slice.go +++ b/scanner/componentwithconfidenceslice/componentwithconfidence-slice.go @@ -17,7 +17,7 @@ package componentwithconfidenceslice import ( - "ibm/cbomkit-theia/scanner/confidencelevel" + "github.com/IBM/cbomkit-theia/scanner/confidencelevel" cdx "github.com/CycloneDX/cyclonedx-go" ) diff --git a/scanner/plugins/certificates/certificates.go b/scanner/plugins/certificates/certificates.go index 2fbd12c..c170f5a 100644 --- a/scanner/plugins/certificates/certificates.go +++ b/scanner/plugins/certificates/certificates.go @@ -19,19 +19,20 @@ package certificates import ( "encoding/pem" "errors" - "ibm/cbomkit-theia/provider/filesystem" - scanner_errors "ibm/cbomkit-theia/scanner/errors" - pemutility "ibm/cbomkit-theia/scanner/pem-utility" - "ibm/cbomkit-theia/scanner/plugins" "log/slog" "os" "path/filepath" "slices" "strings" + "github.com/IBM/cbomkit-theia/provider/filesystem" + scanner_errors "github.com/IBM/cbomkit-theia/scanner/errors" + pemutility "github.com/IBM/cbomkit-theia/scanner/pem-utility" + "github.com/IBM/cbomkit-theia/scanner/plugins" + "go.mozilla.org/pkcs7" - bomdag "ibm/cbomkit-theia/scanner/bom-dag" + bomdag "github.com/IBM/cbomkit-theia/scanner/bom-dag" cdx "github.com/CycloneDX/cyclonedx-go" ) diff --git a/scanner/plugins/certificates/x509.go b/scanner/plugins/certificates/x509.go index c486a9d..ffb1397 100644 --- a/scanner/plugins/certificates/x509.go +++ b/scanner/plugins/certificates/x509.go @@ -23,8 +23,8 @@ import ( "path/filepath" "time" - bomdag "ibm/cbomkit-theia/scanner/bom-dag" - pemutility "ibm/cbomkit-theia/scanner/pem-utility" + bomdag "github.com/IBM/cbomkit-theia/scanner/bom-dag" + pemutility "github.com/IBM/cbomkit-theia/scanner/pem-utility" "github.com/google/uuid" diff --git a/scanner/plugins/javasecurity/config_parsing.go b/scanner/plugins/javasecurity/config_parsing.go index 5d512cf..dc93f6b 100644 --- a/scanner/plugins/javasecurity/config_parsing.go +++ b/scanner/plugins/javasecurity/config_parsing.go @@ -19,14 +19,15 @@ package javasecurity import ( go_errors "errors" "fmt" - "ibm/cbomkit-theia/provider/filesystem" - advancedcomponentslice "ibm/cbomkit-theia/scanner/componentwithconfidenceslice" - scanner_errors "ibm/cbomkit-theia/scanner/errors" "log/slog" "path/filepath" "strconv" "strings" + "github.com/IBM/cbomkit-theia/provider/filesystem" + advancedcomponentslice "github.com/IBM/cbomkit-theia/scanner/componentwithconfidenceslice" + scanner_errors "github.com/IBM/cbomkit-theia/scanner/errors" + cdx "github.com/CycloneDX/cyclonedx-go" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/magiconair/properties" diff --git a/scanner/plugins/javasecurity/config_parsing_test.go b/scanner/plugins/javasecurity/config_parsing_test.go index d4005a1..ab43063 100644 --- a/scanner/plugins/javasecurity/config_parsing_test.go +++ b/scanner/plugins/javasecurity/config_parsing_test.go @@ -18,11 +18,12 @@ package javasecurity import ( "fmt" - "ibm/cbomkit-theia/provider/docker" "os" "strconv" "testing" + "github.com/IBM/cbomkit-theia/provider/docker" + "github.com/magiconair/properties" "github.com/stretchr/testify/assert" ) diff --git a/scanner/plugins/javasecurity/javasecurity.go b/scanner/plugins/javasecurity/javasecurity.go index 5f6892c..90f6f43 100644 --- a/scanner/plugins/javasecurity/javasecurity.go +++ b/scanner/plugins/javasecurity/javasecurity.go @@ -19,15 +19,16 @@ package javasecurity import ( go_errors "errors" "fmt" - "ibm/cbomkit-theia/provider/filesystem" - advancedcomponentslice "ibm/cbomkit-theia/scanner/componentwithconfidenceslice" - scanner_errors "ibm/cbomkit-theia/scanner/errors" - "ibm/cbomkit-theia/scanner/plugins" "log/slog" "os" "path/filepath" "strings" + "github.com/IBM/cbomkit-theia/provider/filesystem" + advancedcomponentslice "github.com/IBM/cbomkit-theia/scanner/componentwithconfidenceslice" + scanner_errors "github.com/IBM/cbomkit-theia/scanner/errors" + "github.com/IBM/cbomkit-theia/scanner/plugins" + cdx "github.com/CycloneDX/cyclonedx-go" v1 "github.com/google/go-containerregistry/pkg/v1" "github.com/magiconair/properties" diff --git a/scanner/plugins/javasecurity/protocol_restrictions.go b/scanner/plugins/javasecurity/protocol_restrictions.go index 954d501..db66524 100644 --- a/scanner/plugins/javasecurity/protocol_restrictions.go +++ b/scanner/plugins/javasecurity/protocol_restrictions.go @@ -19,13 +19,14 @@ package javasecurity import ( go_errors "errors" "fmt" - advancedcomponentslice "ibm/cbomkit-theia/scanner/componentwithconfidenceslice" - "ibm/cbomkit-theia/scanner/confidencelevel" - scanner_errors "ibm/cbomkit-theia/scanner/errors" "log/slog" "strconv" "strings" + advancedcomponentslice "github.com/IBM/cbomkit-theia/scanner/componentwithconfidenceslice" + "github.com/IBM/cbomkit-theia/scanner/confidencelevel" + scanner_errors "github.com/IBM/cbomkit-theia/scanner/errors" + cdx "github.com/CycloneDX/cyclonedx-go" ) diff --git a/scanner/plugins/plugin.go b/scanner/plugins/plugin.go index d479230..a6f5af0 100644 --- a/scanner/plugins/plugin.go +++ b/scanner/plugins/plugin.go @@ -17,9 +17,10 @@ package plugins import ( - "ibm/cbomkit-theia/provider/filesystem" "strings" + "github.com/IBM/cbomkit-theia/provider/filesystem" + cdx "github.com/CycloneDX/cyclonedx-go" ) diff --git a/scanner/plugins/secrets/secrets.go b/scanner/plugins/secrets/secrets.go index 4d17d21..1ef4115 100644 --- a/scanner/plugins/secrets/secrets.go +++ b/scanner/plugins/secrets/secrets.go @@ -17,13 +17,14 @@ package secrets import ( - "ibm/cbomkit-theia/provider/filesystem" - bomdag "ibm/cbomkit-theia/scanner/bom-dag" - pemutility "ibm/cbomkit-theia/scanner/pem-utility" - "ibm/cbomkit-theia/scanner/plugins" "log/slog" "strings" + "github.com/IBM/cbomkit-theia/provider/filesystem" + bomdag "github.com/IBM/cbomkit-theia/scanner/bom-dag" + pemutility "github.com/IBM/cbomkit-theia/scanner/pem-utility" + "github.com/IBM/cbomkit-theia/scanner/plugins" + cdx "github.com/CycloneDX/cyclonedx-go" "github.com/gabriel-vasile/mimetype" "github.com/zricethezav/gitleaks/v8/detect" diff --git a/scanner/scanner.go b/scanner/scanner.go index 622d8e4..03b159d 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -19,12 +19,6 @@ package scanner import ( "errors" "fmt" - "ibm/cbomkit-theia/provider/cyclonedx" - "ibm/cbomkit-theia/provider/filesystem" - plugin_package "ibm/cbomkit-theia/scanner/plugins" - "ibm/cbomkit-theia/scanner/plugins/certificates" - "ibm/cbomkit-theia/scanner/plugins/javasecurity" - "ibm/cbomkit-theia/scanner/plugins/secrets" "io" "log" "log/slog" @@ -32,6 +26,13 @@ import ( "slices" "time" + "github.com/IBM/cbomkit-theia/provider/cyclonedx" + "github.com/IBM/cbomkit-theia/provider/filesystem" + plugin_package "github.com/IBM/cbomkit-theia/scanner/plugins" + "github.com/IBM/cbomkit-theia/scanner/plugins/certificates" + "github.com/IBM/cbomkit-theia/scanner/plugins/javasecurity" + "github.com/IBM/cbomkit-theia/scanner/plugins/secrets" + cdx "github.com/CycloneDX/cyclonedx-go" "github.com/google/uuid" "go.uber.org/dig" diff --git a/server/server.go b/server/server.go index 586fc6e..02bbda9 100644 --- a/server/server.go +++ b/server/server.go @@ -18,13 +18,14 @@ package server import ( "bytes" - "ibm/cbomkit-theia/provider/docker" - "ibm/cbomkit-theia/provider/filesystem" - "ibm/cbomkit-theia/scanner" - "ibm/cbomkit-theia/scanner/plugins" "io" "net/http" + "github.com/IBM/cbomkit-theia/provider/docker" + "github.com/IBM/cbomkit-theia/provider/filesystem" + "github.com/IBM/cbomkit-theia/scanner" + "github.com/IBM/cbomkit-theia/scanner/plugins" + "go.uber.org/dig" cdx "github.com/CycloneDX/cyclonedx-go"