vaultclient

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(config *Config) error

func ConfigureDefault

func ConfigureDefault() error

func CreateSession

func CreateSession(creds *credentials.Credentials, configuredRegion string) (*session.Session, error)

func Delete

func Delete(path string) (*api.Secret, error)

func DeleteData

func DeleteData(path string) (map[string]interface{}, error)

DeleteData returns the Data held in the Secret, use Delete if you need metadata

func GetClient

func GetClient() *api.Client

Onus is on the caller to make sure the client has been configured

func List

func List(path string) (*api.Secret, error)

func ListData

func ListData(path string) ([]interface{}, error)

ListData returns the Data held in the Secrets, use List if you need metadata

func Read

func Read(path string) (*api.Secret, error)

func ReadData

func ReadData(path string) (map[string]interface{}, error)

ReadData returns the Data held in the Secret, use Read if you need metadata

func Write

func Write(path string, data map[string]interface{}) (*api.Secret, error)

func WriteData

func WriteData(path string, data map[string]interface{}) (map[string]interface{}, error)

WriteData returns the Data held in the Secret, use Write if you need metadata

Types

type Auth

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

func (*Auth) IsTokenExpired

func (v *Auth) IsTokenExpired() bool

type AuthType

type AuthType int
const (
	Token AuthType = iota + 1
	Iam
	AppRole
	K8s
	EnvVarAwsRegion    = "AWS_REGION"
	EnvVarStsAwsRegion = "STS_AWS_REGION"
)

type Config

type Config struct {
	*api.Config
	AuthType        AuthType
	Token           string
	IamRole         string
	AppRole         string
	AppRoleId       string
	AppRoleSecretId string
	K8sRole         string
	K8sPath         string
}

func BaseConfig

func BaseConfig() *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

type VaultAuth

type VaultAuth interface {
	VaultClient() (*api.Client, error)
	VaultClientOrPanic() *api.Client
}

func NewVaultAuth

func NewVaultAuth(cfg *Config) (VaultAuth, error)

Jump to

Keyboard shortcuts

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