feat: add JFROG_CLI_CERTS_DIR env support - #1607
Conversation
Allow overriding JFrog CLI certificates directory
fluxxBot
left a comment
There was a problem hiding this comment.
also please raise a PR on jfrog-cli - https://github.com/jfrog/jfrog-cli with a integration test
| } | ||
|
|
||
| func TestGetJfrogCertsDirFromEnv(t *testing.T) { | ||
| t.Setenv("JFROG_CLI_CERTS_DIR", "/custom/certs") |
There was a problem hiding this comment.
create a helper function that returns a defer function which unsets this
There was a problem hiding this comment.
I have created a defer func using the same method used further up the same file:
jfrog-cli-core/utils/coreutils/utils_test.go
Lines 221 to 223 in 77deb9f
| if os.Getenv(CertsDir) != "" { | ||
| return os.Getenv(CertsDir), nil | ||
| } | ||
|
|
There was a problem hiding this comment.
also need to normalize and validate the system paths
There was a problem hiding this comment.
I have added a filepath normalization to the certsDir, but validation doesn't seem to fit here.
We do not validate the JFrog Home Dir either
jfrog-cli-core/utils/coreutils/utils.go
Lines 310 to 313 in 77deb9f
Please tell me if i should add validation nonetheless
|
also tests are failing please take a look |
Co-authored-by: Kanishk Gupta <kanishkg@jfrog.com>
|
I have implemented some changes based on your review, and i should have fixed the test failing on Windows. |

This PR introduces the env variable
JFROG_CLI_CERTS_DIRfor overriding the certificates directory.More information about the feature can be found here jfrog/jfrog-cli#3661