dataconverter

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrMetadataIsNotSet is returned when metadata is not set.
	ErrMetadataIsNotSet = errors.New("metadata is not set")
	// ErrEncodingIsNotSet is returned when payload encoding metadata is not set.
	ErrEncodingIsNotSet = errors.New("payload encoding metadata is not set")
	// ErrEncodingIsNotSupported is returned when payload encoding is not supported.
	ErrEncodingIsNotSupported = errors.New("payload encoding is not supported")
	//ErrUnableToFindConverter is return when payload converter is not found
	ErrUnableToFindConverter = errors.New("payload converter is not found")
)
View Source
var (
	ErrPadFailure = errors.New("unpad error. This could happen when incorrect encryption key is used")
	ErrIVFailure  = errors.New("failed random IV generation")
)

Functions

func NewEncryptDataConverterV1

func NewEncryptDataConverterV1(opts Options) (converter.DataConverter, error)

NewEncryptDataConverterV1 - Temporal provides a default unencrypted DataConverter however for some of our needs we need a DataConverter to encrypt maybe sensitive information into workflows. EncryptDataConverterV1 allows the ability to encrypt maybe sensitive workflows without compromising sensitive info we send to our temporal service.

Types

type AESEncryptionServiceV1

type AESEncryptionServiceV1 struct {
	Cipher cipher.AEAD
}

func (AESEncryptionServiceV1) Decrypt

func (a AESEncryptionServiceV1) Decrypt(encryptedBytes []byte) ([]byte, error)

Decrypt takes an encrypted base64 byte array then returns an unencrypted byte array if same key was used to encrypt it

func (AESEncryptionServiceV1) Encrypt

func (a AESEncryptionServiceV1) Encrypt(unencryptedBytes []byte) ([]byte, error)

Encrypt takes a byte array and returns an encrypted byte array as base64 encoded

type Options

type Options struct {
	// EncryptionKey is the encryption key used to encrypt the payloads
	// this key must be 16, 24, 32 characters in length
	EncryptionKey []byte
}

Jump to

Keyboard shortcuts

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