mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 10:03:42 +08:00 
			
		
		
		
	vendor: github.com/docker/docker-credential-helpers v0.8.0
full diff: https://github.com/docker/docker-credential-helpers/compare/v0.7.0...v0.8.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
		
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							@@ -77,7 +77,7 @@ require (
 | 
				
			|||||||
	github.com/containerd/ttrpc v1.2.2 // indirect
 | 
						github.com/containerd/ttrpc v1.2.2 // indirect
 | 
				
			||||||
	github.com/davecgh/go-spew v1.1.1 // indirect
 | 
						github.com/davecgh/go-spew v1.1.1 // indirect
 | 
				
			||||||
	github.com/docker/distribution v2.8.2+incompatible // indirect
 | 
						github.com/docker/distribution v2.8.2+incompatible // indirect
 | 
				
			||||||
	github.com/docker/docker-credential-helpers v0.7.0 // indirect
 | 
						github.com/docker/docker-credential-helpers v0.8.0 // indirect
 | 
				
			||||||
	github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
 | 
						github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
 | 
				
			||||||
	github.com/docker/go-connections v0.4.0 // indirect
 | 
						github.com/docker/go-connections v0.4.0 // indirect
 | 
				
			||||||
	github.com/docker/go-metrics v0.0.1 // indirect
 | 
						github.com/docker/go-metrics v0.0.1 // indirect
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								go.sum
									
									
									
									
									
								
							@@ -163,8 +163,8 @@ github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m3
 | 
				
			|||||||
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
 | 
					github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
 | 
				
			||||||
github.com/docker/docker v24.0.5+incompatible h1:WmgcE4fxyI6EEXxBRxsHnZXrO1pQ3smi0k/jho4HLeY=
 | 
					github.com/docker/docker v24.0.5+incompatible h1:WmgcE4fxyI6EEXxBRxsHnZXrO1pQ3smi0k/jho4HLeY=
 | 
				
			||||||
github.com/docker/docker v24.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 | 
					github.com/docker/docker v24.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
 | 
				
			||||||
github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A=
 | 
					github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
 | 
				
			||||||
github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0=
 | 
					github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
 | 
				
			||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
 | 
					github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
 | 
				
			||||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q=
 | 
					github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q=
 | 
				
			||||||
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
 | 
					github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								vendor/github.com/docker/docker-credential-helpers/client/client.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/docker/docker-credential-helpers/client/client.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -26,7 +26,7 @@ func isValidCredsMessage(msg string) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Store uses an external program to save credentials.
 | 
					// Store uses an external program to save credentials.
 | 
				
			||||||
func Store(program ProgramFunc, creds *credentials.Credentials) error {
 | 
					func Store(program ProgramFunc, creds *credentials.Credentials) error {
 | 
				
			||||||
	cmd := program("store")
 | 
						cmd := program(credentials.ActionStore)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	buffer := new(bytes.Buffer)
 | 
						buffer := new(bytes.Buffer)
 | 
				
			||||||
	if err := json.NewEncoder(buffer).Encode(creds); err != nil {
 | 
						if err := json.NewEncoder(buffer).Encode(creds); err != nil {
 | 
				
			||||||
@@ -50,7 +50,7 @@ func Store(program ProgramFunc, creds *credentials.Credentials) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Get executes an external program to get the credentials from a native store.
 | 
					// Get executes an external program to get the credentials from a native store.
 | 
				
			||||||
func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error) {
 | 
					func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error) {
 | 
				
			||||||
	cmd := program("get")
 | 
						cmd := program(credentials.ActionGet)
 | 
				
			||||||
	cmd.Input(strings.NewReader(serverURL))
 | 
						cmd.Input(strings.NewReader(serverURL))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	out, err := cmd.Output()
 | 
						out, err := cmd.Output()
 | 
				
			||||||
@@ -81,7 +81,7 @@ func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Erase executes a program to remove the server credentials from the native store.
 | 
					// Erase executes a program to remove the server credentials from the native store.
 | 
				
			||||||
func Erase(program ProgramFunc, serverURL string) error {
 | 
					func Erase(program ProgramFunc, serverURL string) error {
 | 
				
			||||||
	cmd := program("erase")
 | 
						cmd := program(credentials.ActionErase)
 | 
				
			||||||
	cmd.Input(strings.NewReader(serverURL))
 | 
						cmd.Input(strings.NewReader(serverURL))
 | 
				
			||||||
	out, err := cmd.Output()
 | 
						out, err := cmd.Output()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
@@ -99,7 +99,7 @@ func Erase(program ProgramFunc, serverURL string) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// List executes a program to list server credentials in the native store.
 | 
					// List executes a program to list server credentials in the native store.
 | 
				
			||||||
func List(program ProgramFunc) (map[string]string, error) {
 | 
					func List(program ProgramFunc) (map[string]string, error) {
 | 
				
			||||||
	cmd := program("list")
 | 
						cmd := program(credentials.ActionList)
 | 
				
			||||||
	cmd.Input(strings.NewReader("unused"))
 | 
						cmd.Input(strings.NewReader("unused"))
 | 
				
			||||||
	out, err := cmd.Output()
 | 
						out, err := cmd.Output()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										13
									
								
								vendor/github.com/docker/docker-credential-helpers/client/command.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/docker/docker-credential-helpers/client/command.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,11 +1,9 @@
 | 
				
			|||||||
package client
 | 
					package client
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
 | 
						"os/exec"
 | 
				
			||||||
	exec "golang.org/x/sys/execabs"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Program is an interface to execute external programs.
 | 
					// Program is an interface to execute external programs.
 | 
				
			||||||
@@ -31,27 +29,26 @@ func NewShellProgramFuncWithEnv(name string, env *map[string]string) ProgramFunc
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func createProgramCmdRedirectErr(commandName string, args []string, env *map[string]string) *exec.Cmd {
 | 
					func createProgramCmdRedirectErr(commandName string, args []string, env *map[string]string) *exec.Cmd {
 | 
				
			||||||
	programCmd := exec.Command(commandName, args...)
 | 
						programCmd := exec.Command(commandName, args...)
 | 
				
			||||||
	programCmd.Env = os.Environ()
 | 
					 | 
				
			||||||
	if env != nil {
 | 
						if env != nil {
 | 
				
			||||||
		for k, v := range *env {
 | 
							for k, v := range *env {
 | 
				
			||||||
			programCmd.Env = append(programCmd.Env, fmt.Sprintf("%s=%s", k, v))
 | 
								programCmd.Env = append(programCmd.Environ(), k+"="+v)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	programCmd.Stderr = os.Stderr
 | 
						programCmd.Stderr = os.Stderr
 | 
				
			||||||
	return programCmd
 | 
						return programCmd
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Shell invokes shell commands to talk with a remote credentials helper.
 | 
					// Shell invokes shell commands to talk with a remote credentials-helper.
 | 
				
			||||||
type Shell struct {
 | 
					type Shell struct {
 | 
				
			||||||
	cmd *exec.Cmd
 | 
						cmd *exec.Cmd
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Output returns responses from the remote credentials helper.
 | 
					// Output returns responses from the remote credentials-helper.
 | 
				
			||||||
func (s *Shell) Output() ([]byte, error) {
 | 
					func (s *Shell) Output() ([]byte, error) {
 | 
				
			||||||
	return s.cmd.Output()
 | 
						return s.cmd.Output()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Input sets the input to send to a remote credentials helper.
 | 
					// Input sets the input to send to a remote credentials-helper.
 | 
				
			||||||
func (s *Shell) Input(in io.Reader) {
 | 
					func (s *Shell) Input(in io.Reader) {
 | 
				
			||||||
	s.cmd.Stdin = in
 | 
						s.cmd.Stdin = in
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										69
									
								
								vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										69
									
								
								vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -10,6 +10,20 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Action defines the name of an action (sub-command) supported by a
 | 
				
			||||||
 | 
					// credential-helper binary. It is an alias for "string", and mostly
 | 
				
			||||||
 | 
					// for convenience.
 | 
				
			||||||
 | 
					type Action = string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// List of actions (sub-commands) supported by credential-helper binaries.
 | 
				
			||||||
 | 
					const (
 | 
				
			||||||
 | 
						ActionStore   Action = "store"
 | 
				
			||||||
 | 
						ActionGet     Action = "get"
 | 
				
			||||||
 | 
						ActionErase   Action = "erase"
 | 
				
			||||||
 | 
						ActionList    Action = "list"
 | 
				
			||||||
 | 
						ActionVersion Action = "version"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Credentials holds the information shared between docker and the credentials store.
 | 
					// Credentials holds the information shared between docker and the credentials store.
 | 
				
			||||||
type Credentials struct {
 | 
					type Credentials struct {
 | 
				
			||||||
	ServerURL string
 | 
						ServerURL string
 | 
				
			||||||
@@ -43,42 +57,52 @@ func SetCredsLabel(label string) {
 | 
				
			|||||||
	CredsLabel = label
 | 
						CredsLabel = label
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Serve initializes the credentials helper and parses the action argument.
 | 
					// Serve initializes the credentials-helper and parses the action argument.
 | 
				
			||||||
// This function is designed to be called from a command line interface.
 | 
					// This function is designed to be called from a command line interface.
 | 
				
			||||||
// It uses os.Args[1] as the key for the action.
 | 
					// It uses os.Args[1] as the key for the action.
 | 
				
			||||||
// It uses os.Stdin as input and os.Stdout as output.
 | 
					// It uses os.Stdin as input and os.Stdout as output.
 | 
				
			||||||
// This function terminates the program with os.Exit(1) if there is an error.
 | 
					// This function terminates the program with os.Exit(1) if there is an error.
 | 
				
			||||||
func Serve(helper Helper) {
 | 
					func Serve(helper Helper) {
 | 
				
			||||||
	var err error
 | 
					 | 
				
			||||||
	if len(os.Args) != 2 {
 | 
						if len(os.Args) != 2 {
 | 
				
			||||||
		err = fmt.Errorf("Usage: %s <store|get|erase|list|version>", os.Args[0])
 | 
							_, _ = fmt.Fprintln(os.Stdout, usage())
 | 
				
			||||||
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err == nil {
 | 
						switch os.Args[1] {
 | 
				
			||||||
		err = HandleCommand(helper, os.Args[1], os.Stdin, os.Stdout)
 | 
						case "--version", "-v":
 | 
				
			||||||
 | 
							_ = PrintVersion(os.Stdout)
 | 
				
			||||||
 | 
							os.Exit(0)
 | 
				
			||||||
 | 
						case "--help", "-h":
 | 
				
			||||||
 | 
							_, _ = fmt.Fprintln(os.Stdout, usage())
 | 
				
			||||||
 | 
							os.Exit(0)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
						if err := HandleCommand(helper, os.Args[1], os.Stdin, os.Stdout); err != nil {
 | 
				
			||||||
		fmt.Fprintf(os.Stdout, "%v\n", err)
 | 
							_, _ = fmt.Fprintln(os.Stdout, err)
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// HandleCommand uses a helper and a key to run a credential action.
 | 
					func usage() string {
 | 
				
			||||||
func HandleCommand(helper Helper, key string, in io.Reader, out io.Writer) error {
 | 
						return fmt.Sprintf("Usage: %s <store|get|erase|list|version>", Name)
 | 
				
			||||||
	switch key {
 | 
					}
 | 
				
			||||||
	case "store":
 | 
					
 | 
				
			||||||
 | 
					// HandleCommand runs a helper to execute a credential action.
 | 
				
			||||||
 | 
					func HandleCommand(helper Helper, action Action, in io.Reader, out io.Writer) error {
 | 
				
			||||||
 | 
						switch action {
 | 
				
			||||||
 | 
						case ActionStore:
 | 
				
			||||||
		return Store(helper, in)
 | 
							return Store(helper, in)
 | 
				
			||||||
	case "get":
 | 
						case ActionGet:
 | 
				
			||||||
		return Get(helper, in, out)
 | 
							return Get(helper, in, out)
 | 
				
			||||||
	case "erase":
 | 
						case ActionErase:
 | 
				
			||||||
		return Erase(helper, in)
 | 
							return Erase(helper, in)
 | 
				
			||||||
	case "list":
 | 
						case ActionList:
 | 
				
			||||||
		return List(helper, out)
 | 
							return List(helper, out)
 | 
				
			||||||
	case "version":
 | 
						case ActionVersion:
 | 
				
			||||||
		return PrintVersion(out)
 | 
							return PrintVersion(out)
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							return fmt.Errorf("%s: unknown action: %s", Name, action)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return fmt.Errorf("Unknown credential action `%s`", key)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Store uses a helper and an input reader to save credentials.
 | 
					// Store uses a helper and an input reader to save credentials.
 | 
				
			||||||
@@ -132,18 +156,17 @@ func Get(helper Helper, reader io.Reader, writer io.Writer) error {
 | 
				
			|||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	resp := Credentials{
 | 
						buffer.Reset()
 | 
				
			||||||
 | 
						err = json.NewEncoder(buffer).Encode(Credentials{
 | 
				
			||||||
		ServerURL: serverURL,
 | 
							ServerURL: serverURL,
 | 
				
			||||||
		Username:  username,
 | 
							Username:  username,
 | 
				
			||||||
		Secret:    secret,
 | 
							Secret:    secret,
 | 
				
			||||||
	}
 | 
						})
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
	buffer.Reset()
 | 
					 | 
				
			||||||
	if err := json.NewEncoder(buffer).Encode(resp); err != nil {
 | 
					 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fmt.Fprint(writer, buffer.String())
 | 
						_, _ = fmt.Fprint(writer, buffer.String())
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -181,6 +204,6 @@ func List(helper Helper, writer io.Writer) error {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// PrintVersion outputs the current version.
 | 
					// PrintVersion outputs the current version.
 | 
				
			||||||
func PrintVersion(writer io.Writer) error {
 | 
					func PrintVersion(writer io.Writer) error {
 | 
				
			||||||
	fmt.Fprintf(writer, "%s (%s) %s\n", Name, Package, Version)
 | 
						_, _ = fmt.Fprintf(writer, "%s (%s) %s\n", Name, Package, Version)
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										31
									
								
								vendor/github.com/docker/docker-credential-helpers/credentials/error.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								vendor/github.com/docker/docker-credential-helpers/credentials/error.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,5 +1,7 @@
 | 
				
			|||||||
package credentials
 | 
					package credentials
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import "errors"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	// ErrCredentialsNotFound standardizes the not found error, so every helper returns
 | 
						// ErrCredentialsNotFound standardizes the not found error, so every helper returns
 | 
				
			||||||
	// the same message and docker can handle it properly.
 | 
						// the same message and docker can handle it properly.
 | 
				
			||||||
@@ -21,6 +23,11 @@ func (errCredentialsNotFound) Error() string {
 | 
				
			|||||||
	return errCredentialsNotFoundMessage
 | 
						return errCredentialsNotFoundMessage
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// NotFound implements the [ErrNotFound][errdefs.ErrNotFound] interface.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// [errdefs.ErrNotFound]: https://pkg.go.dev/github.com/docker/docker@v24.0.1+incompatible/errdefs#ErrNotFound
 | 
				
			||||||
 | 
					func (errCredentialsNotFound) NotFound() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewErrCredentialsNotFound creates a new error
 | 
					// NewErrCredentialsNotFound creates a new error
 | 
				
			||||||
// for when the credentials are not in the store.
 | 
					// for when the credentials are not in the store.
 | 
				
			||||||
func NewErrCredentialsNotFound() error {
 | 
					func NewErrCredentialsNotFound() error {
 | 
				
			||||||
@@ -30,8 +37,8 @@ func NewErrCredentialsNotFound() error {
 | 
				
			|||||||
// IsErrCredentialsNotFound returns true if the error
 | 
					// IsErrCredentialsNotFound returns true if the error
 | 
				
			||||||
// was caused by not having a set of credentials in a store.
 | 
					// was caused by not having a set of credentials in a store.
 | 
				
			||||||
func IsErrCredentialsNotFound(err error) bool {
 | 
					func IsErrCredentialsNotFound(err error) bool {
 | 
				
			||||||
	_, ok := err.(errCredentialsNotFound)
 | 
						var target errCredentialsNotFound
 | 
				
			||||||
	return ok
 | 
						return errors.As(err, &target)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// IsErrCredentialsNotFoundMessage returns true if the error
 | 
					// IsErrCredentialsNotFoundMessage returns true if the error
 | 
				
			||||||
@@ -53,6 +60,12 @@ func (errCredentialsMissingServerURL) Error() string {
 | 
				
			|||||||
	return errCredentialsMissingServerURLMessage
 | 
						return errCredentialsMissingServerURLMessage
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// InvalidParameter implements the [ErrInvalidParameter][errdefs.ErrInvalidParameter]
 | 
				
			||||||
 | 
					// interface.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// [errdefs.ErrInvalidParameter]: https://pkg.go.dev/github.com/docker/docker@v24.0.1+incompatible/errdefs#ErrInvalidParameter
 | 
				
			||||||
 | 
					func (errCredentialsMissingServerURL) InvalidParameter() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// errCredentialsMissingUsername represents an error raised
 | 
					// errCredentialsMissingUsername represents an error raised
 | 
				
			||||||
// when the credentials object has no username or when no
 | 
					// when the credentials object has no username or when no
 | 
				
			||||||
// username is provided to a credentials operation requiring
 | 
					// username is provided to a credentials operation requiring
 | 
				
			||||||
@@ -63,6 +76,12 @@ func (errCredentialsMissingUsername) Error() string {
 | 
				
			|||||||
	return errCredentialsMissingUsernameMessage
 | 
						return errCredentialsMissingUsernameMessage
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// InvalidParameter implements the [ErrInvalidParameter][errdefs.ErrInvalidParameter]
 | 
				
			||||||
 | 
					// interface.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// [errdefs.ErrInvalidParameter]: https://pkg.go.dev/github.com/docker/docker@v24.0.1+incompatible/errdefs#ErrInvalidParameter
 | 
				
			||||||
 | 
					func (errCredentialsMissingUsername) InvalidParameter() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// NewErrCredentialsMissingServerURL creates a new error for
 | 
					// NewErrCredentialsMissingServerURL creates a new error for
 | 
				
			||||||
// errCredentialsMissingServerURL.
 | 
					// errCredentialsMissingServerURL.
 | 
				
			||||||
func NewErrCredentialsMissingServerURL() error {
 | 
					func NewErrCredentialsMissingServerURL() error {
 | 
				
			||||||
@@ -78,8 +97,8 @@ func NewErrCredentialsMissingUsername() error {
 | 
				
			|||||||
// IsCredentialsMissingServerURL returns true if the error
 | 
					// IsCredentialsMissingServerURL returns true if the error
 | 
				
			||||||
// was an errCredentialsMissingServerURL.
 | 
					// was an errCredentialsMissingServerURL.
 | 
				
			||||||
func IsCredentialsMissingServerURL(err error) bool {
 | 
					func IsCredentialsMissingServerURL(err error) bool {
 | 
				
			||||||
	_, ok := err.(errCredentialsMissingServerURL)
 | 
						var target errCredentialsMissingServerURL
 | 
				
			||||||
	return ok
 | 
						return errors.As(err, &target)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// IsCredentialsMissingServerURLMessage checks for an
 | 
					// IsCredentialsMissingServerURLMessage checks for an
 | 
				
			||||||
@@ -91,8 +110,8 @@ func IsCredentialsMissingServerURLMessage(err string) bool {
 | 
				
			|||||||
// IsCredentialsMissingUsername returns true if the error
 | 
					// IsCredentialsMissingUsername returns true if the error
 | 
				
			||||||
// was an errCredentialsMissingUsername.
 | 
					// was an errCredentialsMissingUsername.
 | 
				
			||||||
func IsCredentialsMissingUsername(err error) bool {
 | 
					func IsCredentialsMissingUsername(err error) bool {
 | 
				
			||||||
	_, ok := err.(errCredentialsMissingUsername)
 | 
						var target errCredentialsMissingUsername
 | 
				
			||||||
	return ok
 | 
						return errors.As(err, &target)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// IsCredentialsMissingUsernameMessage checks for an
 | 
					// IsCredentialsMissingUsernameMessage checks for an
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							@@ -281,8 +281,8 @@ github.com/docker/docker/pkg/process
 | 
				
			|||||||
github.com/docker/docker/pkg/stdcopy
 | 
					github.com/docker/docker/pkg/stdcopy
 | 
				
			||||||
github.com/docker/docker/pkg/system
 | 
					github.com/docker/docker/pkg/system
 | 
				
			||||||
github.com/docker/docker/registry
 | 
					github.com/docker/docker/registry
 | 
				
			||||||
# github.com/docker/docker-credential-helpers v0.7.0
 | 
					# github.com/docker/docker-credential-helpers v0.8.0
 | 
				
			||||||
## explicit; go 1.18
 | 
					## explicit; go 1.19
 | 
				
			||||||
github.com/docker/docker-credential-helpers/client
 | 
					github.com/docker/docker-credential-helpers/client
 | 
				
			||||||
github.com/docker/docker-credential-helpers/credentials
 | 
					github.com/docker/docker-credential-helpers/credentials
 | 
				
			||||||
# github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c
 | 
					# github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user