dockerauth

package
v0.4.14-test2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthEntry

type AuthEntry struct {
	Auth string `json:"auth,omitempty"`
}

AuthEntry represents a single auth entry in Docker config.

type CredentialData

type CredentialData struct {
	Username string `json:"Username"`
	Secret   string `json:"Secret"`
}

CredentialData represents credential data from credential helper.

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials represents verified Docker credentials.

type DockerAuth

type DockerAuth struct {
	// contains filtered or unexported fields
}

DockerAuth handles Docker authentication and pull secret management.

func New

func New() *DockerAuth

New creates a new DockerAuth instance.

func (*DockerAuth) CreatePullSecretYAMLFromCredentials

func (d *DockerAuth) CreatePullSecretYAMLFromCredentials(creds Credentials, namespace, registry string) string

CreatePullSecretYAMLFromCredentials creates Kubernetes pull secret YAML from verified credentials, scoped to the host of the given image registry

func (*DockerAuth) GetAndVerifyCredentials

func (d *DockerAuth) GetAndVerifyCredentials(ctx context.Context, registry string) (*Credentials, error)

GetAndVerifyCredentials retrieves and verifies Docker credentials. This should be called early to fail fast if credentials are invalid.

func (*DockerAuth) RepositoryRequiresAuth added in v0.4.12

func (d *DockerAuth) RepositoryRequiresAuth(ctx context.Context, repository string) (bool, error)

RepositoryRequiresAuth makes a best-effort check for whether the given repository requires authentication, by sending a single anonymous tags-list request. Anything short of a confirmed successful response fails safe by reporting that auth is required, alongside an error explaining why the check was inconclusive.

type DockerConfig

type DockerConfig struct {
	Auths       map[string]AuthEntry `json:"auths,omitempty"`
	CredHelpers map[string]string    `json:"credHelpers,omitempty"`
	CredsStore  string               `json:"credsStore,omitempty"`
}

DockerConfig represents Docker configuration structure.

Jump to

Keyboard shortcuts

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