securestore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSecret

func AddSecret(ctx context.Context, secstore SecretStore, secret secret.Secret, secretID string) error

this function add a Secret to vault for the given secstore and secretID

func CheckSecretID

func CheckSecretID(ctx context.Context, secstore SecretStore, secretID string) bool

check if SecretId already exist in vault

func DeleteSecret

func DeleteSecret(ctx context.Context, secstore SecretStore, secretId string) error

this function will update a secret in vault for a given secstore, secret and secretID

func GetSecret

func GetSecret(ctx context.Context, secstore SecretStore, secretID string) (secret.Secret, error)

func ListSecrets

func ListSecrets(ctx context.Context, secstore SecretStore) error

this function list all secrets in vault for the given mountpath and readAPPNAME() and display them in tabuuar format

Types

type Secret

type Secret struct {
	Username     string
	Credential   string
	URL          string //optional
	Comment      string
	LastUpdate   time.Time
	LastUpdateBy string
}

type SecretStore

type SecretStore struct {
	Client    *vault.Client
	Mountpath string
	Appname   string
}

func ConnectVaultWithTLSConfig

func ConnectVaultWithTLSConfig(ctx context.Context, tlsConfig *tls.Config) (SecretStore, error)

connect to vault with specific tls config

func ConnectVaultWithUsernamePassword

func ConnectVaultWithUsernamePassword(ctx context.Context, username, password string) (SecretStore, error)

connect to vault using username and password and return the client

func ConnectVaulwithYubikey

func ConnectVaulwithYubikey(ctx context.Context, yubikey *piv.YubiKey, pin string) (SecretStore, error)

connect to vault with yubikey

Jump to

Keyboard shortcuts

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