vault

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateVault

func CreateOrUpdateVault(obj pipeline.Object, data *pipeline.Context) pipeline.Result

func GetServiceAccountToken

func GetServiceAccountToken(instance metav1.Object, data *pipeline.Context) (string, error)

func HandleVaultDeletion

func HandleVaultDeletion(obj pipeline.Object, data *pipeline.Context) pipeline.Result

func SetCustomClient

func SetCustomClient(c VaultClient)

SetCustomClient is used if a custom client needs to be used. Currently only used for testing.

Types

type BankVaultClient

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

func (*BankVaultClient) AddSecrets

func (b *BankVaultClient) AddSecrets(secrets []VaultSecret) error

func (*BankVaultClient) RemoveSecrets

func (b *BankVaultClient) RemoveSecrets(secrets []VaultSecret) error

RemoveSecrets will remove all the keys bellow the given paths. It will list all secrets of in the path and delete them according to the deletion policy.

func (*BankVaultClient) SetDeletionPolicy

func (b *BankVaultClient) SetDeletionPolicy(deletionPolicy synv1alpha1.DeletionPolicy)

type VaultClient

type VaultClient interface {
	AddSecrets(secrets []VaultSecret) error
	// remove specific secret
	RemoveSecrets(secret []VaultSecret) error
	SetDeletionPolicy(synv1alpha1.DeletionPolicy)
}

func NewClient

func NewClient(deletionPolicy synv1alpha1.DeletionPolicy, log logr.Logger) (VaultClient, error)

NewClient returns the default VaultClient implementation, ready to be used. It automatically detects, if there was a Vault token provided or if it's running withing kubernetes.

type VaultSecret

type VaultSecret struct {
	Path  string
	Value string
}

TODO: similar map like the template files

Jump to

Keyboard shortcuts

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