Fixes X-Registry-Auth
encoding from base64 to url_safe base64
#384
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
For authentication for push/pull operations over registries, the value the
X-Registry-Auth
HTTP header is the base64 encoded of the json dump of the authorization data.Plain base64 encoding causes problems if
+
character is present in the base64 encoded value, as+
is a special separator in HTTP headers. The request is rejected by registries if '+' is present in that base64 encoded data.Fix
It's required to change the plain base64 encoding for
url_safe
base64 encoding, as this encoding avoid using the problematic characters for HTTP and that's the encoding the registries are expecting.The base64
url_safe
encoding is present already in podman client or docker or docker-py.Tests
According to my tests,
+
appears in base64 encoded when punctuation characters are encoded, for example:Gets base64 encoded, showing the issue, as: