1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-14 00:11:28 +05:30

Move away from password as a name. We store secrets.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera
2016-03-09 15:18:48 -05:00
parent 0fb2225199
commit 2275377a31
14 changed files with 59 additions and 59 deletions
+8 -8
View File
@@ -33,7 +33,7 @@ func (m *memoryStore) Get(serverURL string) (string, string, error) {
if !ok {
return "", "", fmt.Errorf("creds not found for %s", serverURL)
}
return c.Username, c.Password, nil
return c.Username, c.Secret, nil
}
func TestStore(t *testing.T) {
@@ -41,7 +41,7 @@ func TestStore(t *testing.T) {
creds := &Credentials{
ServerURL: serverURL,
Username: "foo",
Password: "bar",
Secret: "bar",
}
b, err := json.Marshal(creds)
if err != nil {
@@ -63,8 +63,8 @@ func TestStore(t *testing.T) {
t.Fatalf("expected username foo, got %s\n", c.Username)
}
if c.Password != "bar" {
t.Fatalf("expected username bar, got %s\n", c.Password)
if c.Secret != "bar" {
t.Fatalf("expected username bar, got %s\n", c.Secret)
}
}
@@ -73,7 +73,7 @@ func TestGet(t *testing.T) {
creds := &Credentials{
ServerURL: serverURL,
Username: "foo",
Password: "bar",
Secret: "bar",
}
b, err := json.Marshal(creds)
if err != nil {
@@ -105,8 +105,8 @@ func TestGet(t *testing.T) {
t.Fatalf("expected username foo, got %s\n", c.Username)
}
if c.Password != "bar" {
t.Fatalf("expected username bar, got %s\n", c.Password)
if c.Secret != "bar" {
t.Fatalf("expected username bar, got %s\n", c.Secret)
}
}
@@ -115,7 +115,7 @@ func TestErase(t *testing.T) {
creds := &Credentials{
ServerURL: serverURL,
Username: "foo",
Password: "bar",
Secret: "bar",
}
b, err := json.Marshal(creds)
if err != nil {