Skip to content

fix: Correctly handle registry prefix #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jimmidyson
Copy link

@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`).
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.

1 participant