mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Add Label to Credentials in test files
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
This commit is contained in:
@@ -106,8 +106,8 @@ func ExampleStore() {
|
|||||||
|
|
||||||
func TestStore(t *testing.T) {
|
func TestStore(t *testing.T) {
|
||||||
valid := []credentials.Credentials{
|
valid := []credentials.Credentials{
|
||||||
{validServerAddress, "foo", "bar"},
|
{credentials.CredsLabel, validServerAddress, "foo", "bar"},
|
||||||
{validServerAddress2, "<token>", "abcd1234"},
|
{credentials.CredsLabel, validServerAddress2, "<token>", "abcd1234"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range valid {
|
for _, v := range valid {
|
||||||
@@ -117,7 +117,7 @@ func TestStore(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
invalid := []credentials.Credentials{
|
invalid := []credentials.Credentials{
|
||||||
{invalidServerAddress, "foo", "bar"},
|
{credentials.CredsLabel, invalidServerAddress, "foo", "bar"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range invalid {
|
for _, v := range invalid {
|
||||||
@@ -140,8 +140,8 @@ func ExampleGet() {
|
|||||||
|
|
||||||
func TestGet(t *testing.T) {
|
func TestGet(t *testing.T) {
|
||||||
valid := []credentials.Credentials{
|
valid := []credentials.Credentials{
|
||||||
{validServerAddress, "foo", "bar"},
|
{credentials.CredsLabel, validServerAddress, "foo", "bar"},
|
||||||
{validServerAddress2, "<token>", "abcd1234"},
|
{credentials.CredsLabel, validServerAddress2, "<token>", "abcd1234"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range valid {
|
for _, v := range valid {
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ struct Server {
|
|||||||
char *keychain_add(struct Server *server, char *label, char *username, char *secret);
|
char *keychain_add(struct Server *server, char *label, char *username, char *secret);
|
||||||
char *keychain_get(struct Server *server, unsigned int *username_l, char **username, unsigned int *secret_l, char **secret);
|
char *keychain_get(struct Server *server, unsigned int *username_l, char **username, unsigned int *secret_l, char **secret);
|
||||||
char *keychain_delete(struct Server *server);
|
char *keychain_delete(struct Server *server);
|
||||||
char *keychain_list(char *** data, char *** accts, unsigned int *list_l);
|
char *keychain_list(char *credsLabel, char *** data, char *** accts, unsigned int *list_l);
|
||||||
void freeListData(char *** data, unsigned int length);
|
void freeListData(char *** data, unsigned int length);
|
||||||
@@ -7,11 +7,13 @@ import (
|
|||||||
|
|
||||||
func TestOSXKeychainHelper(t *testing.T) {
|
func TestOSXKeychainHelper(t *testing.T) {
|
||||||
creds := &credentials.Credentials{
|
creds := &credentials.Credentials{
|
||||||
|
Label: credentials.CredsLabel,
|
||||||
ServerURL: "https://foobar.docker.io:2376/v1",
|
ServerURL: "https://foobar.docker.io:2376/v1",
|
||||||
Username: "foobar",
|
Username: "foobar",
|
||||||
Secret: "foobarbaz",
|
Secret: "foobarbaz",
|
||||||
}
|
}
|
||||||
creds1 := &credentials.Credentials{
|
creds1 := &credentials.Credentials{
|
||||||
|
Label: credentials.CredsLabel,
|
||||||
ServerURL: "https://foobar.docker.io:2376/v2",
|
ServerURL: "https://foobar.docker.io:2376/v2",
|
||||||
Username: "foobarbaz",
|
Username: "foobarbaz",
|
||||||
Secret: "foobar",
|
Secret: "foobar",
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ func TestSecretServiceHelper(t *testing.T) {
|
|||||||
t.Skip("test requires gnome-keyring but travis CI doesn't have it")
|
t.Skip("test requires gnome-keyring but travis CI doesn't have it")
|
||||||
|
|
||||||
creds := &credentials.Credentials{
|
creds := &credentials.Credentials{
|
||||||
|
Label: credentials.CredsLabel,
|
||||||
ServerURL: "https://foobar.docker.io:2376/v1",
|
ServerURL: "https://foobar.docker.io:2376/v1",
|
||||||
Username: "foobar",
|
Username: "foobar",
|
||||||
Secret: "foobarbaz",
|
Secret: "foobarbaz",
|
||||||
Label: credentials.CredsLabel,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
helper := Secretservice{}
|
helper := Secretservice{}
|
||||||
|
|||||||
Reference in New Issue
Block a user