helper

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 19 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 {
	AuthorizationToken string
	RequestedAt        time.Time
	ExpiresAt          time.Time
	ProxyEndpoint      string
}

func (*AuthEntry) IsValid

func (authEntry *AuthEntry) IsValid(testTime time.Time) bool

IsValid checks if AuthEntry is still valid at testTime. AuthEntries expire at 1/2 of their original requested window.

type CredentialsCache

type CredentialsCache interface {
	Get(registry string) *AuthEntry
	Set(registry string, entry *AuthEntry)
	List() []*AuthEntry
	Clear()
}

func BuildCredentialsCache

func BuildCredentialsCache(region string) CredentialsCache

func NewFileCredentialsCache

func NewFileCredentialsCache(path string, filename string, cachePrefixKey string) CredentialsCache

NewFileCredentialsCache returns a new file credentials cache.

path is used for temporary files during save, and filename should be a relative filename in the same directory where the cache is serialized and deserialized.

cachePrefixKey is used for scoping credentials for a given credential cache (i.e. region and accessKey).

type PorterHelper

type PorterHelper struct {
	Debug bool
	// contains filtered or unexported fields
}

PorterHelper implements credentials.Helper: it acts as a credentials helper for Docker that allows authentication with different registries.

func (*PorterHelper) Add

Add appends credentials to the store.

func (*PorterHelper) Delete

func (p *PorterHelper) Delete(serverURL string) error

Delete removes credentials from the store.

func (*PorterHelper) Get

func (p *PorterHelper) Get(serverURL string) (user string, secret string, err error)

Get retrieves credentials from the store. It returns username and secret as strings.

func (*PorterHelper) List

func (p *PorterHelper) List() (map[string]string, error)

List returns the stored serverURLs and their associated usernames.

type RegistryCache

type RegistryCache struct {
	Registries map[string]*AuthEntry
	Version    string
}

Jump to

Keyboard shortcuts

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