Documentation ¶
Index ¶
- func FromBrowser(username string, isAuthorized chan bool, done chan bool) (string, string, error)
- func FromTerminal(username string) (string, string, error)
- type CelleryCredReader
- type CredManager
- type CredReader
- type FileCredentialsManager
- func (credManager FileCredentialsManager) GetCredentials(registry string) (*RegistryCredentials, error)
- func (credManager FileCredentialsManager) HasCredentials(registry string) (bool, error)
- func (credManager FileCredentialsManager) RemoveCredentials(registry string) error
- func (credManager FileCredentialsManager) StoreCredentials(credentials *RegistryCredentials) error
- type KeyringCredManager
- func (credManager KeyringCredManager) GetCredentials(registry string) (*RegistryCredentials, error)
- func (credManager KeyringCredManager) HasCredentials(registry string) (bool, error)
- func (credManager KeyringCredManager) RemoveCredentials(registry string) error
- func (credManager KeyringCredManager) StoreCredentials(credentials *RegistryCredentials) error
- type RegistryCredentials
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromBrowser ¶ added in v0.3.0
FromBrowser requests the credentials from the user
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 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 ¶
RegistryCredentials holds the credentials of a registry