mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-14 00:11:28 +05:30
@@ -13,11 +13,12 @@ type Wincred struct{}
|
|||||||
|
|
||||||
// Add adds new credentials to the windows credentials manager.
|
// Add adds new credentials to the windows credentials manager.
|
||||||
func (h Wincred) Add(creds *credentials.Credentials) error {
|
func (h Wincred) Add(creds *credentials.Credentials) error {
|
||||||
|
credsLabels := []byte(credentials.CredsLabel)
|
||||||
g := winc.NewGenericCredential(creds.ServerURL)
|
g := winc.NewGenericCredential(creds.ServerURL)
|
||||||
g.UserName = creds.Username
|
g.UserName = creds.Username
|
||||||
g.CredentialBlob = []byte(creds.Secret)
|
g.CredentialBlob = []byte(creds.Secret)
|
||||||
g.Persist = winc.PersistLocalMachine
|
g.Persist = winc.PersistLocalMachine
|
||||||
g.Attributes = []winc.CredentialAttribute{{"label", []byte(credentials.CredsLabel)}}
|
g.Attributes = []winc.CredentialAttribute{{Keyword: "label", Value: credsLabels}}
|
||||||
|
|
||||||
return g.Write()
|
return g.Write()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user