JeanRev / TeamcityDockerCloudPlugin

Docker Cloud Plugin for the TeamCity build server
Apache License 2.0
33 stars 10 forks source link

Authentication header not url-safe #45

Open JayeshS opened 5 years ago

JayeshS commented 5 years ago

For registry credentials containing certain characters, the base64 encoding is not url-safe and this fails authentication. Acknowledged here. A fix was also applied to docker-java. Happy to submit a PR.

JeanRev commented 5 years ago

Hi @JayeshS, well spotted. The plugin is using its own API to interact with the Docker daemon, and currently, the password is indeed encoded using the default Base64 Encoder of the JDK, which is not URL-safe. The change must be fairly trivial (namely, replacing Base64.getEncoder() with Base64.getUrlEncoder() in the DefaultDockerClient class: https://github.com/JeanRev/TeamcityDockerCloudPlugin/blob/a210e8a286343543b3abb27a438edbf27c404d19/server/src/main/java/run/var/teamcity/cloud/docker/client/DefaultDockerClient.java#L572-L583 ). I'll do the change and see what I can do to provide a relevant test case (setting up the test infrastructure by yourselves can be a tedious task, especially for such a small change).

I'm not totally sure however when I'll be able to build a new release. The project has been dormant for some months now, since I didn't had time to invest on it, and the plugin is currently virtually untested with the latest TC version :-/ We'll see...

Thank you for reporting!

JayeshS commented 5 years ago

@JeanRev, thanks for the response. For what its worth, we've been using it with TeamCity Enterprise 2017.2.4 for a while now without any issues.