Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions wincred/wincred.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
Comment on lines +23 to +26
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the main intent was to not assume winc.NewGenericCredential would always initialise with empty attributes. Currently that's the case, but we shouldn't assume that's the case.


return g.Write()
}
Expand Down