summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/auth.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-02-18 18:03:48 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-02-19 16:04:00 -0500
commit96de762eedd1470dfbe73cf424eea848589268d7 (patch)
treec4a30d19481f1f3c074a6848c8ed4761a09fac0d /vendor/github.com/fsouza/go-dockerclient/auth.go
parentf2bcc9cc7dc8b1937f39db503db96651d84c3e3e (diff)
downloadpodman-96de762eedd1470dfbe73cf424eea848589268d7.tar.gz
podman-96de762eedd1470dfbe73cf424eea848589268d7.tar.bz2
podman-96de762eedd1470dfbe73cf424eea848589268d7.zip
Update to the latest version of buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/auth.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/auth.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/auth.go b/vendor/github.com/fsouza/go-dockerclient/auth.go
index eb1a31716..cae2a020f 100644
--- a/vendor/github.com/fsouza/go-dockerclient/auth.go
+++ b/vendor/github.com/fsouza/go-dockerclient/auth.go
@@ -30,7 +30,7 @@ type AuthConfiguration struct {
ServerAddress string `json:"serveraddress,omitempty"`
// IdentityToken can be supplied with the identitytoken response of the AuthCheck call
- // see https://godoc.org/github.com/docker/docker/api/types#AuthConfig
+ // see https://pkg.go.dev/github.com/docker/docker/api/types?tab=doc#AuthConfig
// It can be used in place of password not in conjunction with it
IdentityToken string `json:"identitytoken,omitempty"`
@@ -170,9 +170,14 @@ func authConfigs(confs map[string]dockerConfig) (*AuthConfigurations, error) {
if conf.Auth == "" {
continue
}
+
+ // support both padded and unpadded encoding
data, err := base64.StdEncoding.DecodeString(conf.Auth)
if err != nil {
- return nil, err
+ data, err = base64.StdEncoding.WithPadding(base64.NoPadding).DecodeString(conf.Auth)
+ }
+ if err != nil {
+ return nil, errors.New("error decoding plaintext credentials")
}
userpass := strings.SplitN(string(data), ":", 2)