Documentation ¶
Overview ¶
Package secret provides a layer for storing secretes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when a secret is not found. ErrNotFound = errors.New("secret not found") // ErrKeyringUnsupported indicates that secure storage // via the system keychain is not supported on the current platform. ErrKeyringUnsupported = keyring.ErrUnsupportedPlatform )
Functions ¶
This section is empty.
Types ¶
type Keyring ¶
type Keyring struct{}
Keyring is a secure secret store that uses the system's keychain if available.
Its zero value is ready for use.
func (*Keyring) DeleteSecret ¶
DeleteSecret deletes a secret from the keyring.
func (*Keyring) LoadSecret ¶
LoadSecret loads a secret from the keyring.
func (*Keyring) SaveSecret ¶
SaveSecret saves a secret in the keyring.
type MemoryStash ¶
type MemoryStash struct {
// contains filtered or unexported fields
}
MemoryStash is an in-memory secret store for testing. Its zero value is ready for use.
func (*MemoryStash) DeleteSecret ¶
func (m *MemoryStash) DeleteSecret(service string, key string) error
DeleteSecret deletes a secret from the memory stash.
func (*MemoryStash) LoadSecret ¶
func (m *MemoryStash) LoadSecret(service string, key string) (string, error)
LoadSecret loads a secret from the memory stash.
func (*MemoryStash) SaveSecret ¶
func (m *MemoryStash) SaveSecret(service string, key string, secret string) error
SaveSecret saves a secret in the memory stash.
type Stash ¶
type Stash interface { SaveSecret(service, key, secret string) error LoadSecret(service, key string) (string, error) // DeleteSecret deletes a secret from the stash. // It is a no-op if the secret does not exist. DeleteSecret(service, key string) error }
Stash stores and retrieves secrets.
Directories ¶
Path | Synopsis |
---|---|
Package secrettest provides a cross-process testable secret.Stash.
|
Package secrettest provides a cross-process testable secret.Stash. |
Click to show internal directories.
Click to hide internal directories.