Unable to login to registry
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
I am using this credentials store from my environment /usr/local/bin/docker-credential-desktop
upon trying to login an error is thrown that the credentials are not found. b'No stored credential for repo.example.com\n'
looking at the credential store.get() function it states it raises a credentials.StoreError on no existing credentials.
I think it should raise credentials.CredentialsNotFound so upon the python client.login() it can create these credentials and use them.
The get() function should return the same response for all various credential stores and not rely on everyone using docker-credential-pass as the credential store for this behavior to work as expected.
def get(self, server):
""" Retrieve credentials for `server`. If no credentials are found,
a `StoreError` will be raised.
"""
if not isinstance(server, six.binary_type):
server = server.encode('utf-8')
data = self._execute('get', server)
result = json.loads(data.decode('utf-8'))
# docker-credential-pass will return an object for inexistent servers
# whereas other helpers will exit with returncode != 0. For
# consistency, if no significant data is returned,
# raise CredentialsNotFound
if result['Username'] == '' and result['Secret'] == '':
raise errors.CredentialsNotFound(
'No matching credentials in {}'.format(self.program)
)
return result
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the credential store get() function shown in the issue and trace how python client.login() handles missing credentials. Ensure missing credentials produce the same CredentialsNotFound behavior across credential stores, allowing login to create them; verify the existing credential-store behavior afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100