diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-06-20 15:10:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 15:10:56 -0400 |
commit | 931ee28eb9c5b5e3c2b0d3008f5f65d810dc9b0c (patch) | |
tree | 5dbcccffd509fa71a99c351ed4628ed0841e1e46 /src/artifactory.c | |
parent | 11aa1d44d95da221073e512fbec3bbccc0f1a46b (diff) | |
download | stasis-931ee28eb9c5b5e3c2b0d3008f5f65d810dc9b0c.tar.gz |
Unit tests (#6)
* Initial commit of unit tests [WIP]
* Address shortcomings and bugs flushed out by unit tests
* Enable unit testing in CI workflow
* Enable verbose ctests
* Handle lack of __FILE_NAME__ define
* Only podman support `run --arch` argument
* Skip docker build testing if CI system cannot pull an image
* Remove errant call to puts()
* Identify local repo user
* Fix missing xmllint
* NULL terminate arrays
* Fix filename assignment in is_url mode
* Break loop when expected lines are exhausted
* strcmp_array expects NULL terminated array. Iterating by size in this case passes NULL to strcmp leading to an invalid read
* Remove debug printf statements
* Disable a few warnings for tests
* Workaround for ctest junit xml truncation
* Update checkout@v4
* Prevent false-positive result
* Return zero on error
* Fix strlist_remove function
* Value argument can be constant
* Fix test to match changes to startswith and endswith
* Add test_ini.c
* Fix redaction code to accept NULL pointers in array
* And let the caller specify the length of the array of strings to redact.
* Redactions now occur directly on authentication strings rather than their command line arguments
* Fix BUILD_TESTING_DEBUG
* Adds missing -D argument
Diffstat (limited to 'src/artifactory.c')
-rw-r--r-- | src/artifactory.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/artifactory.c b/src/artifactory.c index 4772602..5678d64 100644 --- a/src/artifactory.c +++ b/src/artifactory.c @@ -229,16 +229,15 @@ int jfrog_cli(struct JFRT_Auth *auth, char *args) { } const char *redactable[] = { - "--access-token=", - "--ssh-key-path=", - "--ssh-passphrase=", - "--client-cert-key-path=", - "--client-cert-path=", - "--password=", - NULL, + auth->access_token, + auth->ssh_key_path, + auth->ssh_passphrase, + auth->client_cert_key_path, + auth->client_cert_path, + auth->password, }; snprintf(cmd, sizeof(cmd) - 1, "jf %s %s", args, auth_args); - redact_sensitive(redactable, cmd, cmd_redacted, sizeof(cmd_redacted) - 1); + redact_sensitive(redactable, sizeof(redactable) / sizeof (*redactable), cmd, cmd_redacted, sizeof(cmd_redacted) - 1); guard_free(auth_args); guard_strlist_free(&arg_map); |