From f9d456bf107827a00eb023fda8aec937f403c2eb Mon Sep 17 00:00:00 2001 From: David Murphy < dmurphy@saltstack.com> Date: Wed, 3 Jan 2024 14:57:41 -0700 Subject: [PATCH] Updated use of base64_b64encode and change log --- changelog/63063.fixed.md | 1 + salt/modules/artifactory.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog/63063.fixed.md diff --git a/changelog/63063.fixed.md b/changelog/63063.fixed.md new file mode 100644 index 00000000000..6f26fc11abd --- /dev/null +++ b/changelog/63063.fixed.md @@ -0,0 +1 @@ +Corrected encoding of credentials for use with Artifactory diff --git a/salt/modules/artifactory.py b/salt/modules/artifactory.py index d28e1ca0927..7eaf9c72458 100644 --- a/salt/modules/artifactory.py +++ b/salt/modules/artifactory.py @@ -79,7 +79,7 @@ def get_latest_snapshot( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - salt.utils.hashutils.base64_encode( + salt.utils.hashutils.base64_b64encode( "{}:{}".format(username.replace("\n", ""), password.replace("\n", "")) ) ) @@ -165,7 +165,7 @@ def get_snapshot( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - salt.utils.hashutils.base64_encode( + salt.utils.hashutils.base64_b64encode( "{}:{}".format(username.replace("\n", ""), password.replace("\n", "")) ) ) @@ -238,7 +238,7 @@ def get_latest_release( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - salt.utils.hashutils.base64_encode( + salt.utils.hashutils.base64_b64encode( "{}:{}".format(username.replace("\n", ""), password.replace("\n", "")) ) ) @@ -320,7 +320,7 @@ def get_release( headers = {} if username and password: headers["Authorization"] = "Basic {}".format( - salt.utils.hashutils.base64_encode( + salt.utils.hashutils.base64_b64encode( "{}:{}".format(username.replace("\n", ""), password.replace("\n", "")) ## f"{username.replace("\n", "")}:{password.replace("\n", "")}") )