mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-28 07:11:36 +05:30
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 833d2c334f | |||
| 9651bf7802 | |||
| 26274da6cf | |||
| f4cdabf916 | |||
| c7514a0999 |
@@ -2,6 +2,8 @@ module github.com/docker/docker-credential-helpers
|
|||||||
|
|
||||||
go 1.21
|
go 1.21
|
||||||
|
|
||||||
|
retract v0.9.0 // osxkeychain: a regression caused backward-incompatibility with earlier versions
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/danieljoos/wincred v1.2.2
|
github.com/danieljoos/wincred v1.2.2
|
||||||
github.com/keybase/go-keychain v0.0.1
|
github.com/keybase/go-keychain v0.0.1
|
||||||
|
|||||||
@@ -117,8 +117,6 @@ func (h Osxkeychain) List() (map[string]string, error) {
|
|||||||
default:
|
default:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
} else if len(res) == 0 {
|
|
||||||
return nil, credentials.NewErrCredentialsNotFound()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := make(map[string]string)
|
resp := make(map[string]string)
|
||||||
@@ -131,14 +129,22 @@ func (h Osxkeychain) List() (map[string]string, error) {
|
|||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Hardcoded protocol types matching their Objective-C equivalents.
|
||||||
|
// https://developer.apple.com/documentation/security/ksecattrprotocolhttps?language=objc
|
||||||
|
kSecProtocolTypeHTTPS = "htps" // This is NOT a typo.
|
||||||
|
// https://developer.apple.com/documentation/security/ksecattrprotocolhttp?language=objc
|
||||||
|
kSecProtocolTypeHTTP = "http"
|
||||||
|
)
|
||||||
|
|
||||||
func splitServer(serverURL string, item keychain.Item) error {
|
func splitServer(serverURL string, item keychain.Item) error {
|
||||||
u, err := registryurl.Parse(serverURL)
|
u, err := registryurl.Parse(serverURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
item.SetProtocol("https")
|
item.SetProtocol(kSecProtocolTypeHTTPS)
|
||||||
if u.Scheme == "http" {
|
if u.Scheme == "http" {
|
||||||
item.SetProtocol("http")
|
item.SetProtocol(kSecProtocolTypeHTTP)
|
||||||
}
|
}
|
||||||
item.SetServer(u.Hostname())
|
item.SetServer(u.Hostname())
|
||||||
if p := u.Port(); p != "" {
|
if p := u.Port(); p != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user