vault

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

filepath: /home/alexandre/Projects/sectool/internal/vault/object_storage_vault.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitwardenVault added in v1.0.0

type BitwardenVault struct {
	VaultProvider
	// contains filtered or unexported fields
}

BitwardenVault represents a Bitwarden vault provider.

func NewBitwardenVault added in v1.0.0

func NewBitwardenVault(config *config.BitwardenConfig) (*BitwardenVault, error)

NewBitwardenVault creates a new BitwardenVault instance.

func (*BitwardenVault) Lock added in v1.0.0

func (v *BitwardenVault) Lock() error

func (*BitwardenVault) SetSensitiveStrings added in v1.1.0

func (v *BitwardenVault) SetSensitiveStrings(kv *crypto.SecureKVStore)

GetSensitiveStrings returns sensitive strings from the Bitwarden vault.

func (*BitwardenVault) Unlock added in v1.0.0

func (v *BitwardenVault) Unlock() error

func (*BitwardenVault) VaultDelKey added in v1.0.0

func (v *BitwardenVault) VaultDelKey(key string) error

VaultDelKey deletes a key from the Bitwarden vault.

func (*BitwardenVault) VaultEnableBackup added in v1.0.0

func (v *BitwardenVault) VaultEnableBackup(value bool)

VaultEnableBackup is not applicable for BitwardenVault.

func (*BitwardenVault) VaultGetMultipleValues added in v1.0.1

func (v *BitwardenVault) VaultGetMultipleValues(keys []string, kv *crypto.SecureKVStore) error

VaultGetMultipleValues returns multiple values from the Bitwarden vault.

func (*BitwardenVault) VaultGetValue added in v1.0.0

func (v *BitwardenVault) VaultGetValue(key string) (string, error)

VaultGetValue returns the value of a key from the Bitwarden vault.

func (*BitwardenVault) VaultHasKey added in v1.0.0

func (v *BitwardenVault) VaultHasKey(key string) bool

VaultHasKey checks if the Bitwarden vault contains the specified key.

func (*BitwardenVault) VaultListKeys added in v1.0.0

func (v *BitwardenVault) VaultListKeys() []string

VaultListKeys lists all keys in the Bitwarden vault.

func (*BitwardenVault) VaultSetValue added in v1.0.0

func (v *BitwardenVault) VaultSetValue(key, value string) error

VaultSetValue sets the value of a key in the Bitwarden vault.

type DummyVault added in v1.0.1

type DummyVault struct {
	VaultProvider
	// contains filtered or unexported fields
}

func NewDummyVault added in v1.0.1

func NewDummyVault() *DummyVault

func (*DummyVault) Initialize added in v1.0.1

func (v *DummyVault) Initialize() error

func (*DummyVault) Lock added in v1.0.1

func (v *DummyVault) Lock() error

func (*DummyVault) SetSensitiveStrings added in v1.1.0

func (v *DummyVault) SetSensitiveStrings(kv *crypto.SecureKVStore)

func (*DummyVault) Unlock added in v1.0.1

func (v *DummyVault) Unlock() error

func (*DummyVault) VaultDelKey added in v1.0.1

func (v *DummyVault) VaultDelKey(key string) error

func (*DummyVault) VaultEnableBackup added in v1.0.1

func (v *DummyVault) VaultEnableBackup(value bool)

func (*DummyVault) VaultGetMultipleValues added in v1.0.1

func (v *DummyVault) VaultGetMultipleValues(keys []string, kv *crypto.SecureKVStore) error

func (*DummyVault) VaultGetValue added in v1.0.1

func (v *DummyVault) VaultGetValue(key string) (string, error)

func (*DummyVault) VaultHasKey added in v1.0.1

func (v *DummyVault) VaultHasKey(key string) bool

func (*DummyVault) VaultListKeys added in v1.0.1

func (v *DummyVault) VaultListKeys() []string

func (*DummyVault) VaultSetValue added in v1.0.1

func (v *DummyVault) VaultSetValue(key, value string) error

type FileVault added in v1.0.0

type FileVault struct {
	VaultProvider
	// contains filtered or unexported fields
}

FileVault represents a secure key-value store.

func NewFileVault added in v1.0.0

func NewFileVault(config *config.FileConfig) (*FileVault, error)

NewVault creates a new FileVault instance.

func (*FileVault) Initialize added in v1.0.0

func (v *FileVault) Initialize() error

Initialize creates a new vault file if it doesn't exist.

func (*FileVault) Lock added in v1.0.0

func (v *FileVault) Lock() error

Lock encrypts the vault file.

func (*FileVault) SetSensitiveStrings added in v1.1.0

func (v *FileVault) SetSensitiveStrings(kv *crypto.SecureKVStore)

GetSensitiveStrings returns the sensitive strings in the vault.

func (*FileVault) Unlock added in v1.0.0

func (v *FileVault) Unlock() error

Unlock decrypts the vault file.

func (*FileVault) VaultDelKey added in v1.0.0

func (v *FileVault) VaultDelKey(key string) error

VaultDelKey deletes a key from the vault.

func (*FileVault) VaultEnableBackup added in v1.0.0

func (v *FileVault) VaultEnableBackup(value bool)

VaultEnableBackup enables or disables vault backups.

func (*FileVault) VaultGetMultipleValues added in v1.0.1

func (v *FileVault) VaultGetMultipleValues(keys []string, kv *crypto.SecureKVStore) error

VaultGetMultipleValues returns the values of multiple keys from the vault.

func (*FileVault) VaultGetValue added in v1.0.0

func (v *FileVault) VaultGetValue(key string) (string, error)

VaultGetValue returns the value of a key from the vault.

func (*FileVault) VaultHasKey added in v1.0.0

func (v *FileVault) VaultHasKey(key string) bool

VaultHasKey checks if the vault contains the specified key.

func (*FileVault) VaultListKeys added in v1.0.0

func (v *FileVault) VaultListKeys() []string

VaultListKeys lists all keys in the vault.

func (*FileVault) VaultSetValue added in v1.0.0

func (v *FileVault) VaultSetValue(key, value string) error

VaultSetValue sets the value of a key in the vault.

type ObjectStorageVault added in v1.1.0

type ObjectStorageVault struct {
	VaultProvider
	// contains filtered or unexported fields
}

ObjectStorageVault represents a secure key-value store stored in an S3 bucket.

func NewObjectStorageVault added in v1.1.0

func NewObjectStorageVault(c *config.ObjectStorageConfig) (*ObjectStorageVault, error)

NewObjectStorageVault creates a new ObjectStorageVault instance.

func (*ObjectStorageVault) Initialize added in v1.1.0

func (v *ObjectStorageVault) Initialize() error

Initialize creates a new vault file in the S3 bucket if it doesn't exist.

func (*ObjectStorageVault) SetSensitiveStrings added in v1.1.0

func (v *ObjectStorageVault) SetSensitiveStrings(kv *crypto.SecureKVStore)

GetSensitiveStrings returns the sensitive strings in the vault.

func (*ObjectStorageVault) VaultDelKey added in v1.1.0

func (v *ObjectStorageVault) VaultDelKey(key string) error

VaultDelKey deletes a key from the vault.

func (*ObjectStorageVault) VaultEnableBackup added in v1.1.0

func (v *ObjectStorageVault) VaultEnableBackup(value bool)

VaultEnableBackup enables or disables vault backups.

func (*ObjectStorageVault) VaultGetMultipleValues added in v1.1.0

func (v *ObjectStorageVault) VaultGetMultipleValues(keys []string, kv *crypto.SecureKVStore) error

VaultGetMultipleValues returns the values of multiple keys from the vault.

func (*ObjectStorageVault) VaultGetValue added in v1.1.0

func (v *ObjectStorageVault) VaultGetValue(key string) (string, error)

VaultGetValue returns the value of a key from the vault.

func (*ObjectStorageVault) VaultHasKey added in v1.1.0

func (v *ObjectStorageVault) VaultHasKey(key string) bool

VaultHasKey checks if the vault contains the specified key.

func (*ObjectStorageVault) VaultListKeys added in v1.1.0

func (v *ObjectStorageVault) VaultListKeys() []string

VaultListKeys lists all keys in the vault.

func (*ObjectStorageVault) VaultSetValue added in v1.1.0

func (v *ObjectStorageVault) VaultSetValue(key, value string) error

VaultSetValue sets the value of a key in the vault.

type VaultProvider added in v1.0.0

type VaultProvider interface {
	VaultListKeys() []string
	VaultSetValue(key, value string) error
	VaultGetValue(key string) (string, error)
	VaultDelKey(key string) error
	VaultHasKey(key string) bool
	VaultEnableBackup(value bool)
	SetSensitiveStrings(*crypto.SecureKVStore)
	VaultGetMultipleValues(keys []string, kv *crypto.SecureKVStore) error
	Lock() error
	Unlock() error
}

VaultProvider defines the interface for a vault provider.

func NewVaultProvider added in v1.0.0

func NewVaultProvider(cfg config.Config) (VaultProvider, error)

NewVaultProvider creates a new vault provider based on the configuration.

Jump to

Keyboard shortcuts

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