Skip to content

Wrong base64 encoding #1145

Closed
Closed

Description

@kubukoz

Hi!

Some parts of this project, specifically the ones that encode the X-Registry-Auth header, use base64Encode to encode the JSON object with the username/password etc. However, that's not an url-safe way, and docker-cli encodes it in a slightly different way: moby/moby#33434

So, if your password/username contains special characters that get encoded to something that contains e.g. a slash, docker-java will still insert a slash into the header whereas an underscore should be used. This caused me a lot of headaches when trying to set up testcontainers with a private registry...

Anyway, I think the only reasonable solution is to replace the way docker-java encodes the header. Same follows for the token (see https://docs.docker.com/registry/spec/auth/jwt/, search for base64).

Activity

  1. kubukoz commented on Jan 15, 2019

    @kubukoz
    Author

    Closed by #1146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions