credentials

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBrowser added in v0.3.0

func FromBrowser(username string, isAuthorized chan bool, done chan bool) (string, string, error)

FromBrowser requests the credentials from the user

func FromTerminal added in v0.3.0

func FromTerminal(username string) (string, string, error)

FromTerminal is to allow this login flow to work in headless mode

Types

type CelleryCredReader added in v0.6.0

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

func NewCelleryCredReader added in v0.6.0

func NewCelleryCredReader(opts ...func(*CelleryCredReader)) *CelleryCredReader

NewCelleryCredReader returns a CelleryCredReader instance.

func (*CelleryCredReader) Read added in v0.6.0

func (celleryCredReader *CelleryCredReader) Read() (string, string, error)

func (*CelleryCredReader) SetRegistry added in v0.6.0

func (celleryCredReader *CelleryCredReader) SetRegistry(registry string)

func (*CelleryCredReader) SetUserName added in v0.6.0

func (celleryCredReader *CelleryCredReader) SetUserName(username string)

func (*CelleryCredReader) Shutdown added in v0.6.0

func (celleryCredReader *CelleryCredReader) Shutdown(authorized bool)

type CredManager

type CredManager interface {
	// StoreCredentials stores the credentials in the relevant credentials store. The Registry field of the credentials
	// struct is required for this operation
	StoreCredentials(credentials *RegistryCredentials) error

	// GetCredentials retrieves the credentials from the relevant credentials store
	GetCredentials(registry string) (*RegistryCredentials, error)

	// RemoveCredentials removes the credentials from the relevant credentials store
	RemoveCredentials(registry string) error

	// HasCredentials checks whether the credentials are currently stored in the relevant credentials store
	HasCredentials(registry string) (bool, error)
}

CredManager interface which defines the behaviour of all the credential managers.

func NewCredManager

func NewCredManager() (CredManager, error)

NewCredManager creates a new credentials manager instance

type CredReader added in v0.6.0

type CredReader interface {
	SetRegistry(registry string)
	SetUserName(username string)
	Read() (string, string, error)
	Shutdown(authorized bool)
}

type FileCredentialsManager

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

FileCredentialsManager manages the credentials in credentials file

func NewFileCredentialsManager

func NewFileCredentialsManager() (*FileCredentialsManager, error)

NewFileCredentialsManager creates a new File based Credentials Manager

func (FileCredentialsManager) GetCredentials

func (credManager FileCredentialsManager) GetCredentials(registry string) (*RegistryCredentials, error)

GetCredentials retrieves the credentials from the credentials file

func (FileCredentialsManager) HasCredentials

func (credManager FileCredentialsManager) HasCredentials(registry string) (bool, error)

IsRegistryPresent checks if the registry credentials exists in the credentials file

func (FileCredentialsManager) RemoveCredentials

func (credManager FileCredentialsManager) RemoveCredentials(registry string) error

RemoveCredentials removes the stored credentials from the credentials file

func (FileCredentialsManager) StoreCredentials

func (credManager FileCredentialsManager) StoreCredentials(credentials *RegistryCredentials) error

StoreCredentials stores the credentials in credentials file

type KeyringCredManager

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

KeyringCredManager holds the core of the KeyringCredManager which can be used to store the registry credentials in the native keyring

func NewKeyringCredManager

func NewKeyringCredManager() (*KeyringCredManager, error)

NewKeyringCredManager creates a new native keyring based credentials manager

func (KeyringCredManager) GetCredentials

func (credManager KeyringCredManager) GetCredentials(registry string) (*RegistryCredentials, error)

GetCredentials retrieves the previous stored credentials from the keyring

func (KeyringCredManager) HasCredentials

func (credManager KeyringCredManager) HasCredentials(registry string) (bool, error)

IsRegistryPresent checks if the registry (key in the keyring) exists

func (KeyringCredManager) RemoveCredentials

func (credManager KeyringCredManager) RemoveCredentials(registry string) error

RemoveCredentials removes the stored credentials from the keyring

func (KeyringCredManager) StoreCredentials

func (credManager KeyringCredManager) StoreCredentials(credentials *RegistryCredentials) error

StoreCredentials stores the credentials in the native keyring

type RegistryCredentials

type RegistryCredentials struct {
	Registry string
	Username string
	Password string
}

RegistryCredentials holds the credentials of a registry

Jump to

Keyboard shortcuts

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