secret

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvKeyDataSecretKey = "FLOGO_DATA_SECRET_KEY"
)

Variables

This section is empty.

Functions

func GetDataSecretKey

func GetDataSecretKey() string

func PreProcessConfig

func PreProcessConfig(appJson []byte) ([]byte, error)

func PropertyProcessor

func PropertyProcessor(properties map[string]interface{}) error

func SetSecretValueHandler

func SetSecretValueHandler(pwdResolver SecretValueHandler)

Set secret value decoder

Types

type KeyBasedSecretValueHandler

type KeyBasedSecretValueHandler struct {
	Key string
}

A key based secret value decoder. Secret value encryption/decryption is based on SHA256 and uses implementation from https://gist.github.com/willshiao/f4b03650e5a82561a460b4a15789cfa1

func (*KeyBasedSecretValueHandler) DecodeValue

func (defaultResolver *KeyBasedSecretValueHandler) DecodeValue(value interface{}) (string, error)

Decode value based on a key

func (*KeyBasedSecretValueHandler) EncodeValue

func (defaultResolver *KeyBasedSecretValueHandler) EncodeValue(value interface{}) (string, error)

type SecretValueHandler

type SecretValueHandler interface {
	EncodeValue(value interface{}) (string, error)
	DecodeValue(value interface{}) (string, error)
}

SecretValueDecoder defines method for decoding value

func GetSecretValueHandler

func GetSecretValueHandler() SecretValueHandler

Get secret value handler. If not already set by SetSecretValueHandler(), will return default KeyBasedSecretValueDecoder where decoding key value is expected to be set through FLOGO_DATA_SECRET_KEY environment variable. If key is not set, a default key value(github.com/qingcloudhx/core/config.DATA_SECRET_KEY_DEFAULT) will be used.

Jump to

Keyboard shortcuts

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