Documentation
¶
Overview ¶
Package vault provides encrypted key-value secret storage using Badger (embedded KV store) with AES encryption and Argon2id password-based key derivation. Each workspace gets its own encrypted database.
Index ¶
- func Destroy(workspace string) error
- func ExportEnvFormat(store map[string]string) string
- func ImportEnvFile(workspace, password, path string) error
- func Init(workspace, password string) error
- func IsInitialized(workspace string) bool
- func ParseEnvFile(data []byte) map[string]string
- func QuickDelete(workspace, password, key string) error
- func QuickGet(workspace, password, key string) (string, error)
- func QuickList(workspace, password string) ([]string, error)
- func QuickSet(workspace, password, key, value string) error
- func ReplaceAll(workspace, password string, store map[string]string) error
- type Store
- func (s *Store) All() (map[string]string, error)
- func (s *Store) Close() error
- func (s *Store) Delete(key string) error
- func (s *Store) Get(key string) (string, error)
- func (s *Store) ImportEnvEntries(entries map[string]string) error
- func (s *Store) List() ([]string, error)
- func (s *Store) Set(key, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportEnvFormat ¶
ExportEnvFormat returns key-value pairs as KEY=VALUE lines.
func ImportEnvFile ¶
ImportEnvFile reads a .env file and merges its key-value pairs into the vault.
func IsInitialized ¶
IsInitialized checks whether a vault exists for the workspace.
func ParseEnvFile ¶
ParseEnvFile parses KEY=VALUE lines from .env file data.
func QuickDelete ¶
QuickDelete opens the vault, deletes a key, and closes.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps a Badger database for encrypted secret storage.
func Open ¶
Open decrypts and opens the vault database, returning a Store handle. The caller must call Close() when done.
func (*Store) ImportEnvEntries ¶
ImportEnvEntries merges key-value pairs from a parsed .env map into the vault.