Documentation ¶
Index ¶
- Variables
- func EntrySortNameAsc(entries []*api.SecretEntry)
- type Autolocker
- type IDSet
- func (c IDSet) Add(id string)
- func (c IDSet) AddAll(ids []string)
- func (c IDSet) Contains(id string) bool
- func (c IDSet) Equals(other IDSet) bool
- func (c IDSet) MarshalJSON() ([]byte, error)
- func (c IDSet) Remove(id string)
- func (c IDSet) String() string
- func (c *IDSet) UnmarshalJSON(data []byte) error
- type SecretBlock
- type Secrets
Constants ¶
This section is empty.
Variables ¶
var ErrSecretNotFound = errors.New("Secret not found")
ErrSecretNotFound occurs if a secret could not be found
var ErrSecretsLocked = errors.New("Secrets are locked")
ErrSecretsLocked occurs if the secret store is locked
Functions ¶
func EntrySortNameAsc ¶
func EntrySortNameAsc(entries []*api.SecretEntry)
Types ¶
type Autolocker ¶
type Autolocker struct {
// contains filtered or unexported fields
}
Autolocker is a helper to automatically lock the secrets store after a given timeout. The timeout can be set to hard-mode so that the the store will be locked no matter what.
func NewAutolocker ¶
func NewAutolocker(secrets Secrets, timeout time.Duration, hardTimeout bool) *Autolocker
NewAutolocker creates a new Autolocker
func (*Autolocker) Cancel ¶
func (a *Autolocker) Cancel()
Cancel the autolock timeout (usually because the store has been manually locked)
func (*Autolocker) GetAutolockAt ¶
func (a *Autolocker) GetAutolockAt() time.Time
GetAutolockAt gets the current autolock timestamp
func (*Autolocker) Reset ¶
func (a *Autolocker) Reset()
Reset the timeout (will be ignored if timeout is hard-mode)
func (*Autolocker) Start ¶
func (a *Autolocker) Start()
Start the autolock timeout (usually after an unlock)
type IDSet ¶
IDSet is a helper to handie a set of generic ids
func (IDSet) MarshalJSON ¶
MarshalJSON creates a json array of the set
func (*IDSet) UnmarshalJSON ¶
UnmarshalJSON reads the set from a json array
type SecretBlock ¶
type SecretBlock struct { ID string `json:"id"` Type api.SecretType `json:"type"` Version api.SecretVersion `json:"version"` }
SecretBlock represents a block containing the version of a secret. This is what actually has to be encrypted and stored to the underlying store implementation.
type Secrets ¶
type Secrets interface { // Status gets the current status of the store. Status(ctx context.Context) (*api.Status, error) // Lock the store Lock(ctx context.Context) error // Unlock the store for a given identity Unlock(ctx context.Context, name, email, passphrase string) error // List all identities that have access to the store Identities(ctx context.Context) ([]api.Identity, error) // List all secrets of the store (only references) List(ctx context.Context, filter api.SecretListFilter) (*api.SecretList, error) // Add a secret to the store Add(ctx context.Context, id string, secretType api.SecretType, version api.SecretVersion) error // Get a secret from the store Get(ctx context.Context, secretID string) (*api.Secret, error) // EstimateStrength of a passwrd EstimateStrength(ctx context.Context, estimate api.PasswordEstimate) (*api.PasswordStrength, error) // GeneratePassword generates a password GeneratePassword(ctx context.Context, parameter api.GenerateParameter) (string, error) }
Secrets is the interface to any secret store implementation