dockerhub

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ProviderName is the name of the Docker Hub authentication provider.
	ProviderName = "dockerhub"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Token     string
	ExpiresAt time.Time
}

AccessToken is a Docker Hub access token obtained by exchanging an OIDC identity.

func (*AccessToken) GetDuration

func (a *AccessToken) GetDuration() time.Duration

GetDuration implements auth.Credential.

type Implementation

type Implementation interface {
	ExchangeToken(ctx context.Context, client *http.Client, endpoint string, form url.Values) (*http.Response, error)
}

Implementation performs the Docker Hub HTTP exchange. It exists so tests can substitute the transport layer.

type Provider

type Provider struct{ Implementation }

Provider implements auth.ArtifactRegistryCredentialsProvider for Docker Hub OIDC connections. It exchanges an OIDC identity for a short-lived Docker Hub access token; it does not support controller, Git, or REST config credentials.

func (Provider) GetAccessCredentialOptionsForArtifactRepository

func (Provider) GetAccessCredentialOptionsForArtifactRepository(artifactRepository string,
	_ ...auth.Option) ([]auth.Option, error)

GetAccessCredentialOptionsForArtifactRepository implements auth.ArtifactRegistryCredentialsProvider. It pins the OIDC audience to the identity endpoint matching the registry host.

func (Provider) GetAudiences

func (Provider) GetAudiences(_ context.Context, opts ...auth.Option) ([]string, error)

GetAudiences implements auth.Provider.

func (Provider) GetIdentity

func (Provider) GetIdentity(opts ...auth.Option) (string, error)

GetIdentity implements auth.Provider. The connection ID scopes cached credentials to the Docker Hub OIDC connection that issued them.

func (Provider) GetName

func (Provider) GetName() string

GetName implements auth.Provider.

func (Provider) NewAccessCredentialForIdentity

func (p Provider) NewAccessCredentialForIdentity(ctx context.Context, identity auth.Credential,
	opts ...auth.Option) (auth.Credential, error)

NewAccessCredentialForIdentity implements auth.Provider. It exchanges the supplied JWT identity for a Docker Hub access token.

func (Provider) NewArtifactRegistryCredentials

func (Provider) NewArtifactRegistryCredentials(_ context.Context, _ string,
	accessCredential auth.Credential, opts ...auth.Option) (*auth.ArtifactRegistryCredentials, error)

NewArtifactRegistryCredentials implements auth.ArtifactRegistryCredentialsProvider.

func (Provider) NewControllerToken

func (Provider) NewControllerToken(context.Context, ...auth.Option) (auth.Credential, error)

NewControllerToken implements auth.Provider. Docker Hub OIDC has no ambient controller identity: credentials must be obtained by exchanging a workload identity.

func (Provider) ParseArtifactRepository

func (Provider) ParseArtifactRepository(artifactRepository string) (string, error)

ParseArtifactRepository implements auth.ArtifactRegistryCredentialsProvider.

Jump to

Keyboard shortcuts

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