1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-13 16:01:28 +05:30

Cleanup original modifications to the exposed APIs

Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
This commit is contained in:
Nassim 'Nass' Eddequiouaq
2017-03-09 01:33:48 +01:00
parent c5fbd3a5ad
commit 2a8670e0da
10 changed files with 26 additions and 34 deletions
+4 -6
View File
@@ -12,14 +12,14 @@ import (
// Credentials holds the information shared between docker and the credentials store.
type Credentials struct {
Label string
ServerURL string
Username string
Secret string
}
// Docker credentials should be labeled as such in credential stores, this label
// allow us to filter out non-Docker credentials at lookup
// Docker credentials should be labeled as such in credentials stores that allow labelling.
// That label allows to filter out non-Docker credentials too at lookup/search in macOS keychain,
// Windows credentials manager and Linux libsecret.
const CredsLabel = "Docker Credentials"
// Serve initializes the credentials helper and parses the action argument.
@@ -77,8 +77,6 @@ func Store(helper Helper, reader io.Reader) error {
return err
}
creds.Label = CredsLabel
return helper.Add(&creds)
}
@@ -140,7 +138,7 @@ func Erase(helper Helper, reader io.Reader) error {
//List returns all the serverURLs of keys in
//the OS store as a list of strings
func List(helper Helper, writer io.Writer) error {
accts, err := helper.List(CredsLabel)
accts, err := helper.List()
if err != nil {
return err
}
+1 -1
View File
@@ -36,7 +36,7 @@ func (m *memoryStore) Get(serverURL string) (string, string, error) {
return c.Username, c.Secret, nil
}
func (m *memoryStore) List(credsLabel string) (map[string]string, error) {
func (m *memoryStore) List() (map[string]string, error) {
//Simply a placeholder to let memoryStore be a valid implementation of Helper interface
return nil, nil
}
+2 -3
View File
@@ -9,7 +9,6 @@ type Helper interface {
// Get retrieves credentials from the store.
// It returns username and secret as strings.
Get(serverURL string) (string, string, error)
// List returns the stored serverURLs and their associated usernames
// for a given credentials label.
List(credsLabel string) (map[string]string, error)
// List returns the stored serverURLs and their associated usernames.
List() (map[string]string, error)
}