Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions artifactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,32 @@ func TestArtifactorySelfSignedCert(t *testing.T) {
assert.NoError(t, err)
readerCloseAndAssert(t, reader)

// Remove the certificates from CLI security dir before testing custom cert dir location
defer clientTestUtils.RemoveAndAssert(t, filepath.Join(certsPath, certificate.KeyFile))
defer clientTestUtils.RemoveAndAssert(t, filepath.Join(certsPath, certificate.CertFile))

// Create a new temp dir for certificates and set the CertsDir env variable
tempCertsDirPath, createTempDirCallback := coretests.CreateTempDirWithCallbackAndAssert(t)
defer createTempDirCallback()
setEnvCallBack = clientTestUtils.SetEnvWithCallbackAndAssert(t, coreutils.CertsDir, tempCertsDirPath)
defer setEnvCallBack()

// Check the certificate dir have moved to the new temp dir location
certsPath, err = coreutils.GetJfrogCertsDir()
assert.NoError(t, err)
assert.Equal(t, tempCertsDirPath, certsPath)

// Copy the server certificates to the custom CLI certificate dir and run again. We expect the command to succeed.
err = biutils.CopyFile(certsPath, certificate.KeyFile)
assert.NoError(t, err)
err = biutils.CopyFile(certsPath, certificate.CertFile)
assert.NoError(t, err)
searchCmd = generic.NewSearchCommand()
searchCmd.SetServerDetails(serverDetails).SetSpec(fileSpec)
reader, err = searchCmd.Search()
assert.NoError(t, err)
readerCloseAndAssert(t, reader)

serverDetails.ArtifactoryUrl = artAuth.GetUrl()
cleanArtifactoryTest()
}
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,5 @@ require (
// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.54.2-0.20251007084958-5eeaa42c31a6

// replace github.com/jfrog/jfrog-cli-artifactory => github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260818062137-18e36e626c63

replace github.com/jfrog/jfrog-cli-core/v2 => ../jfrog-cli-core
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,6 @@ github.com/jfrog/jfrog-cli-application v1.0.2-0.20260817110546-58a0a6fe6fc9 h1:g
github.com/jfrog/jfrog-cli-application v1.0.2-0.20260817110546-58a0a6fe6fc9/go.mod h1:p8yLtbmCxxQucIbLZKnWu0F+EDtj6NLXbRQCEK/nb6o=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260819070735-a590327f2489 h1:FxdCh8hxWuboF+q6okuJimF96aTFNSTXlIi0Blwp3Uo=
github.com/jfrog/jfrog-cli-artifactory v0.8.1-0.20260819070735-a590327f2489/go.mod h1:1ACZmkzA38Si48i9f052M4BDLfti02lHUfL/f853Ny0=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260814125750-77deb9f6259c h1:H77lybOSbPe2T70+l0Q9zy7eXWLbLj4ph2R2Svahf5A=
github.com/jfrog/jfrog-cli-core/v2 v2.60.1-0.20260814125750-77deb9f6259c/go.mod h1:gf7aUg/G9JyltCNhwMD5RVEsFzUCKPWKXRcTXSqMYBk=
github.com/jfrog/jfrog-cli-evidence v0.11.0 h1:LcRgu2ynNu47/Za1vbwn0jHiOvSzgCcCPvi7S8/rotM=
github.com/jfrog/jfrog-cli-evidence v0.11.0/go.mod h1:I83k7IH/cmMh00LyZOp13jctj8/pPKVHSAlu7GMJgwI=
github.com/jfrog/jfrog-cli-platform-services v1.10.1-0.20260618062042-6053ab368cab h1:Zn/qB8LYhSu82YDtbqXwErN1RPHTHe/a3gQY6Ti/OBE=
Expand Down
Loading