securityprovider

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SharedPrefix prefix represents the file is sharable i.e encryption key does not include (fdbSec.fieldQuery)
	SharedPrefix = "ss_"
	// EmptySTR represents empty string
	EmptySTR = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decrypter

type Decrypter interface {
	Decrypt([]byte, string, *gjson.Result) ([]byte, error)
}

type Encrypter

type Encrypter interface {
	Encrypt([]byte, string, *gjson.Result) ([]byte, error)
}

type FdbSecurityProvider

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

func New

func (FdbSecurityProvider) Decrypt

func (fs FdbSecurityProvider) Decrypt(dataByte []byte, fileName string, data *gjson.Result) (res []byte, err error)

Decrypt - decrypts provide data

func (FdbSecurityProvider) Encrypt

func (fs FdbSecurityProvider) Encrypt(dataByte []byte, fileName string, data *gjson.Result) (res []byte, err error)

Encrypt - encrypts provide data

func (FdbSecurityProvider) GenerateSecurityKey

func (fs FdbSecurityProvider) GenerateSecurityKey(fileName string, data *gjson.Result) (key []byte, err error)

type SecurityConfig

type SecurityConfig struct {
	EncKey         string // the global encryption key used in the project. This key will be applicable in all cases.
	UserDefinedKey string // the user defined key in the project. This key will be applicable in all cases.
	FieldQuery     string // query to get dynamic field. Ex. Each student data can be encrypted with studentID. Applicable only for the shared bucket.
}

type SecurityProvider

type SecurityProvider interface {
	Encrypter
	Decrypter
}

Jump to

Keyboard shortcuts

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