mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Merge pull request #433 from thaJeztah/wincred_inline
wincred: inline label, and append to existing
This commit is contained in:
+4
-2
@@ -16,12 +16,14 @@ type Wincred struct{}
|
||||
|
||||
// Add adds new credentials to the windows credentials manager.
|
||||
func (h Wincred) Add(creds *credentials.Credentials) error {
|
||||
credsLabels := []byte(credentials.CredsLabel)
|
||||
g := winc.NewGenericCredential(creds.ServerURL)
|
||||
g.UserName = creds.Username
|
||||
g.CredentialBlob = []byte(creds.Secret)
|
||||
g.Persist = winc.PersistLocalMachine
|
||||
g.Attributes = []winc.CredentialAttribute{{Keyword: "label", Value: credsLabels}}
|
||||
g.Attributes = append(g.Attributes, winc.CredentialAttribute{
|
||||
Keyword: "label",
|
||||
Value: []byte(credentials.CredsLabel),
|
||||
})
|
||||
|
||||
return g.Write()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user