securestore

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 19 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 CreateToken added in v1.0.0

func CreateToken(ctx context.Context, secstore SecretStore, policies []string) (string, error)

create a new token with a given policy

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 ListCubbyhole added in v1.0.0

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

this function will retur all Cubbyhole entries

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

func RenewToken added in v1.0.0

func RenewToken(ctx context.Context, secstore SecretStore, token string) error

function renew the token

func RevokeToken added in v1.0.0

func RevokeToken(ctx context.Context, secstore SecretStore, token string) error

function to revoke the token

func SetServiceSecretCubbyhole added in v1.0.0

func SetServiceSecretCubbyhole(ctx context.Context, secstore SecretStore, s map[string]secret.Secret) error

this function will set a cubyhole for the list of secretsId

func UnWrappeSecret added in v0.5.1

func UnWrappeSecret(ctx context.Context, secstore SecretStore, token string) (map[string]secret.Secret, error)

this function will unwrap a cubbyhole and return the secret

func UnWrappeSecretJSON added in v0.5.2

func UnWrappeSecretJSON(ctx context.Context, secstore SecretStore, token string) (string, error)

this function will unwrap a secret and return a json string

func UnWrappeToken added in v1.0.0

func UnWrappeToken(ctx context.Context, secstore SecretStore, token string) (string, error)

this function will unwrap a token and return the Access token from it

func WrapCubbyhole added in v0.5.1

func WrapCubbyhole(ctx context.Context, secstore SecretStore, path string, ttl time.Duration) (string, error)

take a cubbyhole and wrap the secret and return the wrapped token

func WrapSecret added in v0.5.1

func WrapSecret(ctx context.Context, secstore SecretStore, secretID string, ttl time.Duration) (string, error)

create a wrap secret for a given appname and return the token

func WrapSecretList added in v0.5.3

func WrapSecretList(ctx context.Context, secstore SecretStore, secList []string, storePath string, ttl time.Duration) (string, error)

this function take a list of secretId and wrap the cubbyhole and return the token

func WrapToken added in v1.0.0

func WrapToken(ctx context.Context, secstore SecretStore, token string, ttl time.Duration) (string, error)

this function will wrap a token and return the wrapped token

Types

type SecretStore

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

func ConnectVault added in v0.5.1

func ConnectVault(ctx context.Context) (SecretStore, error)

connect to vault in annonymous mode

func ConnectVaultWithTLSConfig

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

connect to vault with specific tls config

func ConnectVaultWithToken added in v0.5.1

func ConnectVaultWithToken(ctx context.Context, token string) (SecretStore, error)

connect to vault using token

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