credentials

package
v2.0.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: MIT Imports: 3 Imported by: 169

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CredsLabel = "saml2aws Credentials"

CredsLabel saml2aws credentials should be labeled as such in credentials stores that allow labelling. That label allows to filter out non-Docker credentials too at lookup/search in macOS keychain, Windows credentials manager and Linux libsecret. Default value is "saml2aws Credentials"

Functions

func IsErrCredentialsNotFound

func IsErrCredentialsNotFound(err error) bool

IsErrCredentialsNotFound returns true if the error was caused by not having a set of credentials in a store.

func LookupCredentials

func LookupCredentials(loginDetails *creds.LoginDetails) error

LookupCredentials lookup an existing set of credentials and validate it.

func SaveCredentials

func SaveCredentials(url, username, password string) error

SaveCredentials save the user credentials.

Types

type Credentials

type Credentials struct {
	ServerURL string
	Username  string
	Secret    string
}

Credentials holds the information shared between saml2aws and the credentials store.

type Helper

type Helper interface {
	// Add appends credentials to the store.
	Add(*Credentials) error
	// Delete removes credentials from the store.
	Delete(serverURL string) error
	// Get retrieves credentials from the store.
	// It returns username and secret as strings.
	Get(serverURL string) (string, string, error)
	// List returns the stored serverURLs and their associated usernames.
	List() (map[string]string, error)
}

Helper is the interface a credentials store helper must implement.

var (
	// CurrentHelper the currently configured credentials helper
	CurrentHelper Helper = &defaultHelper{}

	// ErrCredentialsNotFound returned when the credential can't be located in the native store.
	ErrCredentialsNotFound = errors.New("credentials not found in native keychain")
)

Jump to

Keyboard shortcuts

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