secret

package
v0.0.0-...-424292f Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: BSD-3-Clause Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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