enpass

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Major  = "0"
	Minor  = "5"
	Patch  = "3"
	Suffix = "dev"
)

Functions

func DetermineVaultPath added in v0.5.0

func DetermineVaultPath(logger *logrus.Logger, vaultPathFlag string) (vaultPath string)

DetermineVaultPath : Try to programatically determine the vault path based on the default path value

func InitializeStore added in v0.4.4

func InitializeStore(logger *logrus.Logger, vaultPath string, nonInteractive bool) *unlock.SecureStore

func OpenVault added in v0.4.4

func OpenVault(logger *logrus.Logger, pinEnable bool, nonInteractive bool, vaultPath string, keyFilePath string, logLevel logrus.Level, nocolorFlag bool) (vault *Vault, credentials *VaultCredentials, err error)

func QuoteList added in v0.1.3

func QuoteList(items []string) string

QuoteList - quote a list for use in a database IN clause

func Version added in v0.1.3

func Version(prefix, suffix, versionFull bool) string

Version returns a version string based on the SemVer parts defined at compile time. Dev builds will result in 0.0.0-dev. Prefix (v) and suffix can be optionally included, while suffix will only be included if one is defined.

Types

type Card

type Card struct {
	// plaintext
	UUID           string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
	CreatedAt      int64  `json:"created,omitempty" yaml:"created,omitempty"`
	Type           string `json:"card_type,omitempty" yaml:"card_type,omitempty"`
	UpdatedAt      int64  `json:"updated,omitempty" yaml:"updated,omitempty"`
	Title          string `json:"title,omitempty" yaml:"title,omitempty"`
	Subtitle       string `json:"subtitle,omitempty" yaml:"subtitle,omitempty"`
	Note           string `json:"note,omitempty" yaml:"note,omitempty"`
	Trashed        int64  `json:"trashed,omitempty" yaml:"trashed,omitempty"`
	Deleted        int64  `json:"deleted,omitempty" yaml:"deleted,omitempty"`
	Category       string `json:"category,omitempty" yaml:"category,omitempty"`
	Label          string `json:"label,omitempty" yaml:"label,omitempty"`
	LastUsed       int64  `json:"last_used,omitempty" yaml:"last_used,omitempty"`
	Sensitive      bool   `json:"sensitive,omitempty" yaml:"sensitive,omitempty"`
	Icon           string `json:"icon,omitempty" yaml:"icon,omitempty"`
	DecryptedValue string `json:"decrypted_value,omitempty" yaml:"decrypted_value,omitempty"`

	// encrypted
	RawValue string `json:"raw_value,omitempty" yaml:"raw_value,omitempty"`
	Key      []byte `json:"key,omitempty" yaml:"key,omitempty"`
}

func (*Card) Decrypt

func (c *Card) Decrypt() error

func (*Card) IsDeleted

func (c *Card) IsDeleted() bool

func (*Card) IsTrashed

func (c *Card) IsTrashed() bool

func (Card) TableName added in v0.4.1

func (Card) TableName() string

type Keyfile

type Keyfile struct {
	Key string `xml:",innerxml"`
}

type Tabler added in v0.4.1

type Tabler interface {
	TableName() string
}

type Vault

type Vault struct {

	// settings for filtering entries
	FilterFields []string
	FilterAnd    bool
	// contains filtered or unexported fields
}

Vault : vault is the container object for vault-related operations

func NewVault

func NewVault(vaultPath string, logLevel logrus.Level, nocolorFlag bool) (*Vault, error)

NewVault : Create new instance of vault and load vault info

func (*Vault) Close

func (v *Vault) Close()

Close : close the connection to the underlying database. Always call this in the end.

func (*Vault) GetEntries

func (v *Vault) GetEntries(cardType string, recordCategory, recordTitle, recordLogin, recordUuid, recordFieldLabel []string, caseSensitive bool, orderbyFlag []string) ([]Card, error)

GetEntries : return the cardType entries in the Enpass database filtered by option flags.

func (*Vault) GetEntry

func (v *Vault) GetEntry(cardType string, recordCategory, recordTitle, recordLogin, recordUuid, recordFieldLabel []string, caseSensitive bool, orderbyFlag []string, unique bool) (*Card, error)

func (*Vault) Open

func (v *Vault) Open(credentials *VaultCredentials, logLevel logrus.Level, nocolorFlag bool) error

Open : setup a connection to the Enpass database. Call this before doing anything.

type VaultCredentials

type VaultCredentials struct {
	KeyfilePath string
	Password    string
	DBKey       []byte
}

func AssembleVaultCredentials added in v0.4.4

func AssembleVaultCredentials(logger *logrus.Logger, vaultPath string, keyFilePath string, nonInteractive bool, store *unlock.SecureStore) *VaultCredentials

func (*VaultCredentials) IsComplete

func (credentials *VaultCredentials) IsComplete() bool

type VaultInfo

type VaultInfo struct {
	EncryptionAlgo string `json:"encryption_algo"`
	HasKeyfile     int    `json:"have_keyfile"`
	KDFAlgo        string `json:"kdf_algo"`
	KDFIterations  int    `json:"kdf_iter"`
	VaultNumItems  int    `json:"vault_items_count"`
	VaultName      string `json:"vault_name"`
	VaultVersion   int    `json:"version"`
}

Jump to

Keyboard shortcuts

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