update dependencies (sane go.mod) (#1061)

This commit is contained in:
nils måsén 2021-09-29 11:34:05 +02:00 committed by GitHub
parent 697397f289
commit 47a640b764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 759 additions and 249 deletions

View file

@ -1,16 +1,17 @@
package registry
import (
"encoding/base64"
"encoding/json"
"errors"
"os"
"strings"
"github.com/docker/cli/cli/command"
cliconfig "github.com/docker/cli/cli/config"
"github.com/docker/cli/cli/config/configfile"
"github.com/docker/cli/cli/config/credentials"
"github.com/docker/cli/cli/config/types"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
log "github.com/sirupsen/logrus"
)
@ -96,6 +97,10 @@ func CredentialsStore(configFile configfile.ConfigFile) credentials.Store {
}
// EncodeAuth Base64 encode an AuthConfig struct for transmission over HTTP
func EncodeAuth(auth types.AuthConfig) (string, error) {
return command.EncodeAuthToBase64(auth)
func EncodeAuth(authConfig types.AuthConfig) (string, error) {
buf, err := json.Marshal(authConfig)
if err != nil {
return "", err
}
return base64.URLEncoding.EncodeToString(buf), nil
}