Skip to content

fix: Correctly handle registry prefix#2

Merged
sudoforge merged 1 commit intosudoforge:masterfrom
jimmidyson:credential-prefix
Mar 23, 2026
Merged

fix: Correctly handle registry prefix#2
sudoforge merged 1 commit intosudoforge:masterfrom
jimmidyson:credential-prefix

Conversation

@jimmidyson
Copy link
Copy Markdown

@jimmidyson jimmidyson commented Jul 9, 2025

When listing by prefix, this should ensure the / is added at the end, otherwise URLs for subdomains, etc are also included in the results, leading to finding multiple logins, when in reality only one exists.

As an example, logging in to Docker Hub via docker login results in the following entries in the gopass store:

gopass
└── io.container.registries/
    ├── aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEv/
    │   └── dGVzdHVzZXIK
    ├── aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvYWNjZXNzLXRva2Vu/
    │   └── dGVzdHVzZXIK
    └── aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvcmVmcmVzaC10b2tlbg==/
        └── dGVzdHVzZXIK

Entries are created for:

https://index.docker.io/v1/
https://index.docker.io/v1/access-token
https://index.docker.io/v1/refresh-token

When listing these are seen as multiple logins, where in reality they are a single login (in the case above for testuser).

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

When listing by prefix, this should ensure the `/` is added at the end,
otherwise URLs for subdomains, etc are also included in the results,
leading to finding multiple logins, when in reality only one exists.

As an example, logging in to Docker Hub via `docker login` results in
the following entries  in the gopass store:

```
gopass
└── io.container.registries/
    ├── aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEv/
    │   └── dGVzdHVzZXIK
    ├── aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvYWNjZXNzLXRva2Vu/
    │   └── dGVzdHVzZXIK
    └── aHR0cHM6Ly9pbmRleC5kb2NrZXIuaW8vdjEvcmVmcmVzaC10b2tlbg==/
        └── dGVzdHVzZXIK
```

Entries are created for:

https://index.docker.io/v1/
https://index.docker.io/v1/access-token
https://index.docker.io/v1/refresh-token%

When listing these are seen as multiple logins, where in reality they
are a single login (in the case above for `testuser`).
@stefan2904
Copy link
Copy Markdown

For some reason, login to dockerhub started to fail for me, and I think your patch might be the solution.

For the record:

ERROR: failed to build: failed to solve: error getting credentials - err: exit status 1, out: `found more than one entry for registry: https://index.docker.io/v1/`

Copy link
Copy Markdown
Owner

@sudoforge sudoforge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

i apologize for the delayed response. apparently i never enabled notifications for this fork. or maybe i had explicitly disabled them after creating it. regardless, i've enabled them now.


thanks for catching this!

@sudoforge sudoforge merged commit fe8bcb6 into sudoforge:master Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants