Documentation ¶
Overview ¶
Package passwordpersist manages password persistence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPasswordNotFound = errors.Errorf("password not found")
ErrPasswordNotFound is returned when a password cannot be found in a persistent storage.
View Source
var ErrUnsupported = errors.Errorf("password storage not supported")
ErrUnsupported is returned when a password storage is not supported.
Functions ¶
Types ¶
type Multiple ¶
type Multiple []Strategy
Multiple is a Strategy that tries several underlying persistence strategies.
func (Multiple) DeletePassword ¶
DeletePassword deletes the password from all persistent storages.
func (Multiple) GetPassword ¶
GetPassword retrieves the password form the first password storage that has it.
type Strategy ¶
type Strategy interface { // GetPassword gets persisted password, returns ErrNotFound or fatal errors. GetPassword(ctx context.Context, configFile string) (string, error) // PersistPassword persists a password, returns ErrUnsupported or fatal errors. PersistPassword(ctx context.Context, configFile, password string) error // DeletePassword deletes any persisted password, returns fatal errors. DeletePassword(ctx context.Context, configFile string) error }
Strategy encapsulates persisting and fetching passwords.
func File ¶
func File() Strategy
File is a Strategy that persists the base64-encoded password in a file next to repository config file.
Click to show internal directories.
Click to hide internal directories.