docker / docker-credential-helpers

Programs to keep Docker login credentials safe by storing in platform keystores
MIT License
1.1k stars 173 forks source link

fix(wincred): Encode passwords to UTF-16 #335

Open Bubichoo-Teitichoo opened 2 months ago

Bubichoo-Teitichoo commented 2 months ago

This change adds UTF-16 encoding to the Windows credential helper.

As recommended by the author of the wincred library, the password should be encoded to allow other applications to use the same password.

This is especially needed when the docker image repository is hosted on a JFrog Artifactory, that also hosts Python repositories. Because nobody wants to store their credentials in as plain test within the pip.ini, they're going to enable the keyring support for pip, which in turn uses the Win32API that assumes that the password is a UTF-16 encoded string. Since this is not the case pip will crash with an encoding error.

Disclaimer: I have never used go before. I'm not sure if I have added the dependency as correctly.