login

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImageRegistryProvider

func ImageRegistryProvider(url string, ref name.Reference) oci.Provider

ImageRegistryProvider analyzes the provided registry and returns the identified container image registry provider.

Types

type Manager

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

Manager is a login manager for various registry providers.

func NewManager

func NewManager(opts ...Option) *Manager

NewManager initializes a Manager with default registry clients configurations.

func (*Manager) Login

Login performs authentication against a registry and returns the Authenticator. For generic registry provider, it is no-op.

func (*Manager) LoginWithExpiry added in v0.42.0

func (m *Manager) LoginWithExpiry(ctx context.Context, url string, ref name.Reference, opts ProviderOptions) (authn.Authenticator, time.Time, error)

LoginWithExpiry performs authentication against a registry and returns the Authenticator along with the auth expiry time. For generic registry provider, it is no-op.

func (*Manager) OIDCLogin deprecated added in v0.27.0

func (m *Manager) OIDCLogin(ctx context.Context, registryURL string, opts ProviderOptions) (authn.Authenticator, error)

OIDCLogin attempts to get an Authenticator for the provided URL endpoint.

If you want to construct an Authenticator based on an image reference, you may want to use Login instead.

Deprecated: Use Login instead.

func (*Manager) WithACRClient

func (m *Manager) WithACRClient(c *azure.Client) *Manager

WithACRClient allows overriding the default ACR client.

func (*Manager) WithECRClient

func (m *Manager) WithECRClient(c *aws.Client) *Manager

WithECRClient allows overriding the default ECR client.

func (*Manager) WithGCRClient

func (m *Manager) WithGCRClient(c *gcp.Client) *Manager

WithGCRClient allows overriding the default GCR client.

type Option added in v0.41.0

type Option func(*options)

Option is a functional option for configuring the manager.

func WithProxyURL added in v0.41.0

func WithProxyURL(proxyURL *url.URL) Option

WithProxyURL sets the proxy URL for the manager.

type ProviderOptions

type ProviderOptions struct {
	// AwsAutoLogin enables automatic attempt to get credentials for images in
	// ECR.
	AwsAutoLogin bool
	// GcpAutoLogin enables automatic attempt to get credentials for images in
	// GCP.
	GcpAutoLogin bool
	// AzureAutoLogin enables automatic attempt to get credentials for images in
	// ACR.
	AzureAutoLogin bool
}

ProviderOptions contains options for registry provider login.

Jump to

Keyboard shortcuts

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