Skip to content
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

macOS credentials not found error apparently changed #177

Closed
felixfontein opened this issue Mar 21, 2020 · 2 comments
Closed

macOS credentials not found error apparently changed #177

felixfontein opened this issue Mar 21, 2020 · 2 comments

Comments

@felixfontein
Copy link

https://github.com/docker/docker-credential-helpers/blob/master/osxkeychain/osxkeychain_darwin.go contains the hardcoded string The specified item could not be found in the keychain. supposedly returned by SecCopyErrorMessageString (https://github.com/docker/docker-credential-helpers/blob/master/osxkeychain/osxkeychain_darwin.c#L7-L15) when an entry cannot be found in the keychain. Apparently that error message changed to No stored credential for XXX, according to the error messages reported in docker/docker-py#2482.

It would probably better to not rely on magic strings returned by SecCopyErrorMessageString, but instead (also) using the enum values (https://developer.apple.com/documentation/security/1542001-security_framework_result_codes?language=objc), probably this one: errSecItemNotFound.

@crazy-max
Copy link
Member

Apparently that error message changed to No stored credential for XXX, according to the error messages reported in docker/docker-py#2482.

This is not related to the osxkeychain store but the plaintext store used in docker-credential-desktop when no credential store is set in the docker config:

return "", "", errors.New("No stored credential for " + serverURL)

So best guess for docker/docker-py#2482 (comment) is this user didn't set any credsStore in ~/.docker/config.json and therefore it fallback to plaintext store.

Suggest to https://github.com/docker/docker-py maintainers to add a new error case for this store.

@crazy-max
Copy link
Member

This is not related to the osxkeychain store but the plaintext store used in docker-credential-desktop when no credential store is set in the docker config:

return "", "", errors.New("No stored credential for " + serverURL)

I don't see this implementation anymore in current docker-credential-desktop code base. Looks like it has changed years ago and now directly pass through the underlying credential helper.

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

No branches or pull requests

2 participants