vaultutils

package
v0.0.0-...-d909647 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VaultAddressKey       string = "USER_VAULT_ADDRESS"
	VaultSecretKey        string = "USER_VAULT_TOKEN"
	VaultTimeoutKey       string = "USER_VAULT_TIMEOUT"
	VaultPathKey          string = "USER_VAULT_PATH"
	VaultConnectorPortKey string = "PORT_VAULT_CONNECTOR"
	DefaultTimeout        string = "180"
	DefaultPort           string = "50083" //synched with vault_connector.yaml
)

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

func GetEnvWithDefault

func GetEnvWithDefault(key string, defaultValue string) string

Types

type VaultConfig

type VaultConfig struct {
	Token   string
	Address string
}

type VaultConnection

type VaultConnection struct {
	Config VaultConfig
	Client *api.Client
}

func CreateVaultConnection

func CreateVaultConnection() VaultConnection

func (*VaultConnection) AddToVault

func (vlt *VaultConnection) AddToVault(innerVaultPath string, credentialsMap map[string]interface{}) (string, error)

AddToVault adds crededentialsMap to vault at the path given by innerVaultPath

func (*VaultConnection) GetFromVault

func (vlt *VaultConnection) GetFromVault(vaultPathKey string, innerVaultPath string) (string, error)

GetFromVault returns the credentials from vault as json

func (*VaultConnection) InitVault

func (vlt *VaultConnection) InitVault() (*api.Client, error)

Jump to

Keyboard shortcuts

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