File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,17 @@ func (h Osxkeychain) Add(creds *credentials.Credentials) error {
4646 item .SetLabel (credentials .CredsLabel )
4747 item .SetAccount (creds .Username )
4848 item .SetData ([]byte (creds .Secret ))
49+ // Prior to v0.9, the credential helper was searching for credentials with
50+ // the "dflt" authentication type (see [1]). Since v0.9.0, Get doesn't use
51+ // that attribute anymore, and v0.9.0 - v0.9.2 were not setting it here
52+ // either.
53+ //
54+ // In order to keep compatibility with older versions, we need to store
55+ // credentials with this attribute set. This way, credentials stored with
56+ // newer versions can be retrieved by older versions.
57+ //
58+ // [1]: https://github.com/docker/docker-credential-helpers/blob/v0.8.2/osxkeychain/osxkeychain.c#L66
59+ item .SetAuthenticationType ("dflt" )
4960 if err := splitServer (creds .ServerURL , item ); err != nil {
5061 return err
5162 }
You can’t perform that action at this time.
0 commit comments