Documentation ¶
Index ¶
- Constants
- func Builder(_ context.Context, c any) (secrets.Keeper, error)
- type Config
- type Keepass
- func (k *Keepass) CopySecret(ctx context.Context, id, grp string) (secrets.Secret, error)
- func (k *Keepass) DeleteSecret(ctx context.Context, id string) error
- func (k *Keepass) GetSecret(ctx context.Context, id string) (secrets.Secret, error)
- func (k *Keepass) GetSecretsByName(ctx context.Context, name string) ([]secrets.Secret, error)
- func (k *Keepass) ListLocations(ctx context.Context) ([]string, error)
- func (k *Keepass) ListSecrets(ctx context.Context, folder string) ([]string, error)
- func (k *Keepass) MoveSecret(ctx context.Context, id, grp string) (secrets.Secret, error)
- func (k *Keepass) SetSecret(ctx context.Context, secret secrets.Secret) (secrets.Secret, error)
- func (k *Keepass) Walker(walkEntries bool) *KeepassWalker
- type KeepassWalker
- type Secret
- func (s *Secret) DeleteField(key string)
- func (s *Secret) Fields() map[string]string
- func (s *Secret) GetField(key string) string
- func (s *Secret) ID() string
- func (s *Secret) LastModified() time.Time
- func (s *Secret) Location() string
- func (s *Secret) Name() string
- func (s *Secret) Password() string
- func (s *Secret) SetField(key, value string)
- func (s *Secret) SetLocation(loc string)
- func (s *Secret) SetName(name string)
- func (s *Secret) SetPassword(secret string)
- func (s *Secret) SetType(typ string)
- func (s *Secret) SetUrl(u *url.URL)
- func (s *Secret) SetUsername(username string)
- func (s *Secret) Type() string
- func (s *Secret) Url() *url.URL
- func (s *Secret) Username() string
Constants ¶
const ConfigType = "keepass"
ConfigType is the name of the config type for the Keepass secret keeper.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // Path is the path to the Keepass database. Path string `mapstructure:"path" yaml:"path"` // Master is the master password to use to unlock the Keepass database. Master string `mapstructure:"master_password" yaml:"master_password"` }
Config is the configuration for the Keepass secret keeper.
type Keepass ¶
type Keepass struct { fssafe.LoaderSaver // contains filtered or unexported fields }
Keepass is a Keeper with access to a Keepass password database.
func NewKeepass ¶
NewKeepass creates a new Keepass Keeper and returns it. If no database exists yet, it will create an empty one. It returns an error if there's a problem reading the Keepass database.
func NewKeepassNoVerify ¶
NewKeepassNoVerify creates a new Keepass Keeper and returns it. It does not attempt to read the database or verify it is setup correctly.
func (*Keepass) CopySecret ¶
CopySecret copies the secret into an additional group in the Keepass database.
func (*Keepass) DeleteSecret ¶
DeleteSecret removes the secret from the Keepass database.
func (*Keepass) GetSecretsByName ¶
GetSecretsByName retrieves all secrets with the given name from the Keepass database.
func (*Keepass) ListLocations ¶
ListLocations gets all the group names from the Keepass database. Groups are hierarchical in the Keepass database. Each location is returned as path fully qualified path.
func (*Keepass) ListSecrets ¶
ListSecrets gets the names of all secrets in the named location.
func (*Keepass) MoveSecret ¶
MoveSecret moves the secret into a different group in the Keepass database.
func (*Keepass) Walker ¶
func (k *Keepass) Walker(walkEntries bool) *KeepassWalker
Walker creates an iterator for walking through the Keepass database records.
type KeepassWalker ¶
type KeepassWalker struct {
// contains filtered or unexported fields
}
KeepassWalker represents a tool for walking Keepass records.
func (*KeepassWalker) Dir ¶
func (w *KeepassWalker) Dir() string
Dir retrieves the name of the location of the current group as a path.
func (*KeepassWalker) Entry ¶
func (w *KeepassWalker) Entry() *keepass.Entry
Entry retrieves the current entry to inspect during iteration.
func (*KeepassWalker) Group ¶
func (w *KeepassWalker) Group() *keepass.Group
Group retrieves the current group to inspect during iteration.
func (*KeepassWalker) Next ¶
func (w *KeepassWalker) Next() bool
Next returns the next record for iteration. If walkEntries was set to true, this will return true if another entry is found in the tree. Otherwise, this will return false if another group is found in the tree. Returns false if no records are left for iteration.
type Secret ¶
type Secret struct {
// contains filtered or unexported fields
}
Secret is a secrets.Secret implementation that wraps a keepass.Entry.
func (*Secret) DeleteField ¶
DeleteField removes the field with the given key.
func (*Secret) LastModified ¶
LastModified returns the last modification time of the Keepass entry.
func (*Secret) SetLocation ¶
SetLocation sets the location of the full path of the secret.
func (*Secret) SetPassword ¶
SetPassword sets the Password of the Keepass entry.
func (*Secret) SetUsername ¶
SetUsername sets the Username of the Keepass entry.