auth

package
v2.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTransport http.RoundTripper = &http.Transport{
	Proxy: http.ProxyFromEnvironment,
	DialContext: (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}).DialContext,
	MaxIdleConns:          100,
	IdleConnTimeout:       10 * time.Second,
	TLSHandshakeTimeout:   10 * time.Second,
	ExpectContinueTimeout: 1 * time.Second,
}

DefaultTransport is a custom implementation of the DefaultTransport. It limits the IdleConnTimeout to 10 seconds instead of 90 seconds.

from "net/http/transport.go"

View Source
var ErrCannotUpdateIdleConnTimeout = errors.New("cannot update transport")

ErrCannotUpdateIdleConnTimeout is an error returned when the Transport is unable to be updated.

Functions

func NewAuthError

func NewAuthError(reason string, imageName reference.Named) error

NewAuthError returns an AuthError struct with the reason for erroring, as well as the Name of the image reference

func UpdateIdleConnectionsTimeout

func UpdateIdleConnectionsTimeout(client *http.Client) error

UpdateIdleConnectionsTimeout limits the default timeout for idle connections to 10 seconds. If the OAuth2 transport is nil, redefine it with our own DefaultTransport. This should limit the number of idle connections left open after the initial requests are made, which in turn should reduce the chances of the number of available connections being depleted.

Types

type Error

type Error struct {
	Reason    string
	ImageName reference.Named
}

Error is the error returned when authenticating while pulling manifests connecting to protected systems

func (*Error) Error

func (e *Error) Error() string

Error returns a string for logging purposes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL