vault

package
v0.0.0-...-598f862 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Vault package is used to login to Vault using OIDC to retrieve a token and to read normal secrets or (write) to get access to other services like Azure or AWS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeVault

type FakeVault struct {
	Requests []string
}

FakeVault is a fake implementation of the Vault

func (*FakeVault) GetAddress

func (f *FakeVault) GetAddress() string

func (*FakeVault) GetToken

func (f *FakeVault) GetToken() string

func (*FakeVault) Read

func (f *FakeVault) Read(path string, data map[string][]string) (map[string]interface{}, error)

func (*FakeVault) Write

func (f *FakeVault) Write(path string, data map[string]interface{}) (map[string]interface{}, error)

type Vault

type Vault interface {
	Read(string, map[string][]string) (map[string]interface{}, error)
	Write(string, map[string]interface{}) (map[string]interface{}, error)
	GetToken() string
	GetAddress() string
}

Vault is a simple wrapper for the Vault client

func NewVault

func NewVault(address, role, token string, insecure bool, cache cache.Cache, logger *zerolog.Logger) (Vault, error)

NewVault creates Vault Token can be empty, if so OIDC login method will be used

type VaultImpl

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

VaultImpl is the Vault interface implementation

func (*VaultImpl) GetAddress

func (v *VaultImpl) GetAddress() string

GetAddress returns the Vault address for others to use, for example Terraform

func (*VaultImpl) GetToken

func (v *VaultImpl) GetToken() string

GetToken returns the Vault token for others to use, for example Terraform

func (*VaultImpl) Read

func (v *VaultImpl) Read(path string, data map[string][]string) (map[string]interface{}, error)

Read reads a secret from a specified Vault path

func (*VaultImpl) Write

func (v *VaultImpl) Write(path string, data map[string]interface{}) (map[string]interface{}, error)

Write to vault to generate a new secret

Jump to

Keyboard shortcuts

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