vault

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service contains scoped secret data, Vault client and configuration

func NewService

func NewService(deploymentID string, encryptor types.Encryptor, addr, token string) (*Service, error)

NewService instantiates a Vault service

func (*Service) DeleteEntry

func (vs *Service) DeleteEntry(appName, scope, name string) error

Delete key from Data, Metadata and Vault

func (*Service) GetCurrentVersion

func (vs *Service) GetCurrentVersion(appName, scope string) (int64, error)

GetCurrentVersion returns current data version in cache

func (*Service) GetEntries

func (vs *Service) GetEntries(appName, scope string) (map[string]interface{}, error)

GetEntries returns all the secrets currently stored in Vault

func (*Service) GetEntry

func (vs *Service) GetEntry(appName, scope, name string) (interface{}, error)

GetEntry returns a secret value by name

func (*Service) GetLatestVersion

func (vs *Service) GetLatestVersion(appName, scope string) (int64, error)

GetLatestVersion returns latest data version from vault

func (*Service) ListAppNames

func (vs *Service) ListAppNames() ([]string, error)

ListAppNames returns a slice containing all app names inside the deploymentID namespace

func (*Service) ListEntries

func (vs *Service) ListEntries(appName, scope string) ([]string, error)

ListEntries returns a slice containing all secret keys of a scope

func (*Service) PushPolicies

func (vs *Service) PushPolicies(policies map[string]string) error

func (*Service) Read

func (vs *Service) Read(appName, scope string) error

LoadSecrets loads existing secrets from vault

func (*Service) SetEntries

func (vs *Service) SetEntries(appName, scope string, data map[string]interface{}) error

SetEntries inserts given data into the secret store, overwriting keys if they exist

func (*Service) SetEntry

func (vs *Service) SetEntry(appName, scope, name string, value interface{}) error

SetEntry stores all secrets into the memory

func (*Service) Write

func (vs *Service) Write(appName, scope string) error

Write saves all secrets to a Vault kv secret

Jump to

Keyboard shortcuts

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