Updated use of base64_b64encode and change log

This commit is contained in:
David Murphy 2024-01-03 14:57:41 -07:00
parent b8bb8f4c70
commit f9d456bf10
No known key found for this signature in database
GPG key ID: 2A0B9ABC42BBA5E9
2 changed files with 5 additions and 4 deletions

1
changelog/63063.fixed.md Normal file
View file

@ -0,0 +1 @@
Corrected encoding of credentials for use with Artifactory

View file

@ -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", "")}")
)