Skip to content

Commit

Permalink
Revert "Drop username from IdentityToken auth"
Browse files Browse the repository at this point in the history
This reverts commit ae31b47.
  • Loading branch information
GeorgeMac committed Aug 10, 2018
1 parent ae31b47 commit 556c7a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ func authConfigs(confs map[string]dockerConfig) (*AuthConfigurations, error) {

// docker config contains username and identitytoken
c.Configs[reg] = AuthConfiguration{
Username: string(data),
IdentityToken: conf.IdentityToken,
}

Expand Down
3 changes: 3 additions & 0 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ func TestAuthConfigIdentityToken(t *testing.T) {
if !ok {
t.Error("NewAuthConfigurations: Expected Configs to contain docker.io")
}
if got, want := c.Username, "someuser"; got != want {
t.Errorf(`AuthConfigurations.Configs["docker.io"].IdentityToken: wrong result. Want %q. Got %q`, want, got)
}
if got, want := c.IdentityToken, "sometoken"; got != want {
t.Errorf(`AuthConfigurations.Configs["docker.io"].IdentityToken: wrong result. Want %q. Got %q`, want, got)
}
Expand Down

0 comments on commit 556c7a2

Please sign in to comment.