diff --git a/artifactory/services/download.go b/artifactory/services/download.go index a82375dd6..1fcda4817 100644 --- a/artifactory/services/download.go +++ b/artifactory/services/download.go @@ -3,10 +3,6 @@ package services import ( "errors" "fmt" - "github.com/jfrog/build-info-go/entities" - "github.com/jfrog/gofrog/crypto" - ioutils "github.com/jfrog/gofrog/io" - "github.com/jfrog/gofrog/version" "net/http" "os" "path" @@ -14,6 +10,11 @@ import ( "sort" "strings" + "github.com/jfrog/build-info-go/entities" + "github.com/jfrog/gofrog/crypto" + ioutils "github.com/jfrog/gofrog/io" + "github.com/jfrog/gofrog/version" + "github.com/jfrog/jfrog-client-go/http/httpclient" "github.com/jfrog/gofrog/parallel" diff --git a/artifactory/services/utils/searchutil.go b/artifactory/services/utils/searchutil.go index f2df3c60e..2e4e232b8 100644 --- a/artifactory/services/utils/searchutil.go +++ b/artifactory/services/utils/searchutil.go @@ -242,10 +242,9 @@ func FilterResultsByBuild(specFile *CommonParams, flags CommonConf, requiredArti // AND // 2. Properties weren't fetched during 'build' filtering // Otherwise, nil will be returned -func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (*content.ContentReader, error) { +func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps RequiredArtifactProps, reader *content.ContentReader) (r *content.ContentReader, err error) { if !includePropertiesInAqlForSpec(specFile) && specFile.Build == "" && requiredArtifactProps != NONE { var readerWithProps *content.ContentReader - var err error switch requiredArtifactProps { case ALL: readerWithProps, err = searchProps(specFile.Aql.ItemsFind, "*", []string{"*"}, flags) @@ -253,14 +252,15 @@ func fetchProps(specFile *CommonParams, flags CommonConf, requiredArtifactProps readerWithProps, err = searchProps(specFile.Aql.ItemsFind, "symlink.dest", []string{"*"}, flags) } if err != nil { - return nil, err + return } defer func() { err = errors.Join(err, errorutils.CheckError(reader.Close())) + err = errors.Join(err, errorutils.CheckError(readerWithProps.Close())) }() - return loadMissingProperties(reader, readerWithProps) + r, err = loadMissingProperties(reader, readerWithProps) } - return nil, nil + return } func aqlSearch(aqlQuery string, flags CommonConf) (*content.ContentReader, error) { diff --git a/http/httpclient/client.go b/http/httpclient/client.go index e1157cff7..bc829797e 100644 --- a/http/httpclient/client.go +++ b/http/httpclient/client.go @@ -3,8 +3,10 @@ package httpclient import ( "bytes" "context" - "github.com/minio/sha256-simd" "strings" + + "github.com/minio/sha256-simd" + //#nosec G505 -- sha1 is supported by Artifactory. "crypto/sha1" "encoding/hex" diff --git a/utils/utils.go b/utils/utils.go index 3c0ba281a..22c4b5b58 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -31,6 +31,8 @@ const ( Version = "1.47.3" ) +const xrayDevVersion = "3.x-dev" + type MinVersionProduct string const ( @@ -68,6 +70,10 @@ func getDefaultUserAgent() string { } func ValidateMinimumVersion(product MinVersionProduct, currentVersion, minimumVersion string) error { + if currentVersion == xrayDevVersion { + return nil + } + if !version.NewVersion(currentVersion).AtLeast(minimumVersion) { return errorutils.CheckErrorf(MinimumVersionMsg, product, currentVersion, minimumVersion) }