secret

package
v0.0.0-...-08f312e Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte) ([]byte, error)

Decrypt data using aes+hmac algorithm Init() must be called before any decryption

func DecryptS

func DecryptS(ptype string, val sql.NullString, data []byte, clear bool) (string, error)

DecryptS wrap Decrypt and: - return Placeholder instead of value if not needed - cast returned value in string

func DecryptVariable

func DecryptVariable(v *sdk.Variable) error

DecryptVariable decrypts variable value using aes+hmac algorithm

func Encrypt

func Encrypt(data []byte) ([]byte, error)

Encrypt data using aes+hmac algorithm Init() must be called before any encryption

func EncryptS

func EncryptS(ptype string, value string) (sql.NullString, []byte, error)

EncryptS wrap Encrypt and: - return valid string if type is not a password - cipher and returned ciphered value in a []byte if password

func Init

func Init(cipherKey string)

Init secrets: cipherKey cipherKey is set from viper configuration

Types

type Secret

type Secret struct {
	Token  string
	Client *vault.Client
}

func New

func New(token, addr string) (*Secret, error)

Create new secret client

func (*Secret) GetFromVault

func (secret *Secret) GetFromVault(s string) (string, error)

Get secret from vault

Jump to

Keyboard shortcuts

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