-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Credentials with artifactory.downloaded do not work since python3 migration #63063
Comments
It should be noted that this was not caught because there are not unit tests for calling this method with credentials. |
This is caused by 4960c90 by @DmitryKuzmenko and @dwoz which started encoding credentials with salt.utils.hashutils.base64_encodestring() which clearly says that Among other possible differences, the "modern" encoder includes a newline ('\n') character after every 76 characters and always at the end of the encoded string. From what I can see httpclient has a regex for headers and most likely doesn't like that trailing \n. |
4960c90 should have changed base64.b64encode() to salt.utils.hashutils.base64_b64encode() not salt.utils.hashutils.base64_encodestring() and then all would have been fine and dandy. |
@tomsolpa Working on this but can you confirm the issue still exists with a version of Salt that is supported, that is, 3006.4 or 3006.5, since 3004 is EOL. |
@tomsolpa Ping, have you tried it on a supported version of Salt , that is , 3006.5 |
Closing since PR #65786 merged |
Description
Since upgrading from python2 to python3, using credentials with the artifactory.downloaded state function stopped working.
Headers are not cleaned ("\n" remain) before using.
Generating the errors :
Setup
Salt-minion : 3003.3, 3004
Python 3.7.3, 3.9.2
Steps to reproduce
Versions Report
Salt Version:
Salt: 3004
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.8.1
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.11.3
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.0
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: Not Installed
pycryptodome: 3.9.7
pygit2: Not Installed
Python: 3.9.2 (default, Feb 28 2021, 17:03:44)
python-gnupg: Not Installed
PyYAML: 5.3.1
PyZMQ: 20.0.0
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.4
System Versions:
dist: debian 11 bullseye
locale: utf-8
machine: x86_64
release: 5.10.0-9-amd64
system: Linux
version: Debian GNU/Linux 11 bullseye
The text was updated successfully, but these errors were encountered: