mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #65786 from dmurphy18/fix_63063
[3006.x] Fix credentials encoding for Artifactory
This commit is contained in:
commit
d1a3b3ef6d
3 changed files with 10 additions and 8 deletions
1
changelog/63063.fixed.md
Normal file
1
changelog/63063.fixed.md
Normal file
|
@ -0,0 +1 @@
|
|||
Corrected encoding of credentials for use with Artifactory
|
|
@ -79,7 +79,7 @@ def get_latest_snapshot(
|
|||
headers = {}
|
||||
if username and password:
|
||||
headers["Authorization"] = "Basic {}".format(
|
||||
salt.utils.hashutils.base64_encodestring(
|
||||
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_encodestring(
|
||||
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_encodestring(
|
||||
salt.utils.hashutils.base64_b64encode(
|
||||
"{}:{}".format(username.replace("\n", ""), password.replace("\n", ""))
|
||||
)
|
||||
)
|
||||
|
@ -320,8 +320,9 @@ def get_release(
|
|||
headers = {}
|
||||
if username and password:
|
||||
headers["Authorization"] = "Basic {}".format(
|
||||
salt.utils.hashutils.base64_encodestring(
|
||||
salt.utils.hashutils.base64_b64encode(
|
||||
"{}:{}".format(username.replace("\n", ""), password.replace("\n", ""))
|
||||
## f"{username.replace("\n", "")}:{password.replace("\n", "")}")
|
||||
)
|
||||
)
|
||||
release_url, file_name = _get_release_url(
|
||||
|
|
|
@ -278,7 +278,7 @@ def test_get_latest_snapshot_username_password():
|
|||
save_artifact_mock.assert_called_with(
|
||||
"http://artifactory.example.com/artifactory/snapshot",
|
||||
"/path/to/file",
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA==\n"},
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA=="},
|
||||
)
|
||||
|
||||
|
||||
|
@ -305,7 +305,7 @@ def test_get_snapshot_username_password():
|
|||
save_artifact_mock.assert_called_with(
|
||||
"http://artifactory.example.com/artifactory/snapshot",
|
||||
"/path/to/file",
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA==\n"},
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA=="},
|
||||
)
|
||||
|
||||
|
||||
|
@ -334,7 +334,7 @@ def test_get_latest_release_username_password():
|
|||
save_artifact_mock.assert_called_with(
|
||||
"http://artifactory.example.com/artifactory/release",
|
||||
"/path/to/file",
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA==\n"},
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA=="},
|
||||
)
|
||||
|
||||
|
||||
|
@ -361,7 +361,7 @@ def test_get_release_username_password():
|
|||
save_artifact_mock.assert_called_with(
|
||||
"http://artifactory.example.com/artifactory/release",
|
||||
"/path/to/file",
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA==\n"},
|
||||
{"Authorization": "Basic dXNlcjpwYXNzd29yZA=="},
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue