From 44002a0d17d34e8c947273e5f14ff229483193b0 Mon Sep 17 00:00:00 2001 From: Eyal Ben Moshe Date: Mon, 25 Dec 2023 17:38:11 +0200 Subject: [PATCH 1/9] Promote to v1.35.4 (#880) --- go.mod | 2 +- go.sum | 4 ++-- utils/utils.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index ca691a585..8b334abd1 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.0 github.com/gookit/color v1.5.4 github.com/jfrog/build-info-go v1.9.18 - github.com/jfrog/gofrog v1.3.2 + github.com/jfrog/gofrog v1.4.0 github.com/mholt/archiver/v3 v3.5.1 github.com/stretchr/testify v1.8.4 github.com/xanzy/ssh-agent v0.3.3 diff --git a/go.sum b/go.sum index ec9586d68..33353af50 100644 --- a/go.sum +++ b/go.sum @@ -52,8 +52,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jfrog/build-info-go v1.9.18 h1:0RKeZtNWZjONX5j94aIPQSKMi1whP2evmGQymYF+5mA= github.com/jfrog/build-info-go v1.9.18/go.mod h1:/5VZXH2Ud0IK3cOFwPykjwPOaEcHhzzbjnRiou+YKpM= -github.com/jfrog/gofrog v1.3.2 h1:TktKP+PdZdxjkYZxWWIq4DkTGSYtr9Slsy+egZpEhUY= -github.com/jfrog/gofrog v1.3.2/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q= +github.com/jfrog/gofrog v1.4.0 h1:s7eysVnmIBfVheMs4LPU43MAlxwPa4K8u2N5h7kwzXA= +github.com/jfrog/gofrog v1.4.0/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= diff --git a/utils/utils.go b/utils/utils.go index adb64a321..62b47c022 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -27,7 +27,7 @@ import ( const ( Development = "development" Agent = "jfrog-client-go" - Version = "1.35.3" + Version = "1.35.4" ) type MinVersionProduct string From cb36746174b8593e6bbb427bd3eae4f240aa0a53 Mon Sep 17 00:00:00 2001 From: Omer Zidkoni <50792403+omerzi@users.noreply.github.com> Date: Wed, 27 Dec 2023 10:14:23 +0200 Subject: [PATCH 2/9] Update dependencies (#881) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8b334abd1..3337905bf 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-git/go-git/v5 v5.11.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/gookit/color v1.5.4 - github.com/jfrog/build-info-go v1.9.18 + github.com/jfrog/build-info-go v1.9.19 github.com/jfrog/gofrog v1.4.0 github.com/mholt/archiver/v3 v3.5.1 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index 33353af50..db7476e10 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jfrog/build-info-go v1.9.18 h1:0RKeZtNWZjONX5j94aIPQSKMi1whP2evmGQymYF+5mA= -github.com/jfrog/build-info-go v1.9.18/go.mod h1:/5VZXH2Ud0IK3cOFwPykjwPOaEcHhzzbjnRiou+YKpM= +github.com/jfrog/build-info-go v1.9.19 h1:tFPR0Je+ETLXcJqa7UrICkSjwc27zeY06AoWaMYPdQI= +github.com/jfrog/build-info-go v1.9.19/go.mod h1:DBxqvz1N/uI9iI/1gkCfjKjOrlcCzQ3hiKXqtKJUrrY= github.com/jfrog/gofrog v1.4.0 h1:s7eysVnmIBfVheMs4LPU43MAlxwPa4K8u2N5h7kwzXA= github.com/jfrog/gofrog v1.4.0/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= From 2d35a984b7d86b9a3a5dd94a9b2b2896e5179331 Mon Sep 17 00:00:00 2001 From: Omer Zidkoni <50792403+omerzi@users.noreply.github.com> Date: Wed, 27 Dec 2023 10:38:00 +0200 Subject: [PATCH 3/9] Promote version to 1.35.5 (#882) --- utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index 62b47c022..5e68bd969 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -27,7 +27,7 @@ import ( const ( Development = "development" Agent = "jfrog-client-go" - Version = "1.35.4" + Version = "1.35.5" ) type MinVersionProduct string From b17dd66513bce717146f03e84fac10bdd867a9bf Mon Sep 17 00:00:00 2001 From: Asaf Ambar Date: Thu, 4 Jan 2024 09:29:31 +0200 Subject: [PATCH 4/9] Graph Scan internal API - New GraphNode field added to GraphNode (#884) --- xray/services/utils/graph.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xray/services/utils/graph.go b/xray/services/utils/graph.go index d976d55a6..f4d09a485 100644 --- a/xray/services/utils/graph.go +++ b/xray/services/utils/graph.go @@ -30,11 +30,13 @@ type OtherComponentIds struct { // Audit Graph Node type GraphNode struct { - Id string `json:"component_id,omitempty"` - // List of subcomponents. - Nodes []*GraphNode `json:"nodes,omitempty"` // Node parent (for internal use) Parent *GraphNode `json:"-"` + // Node file types (tar, jar, zip, pom) + Types *[]string `json:"-"` + Id string `json:"component_id,omitempty"` + // List of subcomponents. + Nodes []*GraphNode `json:"nodes,omitempty"` } func (currNode *GraphNode) NodeHasLoop() bool { From 908b262b8fdd18267e9ee1e77b32b7c67f215e82 Mon Sep 17 00:00:00 2001 From: Omer Zidkoni <50792403+omerzi@users.noreply.github.com> Date: Sun, 7 Jan 2024 14:16:14 +0200 Subject: [PATCH 5/9] Promote to 1.35.6 (#885) --- go.mod | 6 +++--- go.sum | 12 ++++++------ tests/utils_test.go | 2 +- utils/utils.go | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 3337905bf..dbf6f61fd 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/go-git/go-git/v5 v5.11.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/gookit/color v1.5.4 - github.com/jfrog/build-info-go v1.9.19 - github.com/jfrog/gofrog v1.4.0 - github.com/mholt/archiver/v3 v3.5.1 + github.com/jfrog/archiver/v3 v3.5.3 + github.com/jfrog/build-info-go v1.9.20 + github.com/jfrog/gofrog v1.4.1 github.com/stretchr/testify v1.8.4 github.com/xanzy/ssh-agent v0.3.3 golang.org/x/crypto v0.17.0 diff --git a/go.sum b/go.sum index db7476e10..3b346ba89 100644 --- a/go.sum +++ b/go.sum @@ -50,10 +50,12 @@ github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jfrog/build-info-go v1.9.19 h1:tFPR0Je+ETLXcJqa7UrICkSjwc27zeY06AoWaMYPdQI= -github.com/jfrog/build-info-go v1.9.19/go.mod h1:DBxqvz1N/uI9iI/1gkCfjKjOrlcCzQ3hiKXqtKJUrrY= -github.com/jfrog/gofrog v1.4.0 h1:s7eysVnmIBfVheMs4LPU43MAlxwPa4K8u2N5h7kwzXA= -github.com/jfrog/gofrog v1.4.0/go.mod h1:AQo5Fq0G9nDEF6icH7MYQK0iohR4HuEAXl8jaxRuT6Q= +github.com/jfrog/archiver/v3 v3.5.3 h1:Udz6+z/YIhTFmcEp1TeW2DEwNyo7JSAnrGUsrbL2FZI= +github.com/jfrog/archiver/v3 v3.5.3/go.mod h1:/MbmBhPzkliu9PtweAg9lCYHGcKdapwMMZS/QS09T5c= +github.com/jfrog/build-info-go v1.9.20 h1:tQF6EMjt/EEX8syTrgpL/c7FjhlBSjtv848jNvxpMp8= +github.com/jfrog/build-info-go v1.9.20/go.mod h1:Vxv6zmx4e1NWsx40OHaDWCCYDeYAq2yXzpJ4nsDChbE= +github.com/jfrog/gofrog v1.4.1 h1:jz4kXBdsvVCNRDVkGLRiZIQ+uTO6/DSxQ9LjfvmLfoY= +github.com/jfrog/gofrog v1.4.1/go.mod h1:wQqagqq2VpuCWRPlq/65GbH9gsRz+7Bgc1Q+PKD4Y+k= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -69,8 +71,6 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/mholt/archiver/v3 v3.5.1 h1:rDjOBX9JSF5BvoJGvjqK479aL70qh9DIpZCl+k7Clwo= -github.com/mholt/archiver/v3 v3.5.1/go.mod h1:e3dqJ7H78uzsRSEACH1joayhuSyhnonssnDhppzS1L4= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= diff --git a/tests/utils_test.go b/tests/utils_test.go index a4694afc2..22b095d1c 100644 --- a/tests/utils_test.go +++ b/tests/utils_test.go @@ -28,6 +28,7 @@ import ( "github.com/jfrog/jfrog-client-go/artifactory/services/utils/tests" + "github.com/jfrog/archiver/v3" artifactoryAuth "github.com/jfrog/jfrog-client-go/artifactory/auth" "github.com/jfrog/jfrog-client-go/artifactory/services" "github.com/jfrog/jfrog-client-go/artifactory/services/utils" @@ -41,7 +42,6 @@ import ( "github.com/jfrog/jfrog-client-go/utils/log" xrayAuth "github.com/jfrog/jfrog-client-go/xray/auth" xrayServices "github.com/jfrog/jfrog-client-go/xray/services" - "github.com/mholt/archiver/v3" "github.com/stretchr/testify/assert" ) diff --git a/utils/utils.go b/utils/utils.go index 5e68bd969..00889b654 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -27,7 +27,7 @@ import ( const ( Development = "development" Agent = "jfrog-client-go" - Version = "1.35.5" + Version = "1.35.6" ) type MinVersionProduct string From ff9d6fb1955468d4da4d0a049d0dd1f54628c8aa Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Wed, 10 Jan 2024 06:35:22 +0100 Subject: [PATCH 6/9] New Terraform & PHP Composer repositories support (#780) --- artifactory/services/localrepository.go | 12 +++++ artifactory/services/remoterepository.go | 16 +++++++ artifactory/services/virtualrepository.go | 26 +++++++++++ tests/artifactoryremoterepository_test.go | 27 ++++++++++- tests/artifactoryvirtualrepository_test.go | 54 +++++++++++++++++++++- tests/utils_test.go | 2 +- 6 files changed, 134 insertions(+), 3 deletions(-) diff --git a/artifactory/services/localrepository.go b/artifactory/services/localrepository.go index 04fb710b4..1abae2cc9 100644 --- a/artifactory/services/localrepository.go +++ b/artifactory/services/localrepository.go @@ -135,6 +135,10 @@ func (lrs *LocalRepositoryService) Swift(params SwiftLocalRepositoryParams) erro return lrs.performRequest(params, params.Key) } +func (lrs *LocalRepositoryService) Terraform(params TerraformLocalRepositoryParams) error { + return lrs.performRequest(params, params.Key) +} + func (lrs *LocalRepositoryService) Vagrant(params VagrantLocalRepositoryParams) error { return lrs.performRequest(params, params.Key) } @@ -383,6 +387,14 @@ func NewSwiftLocalRepositoryParams() SwiftLocalRepositoryParams { return SwiftLocalRepositoryParams{LocalRepositoryBaseParams: NewLocalRepositoryPackageParams("swift")} } +type TerraformLocalRepositoryParams struct { + LocalRepositoryBaseParams +} + +func NewTerraformLocalRepositoryParams() TerraformLocalRepositoryParams { + return TerraformLocalRepositoryParams{LocalRepositoryBaseParams: NewLocalRepositoryPackageParams("terraform")} +} + type VagrantLocalRepositoryParams struct { LocalRepositoryBaseParams } diff --git a/artifactory/services/remoterepository.go b/artifactory/services/remoterepository.go index e4aaa757f..cd50c7559 100644 --- a/artifactory/services/remoterepository.go +++ b/artifactory/services/remoterepository.go @@ -139,6 +139,10 @@ func (rrs *RemoteRepositoryService) Swift(params SwiftRemoteRepositoryParams) er return rrs.performRequest(params, params.Key) } +func (rrs *RemoteRepositoryService) Terraform(params TerraformRemoteRepositoryParams) error { + return rrs.performRequest(params, params.Key) +} + func (rrs *RemoteRepositoryService) Vcs(params VcsRemoteRepositoryParams) error { return rrs.performRequest(params, params.Key) } @@ -475,6 +479,18 @@ func NewSwiftRemoteRepositoryParams() SwiftRemoteRepositoryParams { return SwiftRemoteRepositoryParams{RemoteRepositoryBaseParams: NewRemoteRepositoryPackageParams("swift")} } +type TerraformRemoteRepositoryParams struct { + RemoteRepositoryBaseParams + TerraformRegistryUrl string `json:"terraformRegistryUrl,omitempty"` + TerraformProvidersUrl string `json:"terraformProvidersUrl,omitempty"` + VcsType string `json:"vcsType,omitempty"` + VcsGitProvider string `json:"vcsGitProvider,omitempty"` +} + +func NewTerraformRemoteRepositoryParams() TerraformRemoteRepositoryParams { + return TerraformRemoteRepositoryParams{RemoteRepositoryBaseParams: NewRemoteRepositoryPackageParams("terraform")} +} + type VcsRemoteRepositoryParams struct { RemoteRepositoryBaseParams VcsGitRemoteRepositoryParams diff --git a/artifactory/services/virtualrepository.go b/artifactory/services/virtualrepository.go index d4b62738d..b9c2b3aea 100644 --- a/artifactory/services/virtualrepository.go +++ b/artifactory/services/virtualrepository.go @@ -39,6 +39,10 @@ func (vrs *VirtualRepositoryService) Chef(params ChefVirtualRepositoryParams) er return vrs.performRequest(params, params.Key) } +func (vrs *VirtualRepositoryService) Composer(params ComposerVirtualRepositoryParams) error { + return vrs.performRequest(params, params.Key) +} + func (vrs *VirtualRepositoryService) Conan(params ConanVirtualRepositoryParams) error { return vrs.performRequest(params, params.Key) } @@ -123,6 +127,10 @@ func (vrs *VirtualRepositoryService) Swift(params SwiftVirtualRepositoryParams) return vrs.performRequest(params, params.Key) } +func (vrs *VirtualRepositoryService) Terraform(params TerraformVirtualRepositoryParams) error { + return vrs.performRequest(params, params.Key) +} + func (vrs *VirtualRepositoryService) Yum(params YumVirtualRepositoryParams) error { return vrs.performRequest(params, params.Key) } @@ -181,6 +189,15 @@ func NewChefVirtualRepositoryParams() ChefVirtualRepositoryParams { return ChefVirtualRepositoryParams{VirtualRepositoryBaseParams: NewVirtualRepositoryPackageParams("chef")} } +type ComposerVirtualRepositoryParams struct { + VirtualRepositoryBaseParams + CommonCacheVirtualRepositoryParams +} + +func NewComposerVirtualRepositoryParams() ComposerVirtualRepositoryParams { + return ComposerVirtualRepositoryParams{VirtualRepositoryBaseParams: NewVirtualRepositoryPackageParams("composer")} +} + type ConanVirtualRepositoryParams struct { VirtualRepositoryBaseParams CommonCacheVirtualRepositoryParams @@ -371,6 +388,15 @@ func NewSwiftVirtualRepositoryParams() SwiftVirtualRepositoryParams { return SwiftVirtualRepositoryParams{VirtualRepositoryBaseParams: NewVirtualRepositoryPackageParams("swift")} } +type TerraformVirtualRepositoryParams struct { + VirtualRepositoryBaseParams + CommonCacheVirtualRepositoryParams +} + +func NewTerraformVirtualRepositoryParams() TerraformVirtualRepositoryParams { + return TerraformVirtualRepositoryParams{VirtualRepositoryBaseParams: NewVirtualRepositoryPackageParams("terraform")} +} + type YumVirtualRepositoryParams struct { VirtualRepositoryBaseParams CommonCacheVirtualRepositoryParams diff --git a/tests/artifactoryremoterepository_test.go b/tests/artifactoryremoterepository_test.go index 01c01c978..f3f5a2efa 100644 --- a/tests/artifactoryremoterepository_test.go +++ b/tests/artifactoryremoterepository_test.go @@ -1,10 +1,11 @@ package tests import ( - "github.com/jfrog/jfrog-client-go/utils" "strings" "testing" + "github.com/jfrog/jfrog-client-go/utils" + "github.com/jfrog/jfrog-client-go/artifactory/services" "github.com/stretchr/testify/assert" ) @@ -41,6 +42,7 @@ func TestArtifactoryRemoteRepository(t *testing.T) { t.Run("remoteRpmTest", remoteRpmTest) t.Run("remoteSbtTest", remoteSbtTest) t.Run("remoteSwiftTest", remoteSwiftTest) + t.Run("remoteTerraformTest", remoteTerraformTest) t.Run("remoteVcsTest", remoteVcsTest) t.Run("remoteYumTest", remoteYumTest) t.Run("remoteGenericSmartRemoteTest", remoteGenericSmartRemoteTest) @@ -799,6 +801,29 @@ func remoteSwiftTest(t *testing.T) { } } +func remoteTerraformTest(t *testing.T) { + repoKey := GenerateRepoKeyForRepoServiceTest() + srp := services.NewTerraformRemoteRepositoryParams() + srp.Key = repoKey + srp.Url = "https://github.com" + setRemoteRepositoryBaseParams(&srp.RemoteRepositoryBaseParams, false) + + err := testsCreateRemoteRepositoryService.Terraform(srp) + if !assert.NoError(t, err, "Failed to create "+repoKey) { + return + } + defer deleteRepo(t, repoKey) + validateRepoConfig(t, repoKey, srp) + + setRemoteRepositoryBaseParams(&srp.RemoteRepositoryBaseParams, true) + + err = testsUpdateRemoteRepositoryService.Terraform(srp) + assert.NoError(t, err, "Failed to update "+repoKey) + if assert.NoError(t, err, "Failed to update "+repoKey) { + validateRepoConfig(t, repoKey, srp) + } +} + func remoteVcsTest(t *testing.T) { repoKey := GenerateRepoKeyForRepoServiceTest() vrp := services.NewVcsRemoteRepositoryParams() diff --git a/tests/artifactoryvirtualrepository_test.go b/tests/artifactoryvirtualrepository_test.go index 6b754b283..ad6a4d3bb 100644 --- a/tests/artifactoryvirtualrepository_test.go +++ b/tests/artifactoryvirtualrepository_test.go @@ -1,9 +1,10 @@ package tests import ( - "github.com/jfrog/jfrog-client-go/utils" "testing" + "github.com/jfrog/jfrog-client-go/utils" + "github.com/jfrog/jfrog-client-go/artifactory/services" "github.com/stretchr/testify/assert" ) @@ -13,6 +14,7 @@ func TestArtifactoryVirtualRepository(t *testing.T) { t.Run("virtualAlpineTest", virtualAlpineTest) t.Run("virtualBowerTest", virtualBowerTest) t.Run("virtualChefTest", virtualChefTest) + t.Run("virtualComposerTest", virtualComposerTest) t.Run("virtualConanTest", virtualConanTest) t.Run("virtualCondaTest", virtualCondaTest) t.Run("virtualCranTest", virtualCranTest) @@ -34,6 +36,7 @@ func TestArtifactoryVirtualRepository(t *testing.T) { t.Run("virtualRpmTest", virtualRpmTest) t.Run("virtualSbtTest", virtualSbtTest) t.Run("virtualSwiftTest", virtualSwiftTest) + t.Run("virtualTerraformTest", virtualTerraformTest) t.Run("virtualYumTest", virtualYumTest) t.Run("virtualCreateWithParamTest", virtualCreateWithParamTest) t.Run("getVirtualRepoDetailsTest", getVirtualRepoDetailsTest) @@ -146,6 +149,30 @@ func virtualChefTest(t *testing.T) { } } +func virtualComposerTest(t *testing.T) { + repoKey := GenerateRepoKeyForRepoServiceTest() + cvp := services.NewComposerVirtualRepositoryParams() + cvp.Key = repoKey + setVirtualRepositoryBaseParams(&cvp.VirtualRepositoryBaseParams, false) + setCacheVirtualRepositoryParams(&cvp.CommonCacheVirtualRepositoryParams, false) + + err := testsCreateVirtualRepositoryService.Composer(cvp) + if !assert.NoError(t, err, "Failed to create "+repoKey) { + return + } + defer deleteRepo(t, repoKey) + validateRepoConfig(t, repoKey, cvp) + + setVirtualRepositoryBaseParams(&cvp.VirtualRepositoryBaseParams, true) + setCacheVirtualRepositoryParams(&cvp.CommonCacheVirtualRepositoryParams, true) + + err = testsUpdateVirtualRepositoryService.Composer(cvp) + assert.NoError(t, err, "Failed to update "+repoKey) + if assert.NoError(t, err, "Failed to update "+repoKey) { + validateRepoConfig(t, repoKey, cvp) + } +} + func virtualConanTest(t *testing.T) { repoKey := GenerateRepoKeyForRepoServiceTest() cvp := services.NewConanVirtualRepositoryParams() @@ -628,6 +655,31 @@ func virtualSwiftTest(t *testing.T) { } } +func virtualTerraformTest(t *testing.T) { + repoKey := GenerateRepoKeyForRepoServiceTest() + avp := services.NewTerraformVirtualRepositoryParams() + avp.Key = repoKey + setVirtualRepositoryBaseParams(&avp.VirtualRepositoryBaseParams, false) + setCacheVirtualRepositoryParams(&avp.CommonCacheVirtualRepositoryParams, false) + + err := testsCreateVirtualRepositoryService.Terraform(avp) + if !assert.NoError(t, err, "Failed to create "+repoKey) { + return + } + defer deleteRepo(t, repoKey) + validateRepoConfig(t, repoKey, avp) + + setVirtualRepositoryBaseParams(&avp.VirtualRepositoryBaseParams, true) + setCacheVirtualRepositoryParams(&avp.CommonCacheVirtualRepositoryParams, true) + + err = testsUpdateVirtualRepositoryService.Terraform(avp) + assert.NoError(t, err, "Failed to update "+repoKey) + validateRepoConfig(t, repoKey, avp) + if assert.NoError(t, err, "Failed to update "+repoKey) { + validateRepoConfig(t, repoKey, avp) + } +} + func virtualYumTest(t *testing.T) { repoKey := GenerateRepoKeyForRepoServiceTest() yvp := services.NewYumVirtualRepositoryParams() diff --git a/tests/utils_test.go b/tests/utils_test.go index 22b095d1c..6f38ea735 100644 --- a/tests/utils_test.go +++ b/tests/utils_test.go @@ -904,7 +904,7 @@ func createRepoConfigValidationFunc(repoKey string, expectedConfig interface{}) func validateRepoConfig(t *testing.T, repoKey string, params interface{}) { retryExecutor := &clientutils.RetryExecutor{ - MaxRetries: 12, + MaxRetries: 30, // RetriesIntervalMilliSecs in milliseconds RetriesIntervalMilliSecs: 10 * 1000, ErrorMessage: "Waiting for Artifactory to evaluate repository operation...", From cd958f60aef7e2673239b90cfc8e9444efb283df Mon Sep 17 00:00:00 2001 From: Or Zinger <94623525+orz25@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:15:04 +0200 Subject: [PATCH 7/9] Add JF_MSI env var (#883) --- xray/services/scan.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xray/services/scan.go b/xray/services/scan.go index 61908f7e5..a53e6b361 100644 --- a/xray/services/scan.go +++ b/xray/services/scan.go @@ -6,6 +6,7 @@ import ( "github.com/jfrog/jfrog-client-go/utils/log" xrayUtils "github.com/jfrog/jfrog-client-go/xray/services/utils" "net/http" + "os" "strings" "time" @@ -45,8 +46,6 @@ const ( XscGraphAPI = "api/v1/sca/scan/graph" - multiScanIdParam = "multi_scan_id=" - scanTechQueryParam = "tech=" XscVersionAPI = "api/v1/system/version" @@ -84,7 +83,6 @@ func createScanGraphQueryParams(scanParams XrayGraphScanParams) string { } if scanParams.XscVersion != "" { - params = append(params, multiScanIdParam+scanParams.MultiScanId) gitInfoContext := scanParams.XscGitInfoContext if gitInfoContext != nil { if len(gitInfoContext.Technologies) > 0 { @@ -110,7 +108,9 @@ func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error) if err != nil { return "", fmt.Errorf("failed sending Git Info to XSC service, error: %s ", err.Error()) } - scanParams.MultiScanId = multiScanId + if err = os.Setenv("JF_MSI", multiScanId); err != nil { + log.Debug(errorutils.CheckErrorf("failed setting MSI as environment variable. Cause: %s", err.Error())) + } } httpClientsDetails := ss.XrayDetails.CreateHttpClientDetails() @@ -280,7 +280,6 @@ type XrayGraphScanParams struct { IncludeLicenses bool XscGitInfoContext *XscGitInfoContext XscVersion string - MultiScanId string } type RequestScanResponse struct { From 906763a6c45c2d85f18bdb4c38db067179304c00 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Mon, 22 Jan 2024 13:37:10 +0200 Subject: [PATCH 8/9] Add trailing slash if needed on SetUrl method (#887) --- .github/workflows/analysis.yml | 7 +- .github/workflows/tests.yml | 20 ++--- access/services/project.go | 5 +- artifactory/services/download.go | 4 +- artifactory/services/fspatterns/utils.go | 2 +- artifactory/services/go/publish.go | 2 +- artifactory/services/upload.go | 11 ++- artifactory/services/utils/aqlquerybuilder.go | 2 +- .../services/utils/artifactoryutils.go | 4 +- artifactory/services/utils/searchutil.go | 4 +- artifactory/usage/reportusage.go | 2 +- auth/authutils.go | 4 +- auth/servicedetails.go | 2 +- distribution/services/deleteremote.go | 4 +- go.mod | 34 ++++----- go.sum | 74 +++++++++---------- http/httpclient/client.go | 2 +- http/httpclient/clientBuilder.go | 2 +- tests/artifactoryremoterepository_test.go | 6 +- tests/artifactoryupload_test.go | 8 +- tests/artifactoryvirtualrepository_test.go | 1 - utils/io/content/contentreader.go | 2 +- utils/io/fileutils/temp.go | 4 +- utils/usage/reportusage.go | 2 +- xray/services/summary.go | 4 +- xray/services/utils/watchbody.go | 4 +- xray/usage/reportusage.go | 4 +- 27 files changed, 113 insertions(+), 107 deletions(-) diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index a488207c3..398fe2c80 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v3 @@ -28,15 +28,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - # Temporarily set version 2.18.0 to workaround https://github.com/securego/gosec/issues/1046 - name: Run Gosec Security Scanner - uses: securego/gosec@v2.18.0 + uses: securego/gosec@master with: args: -exclude G204,G301,G302,G304,G306 -tests -exclude-dir \.*test\.* ./... diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e5afb1a4f..d2f95187e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: labels: "safe to test" - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} @@ -35,7 +35,7 @@ jobs: go-version: 1.20.x - name: Go Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -60,12 +60,12 @@ jobs: go-version: 1.20.x - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Go Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -94,7 +94,7 @@ jobs: runs-on: ${{ matrix.os }}-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} @@ -104,7 +104,7 @@ jobs: go-version: 1.20.x - name: Go Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -119,7 +119,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} @@ -129,7 +129,7 @@ jobs: go-version: 1.20.x - name: Go Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -149,12 +149,12 @@ jobs: go-version: 1.20.x - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - name: Go Cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/access/services/project.go b/access/services/project.go index f50190f07..0e2765c3c 100644 --- a/access/services/project.go +++ b/access/services/project.go @@ -89,7 +89,10 @@ func (ps *ProjectService) GetAll() ([]Project, error) { } var projects []Project err = json.Unmarshal(body, &projects) - return projects, errorutils.CheckError(err) + if err != nil { + return nil, errorutils.CheckErrorf("failed extracting projects list from payload: " + err.Error()) + } + return projects, nil } func (ps *ProjectService) Create(params ProjectParams) error { diff --git a/artifactory/services/download.go b/artifactory/services/download.go index eea26c3cb..8445e76ec 100644 --- a/artifactory/services/download.go +++ b/artifactory/services/download.go @@ -438,7 +438,7 @@ func removeIfSymlink(localSymlinkPath string) error { func createLocalSymlink(localPath, localFileName, symlinkArtifact string, symlinkChecksum bool, symlinkContentChecksum string, logMsgPrefix string) (err error) { if symlinkChecksum && symlinkContentChecksum != "" { if !fileutils.IsPathExists(symlinkArtifact, false) { - return errorutils.CheckErrorf("Symlink validation failed, target doesn't exist: " + symlinkArtifact) + return errorutils.CheckErrorf("symlink validation failed, target doesn't exist: " + symlinkArtifact) } file, err := os.Open(symlinkArtifact) if err = errorutils.CheckError(err); err != nil { @@ -453,7 +453,7 @@ func createLocalSymlink(localPath, localFileName, symlinkArtifact string, symlin } sha1 := checksumInfo[biutils.SHA1] if sha1 != symlinkContentChecksum { - return errorutils.CheckErrorf("Symlink validation failed for target: " + symlinkArtifact) + return errorutils.CheckErrorf("symlink validation failed for target: " + symlinkArtifact) } } localSymlinkPath := filepath.Join(localPath, localFileName) diff --git a/artifactory/services/fspatterns/utils.go b/artifactory/services/fspatterns/utils.go index d87698b86..f6bbd6773 100644 --- a/artifactory/services/fspatterns/utils.go +++ b/artifactory/services/fspatterns/utils.go @@ -167,7 +167,7 @@ func GetRootPath(pattern, target, archiveTarget string, patternType utils.Patter placeholderParentheses := getPlaceholderParentheses(pattern, target, archiveTarget) rootPath := utils.GetRootPath(pattern, patternType, placeholderParentheses) if !fileutils.IsPathExists(rootPath, preserveSymLink) { - return "", errorutils.CheckErrorf("Path does not exist: " + rootPath) + return "", errorutils.CheckErrorf("path does not exist: " + rootPath) } return rootPath, nil diff --git a/artifactory/services/go/publish.go b/artifactory/services/go/publish.go index 63426812d..40d5abb7a 100644 --- a/artifactory/services/go/publish.go +++ b/artifactory/services/go/publish.go @@ -33,7 +33,7 @@ func (gpc *GoPublishCommand) verifyCompatibleVersion(artifactoryVersion string) ver := version.NewVersion(artifactoryVersion) gpc.artifactoryVersion = artifactoryVersion if !ver.AtLeast(propertiesApi) { - return errorutils.CheckErrorf("Unsupported version of Artifactory: %s\nSupports Artifactory version %s and above", artifactoryVersion, propertiesApi) + return errorutils.CheckErrorf("unsupported version of Artifactory: %s\nSupports Artifactory version %s and above", artifactoryVersion, propertiesApi) } return nil } diff --git a/artifactory/services/upload.go b/artifactory/services/upload.go index 10efdb304..d2bb290cd 100644 --- a/artifactory/services/upload.go +++ b/artifactory/services/upload.go @@ -226,6 +226,12 @@ func getSaveTaskInContentWriterFunc(writersMap map[string]*ArchiveUploadData, up } func CollectFilesForUpload(uploadParams UploadParams, progressMgr ioutils.ProgressMgr, vcsCache *clientutils.VcsCache, dataHandlerFunc UploadDataHandlerFunc) error { + // Target Specifies the target path in Artifactory in the following format: /, so it cannot start with a slash. + // Remove leading slash if exists + uploadParams.SetTarget(strings.TrimPrefix(uploadParams.GetTarget(), "/")) + + // Target Specifies the target path in Artifactory in the following format: /, so it cannot start with a slash. + // If the received target path has no slashes then we assume that it's '/' and we add the missing slash. if !strings.Contains(uploadParams.GetTarget(), "/") { uploadParams.SetTarget(uploadParams.GetTarget() + "/") } @@ -265,15 +271,14 @@ func CollectFilesForUpload(uploadParams UploadParams, progressMgr ioutils.Progre uploadData := UploadData{Artifact: artifact, TargetProps: props, BuildProps: buildProps} incGeneralProgressTotal(progressMgr, uploadParams) dataHandlerFunc(uploadData) - return err + return nil } if uploadParams.Ant { convertAntPatternToRegexp(&uploadParams) } else { convertPatternToRegexp(&uploadParams) } - err = scanFilesByPattern(uploadParams, rootPath, progressMgr, vcsCache, dataHandlerFunc) - return err + return scanFilesByPattern(uploadParams, rootPath, progressMgr, vcsCache, dataHandlerFunc) } // convertAntPatternToRegexp converts a given Ant pattern to a regular expression. diff --git a/artifactory/services/utils/aqlquerybuilder.go b/artifactory/services/utils/aqlquerybuilder.go index 304715e64..16e180b0c 100644 --- a/artifactory/services/utils/aqlquerybuilder.go +++ b/artifactory/services/utils/aqlquerybuilder.go @@ -34,7 +34,7 @@ func CreateAqlBodyForSpecWithPattern(params *CommonParams) (string, error) { return "", err } if params.Transitive && !singleRepo { - return "", errorutils.CheckErrorf("When searching or downloading with the transitive setting, the pattern must include a single repository only, meaning wildcards are allowed only after the first slash.") + return "", errorutils.CheckErrorf("when searching or downloading with the transitive setting, the pattern must include a single repository only, meaning wildcards are allowed only after the first slash.") } includeRoot := strings.Count(searchPattern, "/") < 2 triplesSize := len(repoPathFileTriples) diff --git a/artifactory/services/utils/artifactoryutils.go b/artifactory/services/utils/artifactoryutils.go index dda02f4ff..3006de7b8 100644 --- a/artifactory/services/utils/artifactoryutils.go +++ b/artifactory/services/utils/artifactoryutils.go @@ -191,7 +191,7 @@ func ParseNameAndVersion(identifier string, useLatestPolicy bool) (string, strin log.Debug("No '" + Delimiter + "' is found in the build, build number is set to " + LatestBuildNumberKey) return identifier, LatestBuildNumberKey, nil } else { - return "", "", errorutils.CheckErrorf("No '" + Delimiter + "' is found in '" + identifier + "'") + return "", "", errorutils.CheckErrorf("no '" + Delimiter + "' is found in '" + identifier + "'") } } name, version := "", "" @@ -216,7 +216,7 @@ func ParseNameAndVersion(identifier string, useLatestPolicy bool) (string, strin name = identifier version = LatestBuildNumberKey } else { - return "", "", errorutils.CheckErrorf("No delimiter char (" + Delimiter + ") without escaping char was found in '" + identifier + "'") + return "", "", errorutils.CheckErrorf("no delimiter char (" + Delimiter + ") without escaping char was found in '" + identifier + "'") } } // Remove escape chars. diff --git a/artifactory/services/utils/searchutil.go b/artifactory/services/utils/searchutil.go index d51a14804..f4909f157 100644 --- a/artifactory/services/utils/searchutil.go +++ b/artifactory/services/utils/searchutil.go @@ -450,7 +450,7 @@ func FilterBottomChainResults(readerRecord SearchBasedContentItem, reader *conte for newRecord := (reflect.New(recordType)).Interface(); reader.NextRecord(newRecord) == nil; newRecord = (reflect.New(recordType)).Interface() { resultItem, ok := newRecord.(SearchBasedContentItem) if !ok { - return nil, errorutils.CheckErrorf("Reader record is not search-based.") + return nil, errorutils.CheckErrorf("reader record is not search-based.") } if resultItem.GetName() == "." { @@ -491,7 +491,7 @@ func FilterTopChainResults(readerRecord SearchBasedContentItem, reader *content. for newRecord := (reflect.New(recordType)).Interface(); reader.NextRecord(newRecord) == nil; newRecord = (reflect.New(recordType)).Interface() { resultItem, ok := newRecord.(SearchBasedContentItem) if !ok { - return nil, errorutils.CheckErrorf("Reader record is not search-based.") + return nil, errorutils.CheckErrorf("reader record is not search-based.") } if resultItem.GetName() == "." { diff --git a/artifactory/usage/reportusage.go b/artifactory/usage/reportusage.go index 6b098526f..2d4c14074 100644 --- a/artifactory/usage/reportusage.go +++ b/artifactory/usage/reportusage.go @@ -26,7 +26,7 @@ func (rua *ReportUsageAttribute) isEmpty() bool { func validateAndGetUsageServerInfo(serviceManager artifactory.ArtifactoryServicesManager) (url string, clientDetails httputils.HttpClientDetails, err error) { config := serviceManager.GetConfig() if config == nil { - err = errorutils.CheckErrorf("Expected full config, but no configuration exists.") + err = errorutils.CheckErrorf("expected full config, but no configuration exists.") return } rtDetails := config.GetServiceDetails() diff --git a/auth/authutils.go b/auth/authutils.go index 885d10708..ffebe88e3 100644 --- a/auth/authutils.go +++ b/auth/authutils.go @@ -45,7 +45,7 @@ func extractPayloadFromAccessToken(token string) (TokenPayload, error) { var tokenPayload TokenPayload err = json.Unmarshal(payload, &tokenPayload) if err != nil { - return TokenPayload{}, errorutils.CheckErrorf("failed extracting payload from the provided access-token. " + err.Error()) + return TokenPayload{}, errorutils.CheckErrorf("failed extracting payload from the provided access-token: " + err.Error()) } err = setAudienceManually(&tokenPayload, payload) return tokenPayload, err @@ -56,7 +56,7 @@ func setAudienceManually(tokenPayload *TokenPayload, payload []byte) error { allValuesMap := make(map[string]interface{}) err := json.Unmarshal(payload, &allValuesMap) if err != nil { - return errorutils.CheckErrorf("Failed extracting audience from payload. " + err.Error()) + return errorutils.CheckErrorf("failed extracting audience from payload: " + err.Error()) } aud, exists := allValuesMap["aud"] if !exists { diff --git a/auth/servicedetails.go b/auth/servicedetails.go index 63736842a..28020e6f4 100644 --- a/auth/servicedetails.go +++ b/auth/servicedetails.go @@ -130,7 +130,7 @@ func (ccf *CommonConfigFields) GetClient() *jfroghttpclient.JfrogHttpClient { } func (ccf *CommonConfigFields) SetUrl(url string) { - ccf.Url = url + ccf.Url = utils.AddTrailingSlashIfNeeded(url) } func (ccf *CommonConfigFields) SetUser(user string) { diff --git a/distribution/services/deleteremote.go b/distribution/services/deleteremote.go index c73a5fcc1..90007c345 100644 --- a/distribution/services/deleteremote.go +++ b/distribution/services/deleteremote.go @@ -126,11 +126,11 @@ func (dr *DeleteReleaseBundleService) waitForDeletion(name, version string) erro return nil } if resp.StatusCode != http.StatusOK { - return errorutils.CheckErrorf("Error while waiting to deletion: status code " + fmt.Sprint(resp.StatusCode) + ".") + return errorutils.CheckErrorf("error while waiting to deletion: status code " + fmt.Sprint(resp.StatusCode) + ".") } time.Sleep(time.Second * DefaultDistributeSyncSleepIntervalSeconds) } - return errorutils.CheckErrorf("Timeout for sync deletion. ") + return errorutils.CheckErrorf("timeout for sync deletion. ") } type DeleteRemoteDistributionBody struct { diff --git a/go.mod b/go.mod index dbf6f61fd..b742fab8b 100644 --- a/go.mod +++ b/go.mod @@ -3,56 +3,56 @@ module github.com/jfrog/jfrog-client-go go 1.20 require ( - github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c + github.com/ProtonMail/go-crypto v1.0.0 github.com/buger/jsonparser v1.1.1 github.com/forPelevin/gomoji v1.1.8 github.com/go-git/go-git/v5 v5.11.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/gookit/color v1.5.4 - github.com/jfrog/archiver/v3 v3.5.3 + github.com/jfrog/archiver/v3 v3.6.0 github.com/jfrog/build-info-go v1.9.20 - github.com/jfrog/gofrog v1.4.1 + github.com/jfrog/gofrog v1.5.1 github.com/stretchr/testify v1.8.4 github.com/xanzy/ssh-agent v0.3.3 - golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 - golang.org/x/term v0.15.0 + golang.org/x/crypto v0.18.0 + golang.org/x/exp v0.0.0-20240119083558-1b970713d09a + golang.org/x/term v0.16.0 ) require ( dario.cat/mergo v1.0.0 // indirect github.com/CycloneDX/cyclonedx-go v0.7.2 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/andybalholm/brotli v1.0.1 // indirect + github.com/andybalholm/brotli v1.1.0 // indirect github.com/cloudflare/circl v1.3.3 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect + github.com/dsnet/compress v0.0.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/snappy v0.0.2 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/compress v1.11.4 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/klauspost/cpuid/v2 v2.2.3 // indirect - github.com/klauspost/pgzip v1.2.5 // indirect + github.com/klauspost/pgzip v1.2.6 // indirect github.com/minio/sha256-simd v1.0.1 // indirect - github.com/nwaples/rardecode v1.1.0 // indirect - github.com/pierrec/lz4/v4 v4.1.2 // indirect + github.com/nwaples/rardecode v1.1.3 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.3 // indirect github.com/sergi/go-diff v1.1.0 // indirect github.com/skeema/knownhosts v1.2.1 // indirect - github.com/ulikunitz/xz v0.5.9 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/tools v0.16.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/tools v0.17.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 3b346ba89..cd2df6d8b 100644 --- a/go.sum +++ b/go.sum @@ -5,10 +5,10 @@ github.com/CycloneDX/cyclonedx-go v0.7.2/go.mod h1:K2bA+324+Og0X84fA8HhN2X066K7B github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c h1:kMFnB0vCcX7IL/m9Y5LO+KQYv+t1CQOiFe6+SV2J7bE= -github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/andybalholm/brotli v1.0.1 h1:KqhlKozYbRtJvsPrrEeXcO+N2l6NYT5A2QAFmSULpEc= -github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= +github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oMMlVBbn9M= @@ -22,8 +22,8 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 h1:iFaUwBSo5Svw6L7HYpRu/0lE3e0BaElwnNO1qkNQxBY= -github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5/go.mod h1:qssHWj60/X5sZFNxpG4HBPDHVqxNm4DfnCKgrbZOT+s= +github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= +github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -42,30 +42,29 @@ github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOW github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= -github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jfrog/archiver/v3 v3.5.3 h1:Udz6+z/YIhTFmcEp1TeW2DEwNyo7JSAnrGUsrbL2FZI= -github.com/jfrog/archiver/v3 v3.5.3/go.mod h1:/MbmBhPzkliu9PtweAg9lCYHGcKdapwMMZS/QS09T5c= +github.com/jfrog/archiver/v3 v3.6.0 h1:OVZ50vudkIQmKMgA8mmFF9S0gA47lcag22N13iV3F1w= +github.com/jfrog/archiver/v3 v3.6.0/go.mod h1:fCAof46C3rAXgZurS8kNRNdSVMKBbZs+bNNhPYxLldI= github.com/jfrog/build-info-go v1.9.20 h1:tQF6EMjt/EEX8syTrgpL/c7FjhlBSjtv848jNvxpMp8= github.com/jfrog/build-info-go v1.9.20/go.mod h1:Vxv6zmx4e1NWsx40OHaDWCCYDeYAq2yXzpJ4nsDChbE= -github.com/jfrog/gofrog v1.4.1 h1:jz4kXBdsvVCNRDVkGLRiZIQ+uTO6/DSxQ9LjfvmLfoY= -github.com/jfrog/gofrog v1.4.1/go.mod h1:wQqagqq2VpuCWRPlq/65GbH9gsRz+7Bgc1Q+PKD4Y+k= +github.com/jfrog/gofrog v1.5.1 h1:2AXL8hHu1jJFMIoCqTp2OyRUfEqEp4nC7J8fwn6KtwE= +github.com/jfrog/gofrog v1.5.1/go.mod h1:SZ1EPJUruxrVGndOzHd+LTiwWYKMlHqhKD+eu+v5Hqg= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.4 h1:kz40R/YWls3iqT9zX9AHN3WoVsrAWVyui5sxuLqiXqU= -github.com/klauspost/compress v1.11.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= +github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -73,11 +72,11 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ= -github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= +github.com/nwaples/rardecode v1.1.3 h1:cWCaZwfM5H7nAD6PyEdcVnczzV8i/JtotnyW/dD9lEc= +github.com/nwaples/rardecode v1.1.3/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/pierrec/lz4/v4 v4.1.2 h1:qvY3YFXRQE/XB8MlLzJH7mSzBs74eA2gg52YTk6jUPM= -github.com/pierrec/lz4/v4 v4.1.2/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -98,9 +97,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/terminalstatic/go-xsd-validate v0.1.5 h1:RqpJnf6HGE2CB/lZB1A8BYguk8uRtcvYAPLCF15qguo= -github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ulikunitz/xz v0.5.9 h1:RsKRIA2MO8x56wkkcd3LbtcE/uMszhb6DpRf+3uwa3I= -github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= +github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= @@ -116,10 +115,10 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA= +golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= @@ -131,12 +130,12 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -151,15 +150,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -172,10 +171,9 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/http/httpclient/client.go b/http/httpclient/client.go index 999a9ee95..7c70a4532 100644 --- a/http/httpclient/client.go +++ b/http/httpclient/client.go @@ -292,7 +292,7 @@ func (jc *HttpClient) doUploadFile(localPath, url string, httpClientsDetails htt func (jc *HttpClient) UploadFileFromReader(reader io.Reader, url string, httpClientsDetails httputils.HttpClientDetails, size int64) (resp *http.Response, body []byte, err error) { - req, err := jc.newRequest("PUT", url, reader) + req, err := jc.newRequest(http.MethodPut, url, reader) if err != nil { return } diff --git a/http/httpclient/clientBuilder.go b/http/httpclient/clientBuilder.go index 73a579553..a53b9a34b 100644 --- a/http/httpclient/clientBuilder.go +++ b/http/httpclient/clientBuilder.go @@ -109,7 +109,7 @@ func (builder *httpClientBuilder) Build() (*HttpClient, error) { } else { transport, err = cert.GetTransportWithLoadedCert(builder.certificatesDirPath, builder.insecureTls, builder.createDefaultHttpTransport()) if err != nil { - return nil, errorutils.CheckErrorf("Failed creating HttpClient: " + err.Error()) + return nil, errorutils.CheckErrorf("failed creating HttpClient: " + err.Error()) } } err = builder.AddClientCertToTransport(transport) diff --git a/tests/artifactoryremoterepository_test.go b/tests/artifactoryremoterepository_test.go index f3f5a2efa..f9d10bea0 100644 --- a/tests/artifactoryremoterepository_test.go +++ b/tests/artifactoryremoterepository_test.go @@ -56,6 +56,7 @@ func setRemoteRepositoryBaseParams(params *services.RemoteRepositoryBaseParams, setRepositoryBaseParams(¶ms.RepositoryBaseParams, isUpdate) setAdditionalRepositoryBaseParams(¶ms.AdditionalRepositoryBaseParams, isUpdate) if !isUpdate { + // Original repo params assigned on creation params.HardFail = utils.Pointer(true) params.Offline = utils.Pointer(true) params.StoreArtifactsLocally = utils.Pointer(true) @@ -74,6 +75,7 @@ func setRemoteRepositoryBaseParams(params *services.RemoteRepositoryBaseParams, params.BypassHeadRequests = utils.Pointer(true) params.ClientTlsCertificate = "" } else { + // Repo params assigned on update params.HardFail = utils.Pointer(false) params.Offline = utils.Pointer(false) params.StoreArtifactsLocally = utils.Pointer(false) @@ -816,9 +818,9 @@ func remoteTerraformTest(t *testing.T) { validateRepoConfig(t, repoKey, srp) setRemoteRepositoryBaseParams(&srp.RemoteRepositoryBaseParams, true) - + // Due to a bug on Artifactory side that prevents the update of "bypassHeadRequests" field to false on terraform we leave it unchanged. + srp.BypassHeadRequests = utils.Pointer(true) err = testsUpdateRemoteRepositoryService.Terraform(srp) - assert.NoError(t, err, "Failed to update "+repoKey) if assert.NoError(t, err, "Failed to update "+repoKey) { validateRepoConfig(t, repoKey, srp) } diff --git a/tests/artifactoryupload_test.go b/tests/artifactoryupload_test.go index c8df9435b..7f6dcf071 100644 --- a/tests/artifactoryupload_test.go +++ b/tests/artifactoryupload_test.go @@ -416,7 +416,7 @@ func TestUploadFilesWithFailure(t *testing.T) { dir, err := os.Getwd() assert.NoError(t, err) params.Pattern = filepath.Join(dir, "testdata", "upload", "folder*") - params.Target = "/generic" + params.Target = "generic" params.Flat = true params.Recursive = true service := services.NewUploadService(client) @@ -428,8 +428,8 @@ func TestUploadFilesWithFailure(t *testing.T) { // Check for expected results assert.Error(t, err) - assert.Equal(t, summary.TotalSucceeded, 1) - assert.Equal(t, summary.TotalFailed, 1) + assert.Equal(t, 1, summary.TotalSucceeded) + assert.Equal(t, 1, summary.TotalFailed) } // Creates handlers for TestUploadFilesWithFailure mock server. @@ -438,7 +438,7 @@ func createUploadFilesWithFailureHandlers() *testutils.HttpServerHandlers { handlers := testutils.HttpServerHandlers{} counter := 0 //nolint:unparam - handlers["/generic"] = func(w http.ResponseWriter, r *http.Request) { + handlers["/generic/"] = func(w http.ResponseWriter, r *http.Request) { if counter == 0 { fmt.Fprintln(w, "{\"checksums\":{\"sha256\":\"123\"}}") w.WriteHeader(http.StatusOK) diff --git a/tests/artifactoryvirtualrepository_test.go b/tests/artifactoryvirtualrepository_test.go index ad6a4d3bb..5ee5aa90e 100644 --- a/tests/artifactoryvirtualrepository_test.go +++ b/tests/artifactoryvirtualrepository_test.go @@ -167,7 +167,6 @@ func virtualComposerTest(t *testing.T) { setCacheVirtualRepositoryParams(&cvp.CommonCacheVirtualRepositoryParams, true) err = testsUpdateVirtualRepositoryService.Composer(cvp) - assert.NoError(t, err, "Failed to update "+repoKey) if assert.NoError(t, err, "Failed to update "+repoKey) { validateRepoConfig(t, repoKey, cvp) } diff --git a/utils/io/content/contentreader.go b/utils/io/content/contentreader.go index fd726d5ff..465f6e271 100644 --- a/utils/io/content/contentreader.go +++ b/utils/io/content/contentreader.go @@ -404,7 +404,7 @@ func MergeSortedReaders(readerRecord SortableContentItem, sortedReaders []*Conte // Expect to receive 'SortableContentItem'. contentItem, ok := (temp).(SortableContentItem) if !ok { - return nil, errorutils.CheckErrorf("Attempting to sort a content-reader with unsortable items.") + return nil, errorutils.CheckErrorf("attempting to sort a content-reader with unsortable items.") } currentContentItem[i] = &contentItem } diff --git a/utils/io/fileutils/temp.go b/utils/io/fileutils/temp.go index 75c8f6f38..928a9e7ae 100644 --- a/utils/io/fileutils/temp.go +++ b/utils/io/fileutils/temp.go @@ -28,7 +28,7 @@ func init() { // Set tempDirPath to the created directory path. func CreateTempDir() (string, error) { if tempDirBase == "" { - return "", errorutils.CheckErrorf("Temp dir cannot be created in an empty base dir.") + return "", errorutils.CheckErrorf("temp dir cannot be created in an empty base dir.") } timestamp := strconv.FormatInt(time.Now().Unix(), 10) dirPath, err := os.MkdirTemp(tempDirBase, tempPrefix+"-"+timestamp+"-") @@ -67,7 +67,7 @@ func RemoveTempDir(dirPath string) error { // Create a new temp file named "tempPrefix+timeStamp". func CreateTempFile() (*os.File, error) { if tempDirBase == "" { - return nil, errorutils.CheckErrorf("Temp File cannot be created in an empty base dir.") + return nil, errorutils.CheckErrorf("temp File cannot be created in an empty base dir.") } timestamp := strconv.FormatInt(time.Now().Unix(), 10) fd, err := os.CreateTemp(tempDirBase, tempPrefix+"-"+timestamp+"-") diff --git a/utils/usage/reportusage.go b/utils/usage/reportusage.go index 4b228f007..3e705a12a 100644 --- a/utils/usage/reportusage.go +++ b/utils/usage/reportusage.go @@ -26,7 +26,7 @@ type ReportEcosystemUsageData struct { func SendEcosystemUsageReports(reports ...ReportEcosystemUsageData) error { if len(reports) == 0 { - return errorutils.CheckErrorf("Nothing to send.") + return errorutils.CheckErrorf("nothing to send.") } bodyContent, err := json.Marshal(reports) if err != nil { diff --git a/xray/services/summary.go b/xray/services/summary.go index b97835f49..5659d289e 100644 --- a/xray/services/summary.go +++ b/xray/services/summary.go @@ -49,7 +49,7 @@ func (ss *SummaryService) GetBuildSummary(params XrayBuildParams) (*SummaryRespo return nil, errorutils.CheckError(err) } if summaryResponse.Errors != nil && len(summaryResponse.Errors) > 0 { - return nil, errorutils.CheckErrorf("Getting build-summary for build: %s failed with error: %s", summaryResponse.Errors[0].Identifier, summaryResponse.Errors[0].Error) + return nil, errorutils.CheckErrorf("getting build-summary for build: %s failed with error: %s", summaryResponse.Errors[0].Identifier, summaryResponse.Errors[0].Error) } return &summaryResponse, nil } @@ -77,7 +77,7 @@ func (ss *SummaryService) GetArtifactSummary(params ArtifactSummaryParams) (*Art return nil, errorutils.CheckError(err) } if response.Errors != nil && len(response.Errors) > 0 { - return nil, errorutils.CheckErrorf("Getting artifact-summary for artifact: %s failed with error: %s", response.Errors[0].Identifier, response.Errors[0].Error) + return nil, errorutils.CheckErrorf("getting artifact-summary for artifact: %s failed with error: %s", response.Errors[0].Identifier, response.Errors[0].Error) } return &response, nil } diff --git a/xray/services/utils/watchbody.go b/xray/services/utils/watchbody.go index 3db72690f..aee708ff3 100644 --- a/xray/services/utils/watchbody.go +++ b/xray/services/utils/watchbody.go @@ -222,7 +222,7 @@ func configureRepositories(payloadBody *WatchBody, params WatchParams) error { case "": // Empty is fine default: - return errorutils.CheckErrorf("Invalid Repository Type. Must be " + string(WatchRepositoriesAll) + " or " + string(WatchRepositoriesByName)) + return errorutils.CheckErrorf("invalid Repository Type. Must be " + string(WatchRepositoriesAll) + " or " + string(WatchRepositoriesByName)) } return nil @@ -324,7 +324,7 @@ func configureBuilds(payloadBody *WatchBody, params WatchParams) error { case "": // Empty is fine default: - return errorutils.CheckErrorf("Invalid Build Type. Must be " + string(WatchBuildAll) + " or " + string(WatchBuildByName)) + return errorutils.CheckErrorf("invalid Build Type. Must be " + string(WatchBuildAll) + " or " + string(WatchBuildByName)) } return nil diff --git a/xray/usage/reportusage.go b/xray/usage/reportusage.go index 8fa99dc34..3ca7b3801 100644 --- a/xray/usage/reportusage.go +++ b/xray/usage/reportusage.go @@ -34,11 +34,11 @@ type ReportXrayEventData struct { func SendXrayUsageEvents(serviceManager xray.XrayServicesManager, events ...ReportXrayEventData) error { if len(events) == 0 { - return errorutils.CheckErrorf("Nothing to send.") + return errorutils.CheckErrorf("nothing to send.") } config := serviceManager.Config() if config == nil { - return errorutils.CheckErrorf("Expected full config, but no configuration exists.") + return errorutils.CheckErrorf("expected full config, but no configuration exists.") } xrDetails := config.GetServiceDetails() if xrDetails == nil { From 74f725715bbe06886b29fa8b9d41d324e784fab7 Mon Sep 17 00:00:00 2001 From: Assaf Attias <49212512+attiasas@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:36:49 +0200 Subject: [PATCH 9/9] Fix after Changes to MSI (#888) --- xray/services/scan.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xray/services/scan.go b/xray/services/scan.go index a53e6b361..002728554 100644 --- a/xray/services/scan.go +++ b/xray/services/scan.go @@ -109,7 +109,8 @@ func (ss *ScanService) ScanGraph(scanParams XrayGraphScanParams) (string, error) return "", fmt.Errorf("failed sending Git Info to XSC service, error: %s ", err.Error()) } if err = os.Setenv("JF_MSI", multiScanId); err != nil { - log.Debug(errorutils.CheckErrorf("failed setting MSI as environment variable. Cause: %s", err.Error())) + // Not a fatal error, if not set the scan will not be shown at the XSC UI, should not fail the scan. + log.Debug(fmt.Sprintf("failed setting MSI as environment variable. Cause: %s", err.Error())) } }