mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Merge pull request #38 from ebriney/mac-delete-before-adding
mac: delete credentials before adding them
This commit is contained in:
@@ -10,11 +10,12 @@ package osxkeychain
|
|||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/docker/docker-credential-helpers/credentials"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/docker/docker-credential-helpers/credentials"
|
||||||
)
|
)
|
||||||
|
|
||||||
// errCredentialsNotFound is the specific error message returned by OS X
|
// errCredentialsNotFound is the specific error message returned by OS X
|
||||||
@@ -26,6 +27,8 @@ type Osxkeychain struct{}
|
|||||||
|
|
||||||
// Add adds new credentials to the keychain.
|
// Add adds new credentials to the keychain.
|
||||||
func (h Osxkeychain) Add(creds *credentials.Credentials) error {
|
func (h Osxkeychain) Add(creds *credentials.Credentials) error {
|
||||||
|
h.Delete(creds.ServerURL)
|
||||||
|
|
||||||
s, err := splitServer(creds.ServerURL)
|
s, err := splitServer(creds.ServerURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user