dockerauth

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 9 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(log *logger.Logger) *DockerAuth

New creates a new DockerAuth instance.

func (*DockerAuth) CreatePullSecretYAMLFromCredentials

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

CreatePullSecretYAMLFromCredentials creates Kubernetes pull secret YAML from verified credentials.

func (*DockerAuth) GetAndVerifyCredentials

func (d *DockerAuth) GetAndVerifyCredentials() (*Credentials, error)

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

func (*DockerAuth) VerifyCredentials

func (d *DockerAuth) VerifyCredentials(username, password string) error

VerifyCredentials attempts to verify that the credentials work by making a request to the registry. This uses a read-only HTTP request. It mimics what the kubelet would do when pulling images.

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