package authprovider

import "github.com/moby/buildkit/session/auth/authprovider"

Index

Constants

const (
	DockerHubConfigfileKey = "https://index.docker.io/v1/"
	DockerHubRegistryHost  = "registry-1.docker.io"
)

Functions

func NewDockerAuthProvider

func NewDockerAuthProvider(cfg DockerAuthProviderConfig) session.Attachable

Types

type AuthConfigProvider

type AuthConfigProvider func(ctx context.Context, host string, scope []string, cacheCheck ExpireCachedAuthCheck) (types.AuthConfig, error)

func LoadAuthConfig

func LoadAuthConfig(config *configfile.ConfigFile) AuthConfigProvider

type AuthTLSConfig

type AuthTLSConfig struct {
	RootCAs  []string
	Insecure bool
	KeyPairs []TLSKeyPair
}

type DockerAuthProviderConfig

type DockerAuthProviderConfig struct {
	// AuthConfigProvider is a function that provides auth config for a given host and scope
	AuthConfigProvider AuthConfigProvider
	// TLSConfigs is a map of host to TLS config
	TLSConfigs map[string]*AuthTLSConfig
	// ExpireCachedAuth is a function that returns true auth config should be refreshed
	// instead of using a pre-cached result.
	// If nil then the cached result will expire after 4 minutes and 50 seconds.
	// The function is called with the time the cached auth config was created
	// and the server URL the auth config is for.
	ExpireCachedAuth ExpireCachedAuthCheck
}

type ExpireCachedAuthCheck

type ExpireCachedAuthCheck func(created time.Time, serverURL string) bool

type TLSKeyPair

type TLSKeyPair struct {
	Key         string
	Certificate string
}

Source Files

authconfig.go authconfigprovider.go authprovider.go tokenseed.go

Version
v0.27.1
Published
Jan 28, 2026
Platform
linux/amd64
Imports
35 packages
Last checked
19 minutes ago

Tools for package owners.