csfle

package
v5.6.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDataKey

func CreateDataKey(ctx context.Context, m *m.Mongo, keyVaultNamespace, keyAltName string, provider MasterKeyProvider) (*primitive.Binary, error)

func GetDataKey

func GetDataKey(ctx context.Context, m *m.Mongo, keyVaultNamespace, keyAltName string, provider MasterKeyProvider) (res *primitive.Binary, err error)

func New

func New(ctx context.Context, serviceName string, logger log.Log, c Config, t m.Tracer, opts ...*options.ClientOptions) (*m.Mongo, error)

func SetEncryptionKey

func SetEncryptionKey(ctx context.Context, logger log.Log, encryptionSchema *string, client *mongo.Mongo, keyVaultNamespace string, kmsProvider MasterKeyProvider) (map[string]interface{}, error)

Types

type AWSDataKeyOpts

type AWSDataKeyOpts struct {
	Region   string `bson:"region"`
	KeyARN   string `bson:"key"`
	Endpoint string `bson:"endpoint,omitempty"`
}

type AWSKMSProvider

type AWSKMSProvider struct {
	// contains filtered or unexported fields
}

func GetAWSProvider

func GetAWSProvider(ctx context.Context, logger log.Log, awsConfig *aws.Config, kmsARN string) (provider *AWSKMSProvider, err error)

func GetDefaultAWSProvider

func GetDefaultAWSProvider(ctx context.Context, logger log.Log, kmsARN string) (*AWSKMSProvider, error)

func NewAWSProvider

func NewAWSProvider(credentials map[string]interface{}, opts AWSDataKeyOpts) *AWSKMSProvider

func (*AWSKMSProvider) Credentials

func (a *AWSKMSProvider) Credentials() map[string]map[string]interface{}

func (*AWSKMSProvider) DataKeyOpts

func (a *AWSKMSProvider) DataKeyOpts() interface{}

func (*AWSKMSProvider) Name

func (a *AWSKMSProvider) Name() string

type Config

type Config struct {
	*mongo.Config
	CryptSharedLibPath string
	KeyVaultNamespace  string
	SchemaMap          map[string]interface{}
	KMSCredentials     map[string]map[string]interface{}
}

type MasterKeyProvider

type MasterKeyProvider interface {
	Name() string
	Credentials() map[string]map[string]interface{}
	DataKeyOpts() interface{}
}

func GetAWSMasterKeyProvider

func GetAWSMasterKeyProvider(ctx context.Context, logger log.Log, kmsARN string) (MasterKeyProvider, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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