Documentation ¶
Index ¶
- Variables
- func NewRetryRepository(repo distribution.Repository, retries int, interval time.Duration) distribution.Repository
- type AuthHandlersFunc
- type BasicCredentials
- type Context
- func (c *Context) Repository(ctx context.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)
- func (c *Context) WithActions(actions ...string) *Context
- func (c *Context) WithCredentials(credentials auth.CredentialStore) *Context
- func (c *Context) WithScopes(scopes ...auth.Scope) *Context
- type ErrNotV2Registry
- type RefreshTokenStore
- type RepositoryRetriever
- type SecretCredentialStore
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NoCredentials auth.CredentialStore = &noopCredentialStore{}
)
Functions ¶
func NewRetryRepository ¶
func NewRetryRepository(repo distribution.Repository, retries int, interval time.Duration) distribution.Repository
NewRetryRepository wraps a distribution.Repository with helpers that will retry authentication failures over a limited time window and duration. This primarily avoids a DockerHub issue where public images unexpectedly return a 401 error due to the JWT token created by the hub being created at the same second, but another server being in the previous second.
Types ¶
type AuthHandlersFunc ¶
type AuthHandlersFunc func(transport http.RoundTripper, registry *url.URL, repoName string) []auth.AuthenticationHandler
type BasicCredentials ¶
type BasicCredentials struct {
// contains filtered or unexported fields
}
func NewBasicCredentials ¶
func NewBasicCredentials() *BasicCredentials
func (*BasicCredentials) Add ¶
func (c *BasicCredentials) Add(url *url.URL, username, password string)
func (BasicCredentials) RefreshToken ¶
type Context ¶
type Context struct { Transport http.RoundTripper InsecureTransport http.RoundTripper Challenges challenge.Manager Scopes []auth.Scope Actions []string Retries int Credentials auth.CredentialStore RequestModifiers []transport.RequestModifier // contains filtered or unexported fields }
func NewContext ¶
func NewContext(transport, insecureTransport http.RoundTripper, modifiers ...transport.RequestModifier) *Context
NewContext is capable of creating RepositoryRetrievers.
func (*Context) Repository ¶
func (c *Context) Repository(ctx context.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error)
func (*Context) WithActions ¶
func (*Context) WithCredentials ¶
func (c *Context) WithCredentials(credentials auth.CredentialStore) *Context
type ErrNotV2Registry ¶
type ErrNotV2Registry struct {
Registry string
}
ErrNotV2Registry is returned when the server does not report itself as a V2 Docker registry
func (*ErrNotV2Registry) Error ¶
func (e *ErrNotV2Registry) Error() string
type RefreshTokenStore ¶
type RefreshTokenStore interface { RefreshToken(url *url.URL, service string) string SetRefreshToken(url *url.URL, service string, token string) }
func NewRefreshTokenStore ¶
func NewRefreshTokenStore() RefreshTokenStore
type RepositoryRetriever ¶
type RepositoryRetriever interface { // Repository returns a properly authenticated distribution.Repository for the given registry, repository // name, and insecure toleration behavior. Repository(ctx context.Context, registry *url.URL, repoName string, insecure bool) (distribution.Repository, error) }
RepositoryRetriever fetches a Docker distribution.Repository.
type SecretCredentialStore ¶
type SecretCredentialStore struct { RefreshTokenStore // contains filtered or unexported fields }
func NewCredentialsForSecrets ¶
func NewCredentialsForSecrets(secrets []corev1.Secret) *SecretCredentialStore
func NewLazyCredentialsForSecrets ¶
func NewLazyCredentialsForSecrets(secretsFn func() ([]corev1.Secret, error)) *SecretCredentialStore
func (*SecretCredentialStore) Basic ¶
func (s *SecretCredentialStore) Basic(url *url.URL) (string, string)
func (*SecretCredentialStore) Err ¶
func (s *SecretCredentialStore) Err() error
Click to show internal directories.
Click to hide internal directories.