File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,6 @@ func (h Osxkeychain) List() (map[string]string, error) {
117
117
default :
118
118
return nil , err
119
119
}
120
- } else if len (res ) == 0 {
121
- return nil , credentials .NewErrCredentialsNotFound ()
122
120
}
123
121
124
122
resp := make (map [string ]string )
@@ -131,14 +129,22 @@ func (h Osxkeychain) List() (map[string]string, error) {
131
129
return resp , nil
132
130
}
133
131
132
+ const (
133
+ // Hardcoded protocol types matching their Objective-C equivalents.
134
+ // https://developer.apple.com/documentation/security/ksecattrprotocolhttps?language=objc
135
+ kSecProtocolTypeHTTPS = "htps" // This is NOT a typo.
136
+ // https://developer.apple.com/documentation/security/ksecattrprotocolhttp?language=objc
137
+ kSecProtocolTypeHTTP = "http"
138
+ )
139
+
134
140
func splitServer (serverURL string , item keychain.Item ) error {
135
141
u , err := registryurl .Parse (serverURL )
136
142
if err != nil {
137
143
return err
138
144
}
139
- item .SetProtocol ("https" )
145
+ item .SetProtocol (kSecProtocolTypeHTTPS )
140
146
if u .Scheme == "http" {
141
- item .SetProtocol ("http" )
147
+ item .SetProtocol (kSecProtocolTypeHTTP )
142
148
}
143
149
item .SetServer (u .Hostname ())
144
150
if p := u .Port (); p != "" {
You can’t perform that action at this time.
0 commit comments