encryption

package
v4.2.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockNodeKeyManagerClient

func NewMockNodeKeyManagerClient() encryption.NodeKeyManagerClient

func WithEncryption

func WithEncryption() nodes.Option

Types

type Handler

type Handler struct {
	abstract.Handler
	// contains filtered or unexported fields
}

Handler encryption node middleware

func (*Handler) Adapt

func (e *Handler) Adapt(h nodes.Handler, options nodes.RouterOptions) nodes.Handler

func (*Handler) CopyObject

func (e *Handler) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *models.CopyRequestData) (models.ObjectInfo, error)

CopyObject enriches request metadata for CopyObject with Encryption Materials, if required by the datasource

func (*Handler) GetObject

func (e *Handler) GetObject(ctx context.Context, node *tree.Node, requestData *models.GetRequestData) (io.ReadCloser, error)

GetObject enriches request metadata for GetObject with Encryption Materials, if required by the datasource.

func (*Handler) MultipartCreate

func (e *Handler) MultipartCreate(ctx context.Context, target *tree.Node, requestData *models.MultipartRequestData) (string, error)

func (*Handler) MultipartPutObjectPart

func (e *Handler) MultipartPutObjectPart(ctx context.Context, target *tree.Node, uploadID string, partNumberMarker int, reader io.Reader, requestData *models.PutRequestData) (models.MultipartObjectPart, error)

func (*Handler) PutObject

func (e *Handler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (models.ObjectInfo, error)

PutObject enriches request metadata for PutObject with Encryption Materials, if required by datasource.

func (*Handler) SetNodeKeyManagerClient

func (e *Handler) SetNodeKeyManagerClient(nodeKeyManagerClient encryption.NodeKeyManagerClient)

func (*Handler) SetUserKeyTool

func (e *Handler) SetUserKeyTool(keyTool UserKeyTool)

type UserKeyTool

type UserKeyTool interface {
	GetEncrypted(ctx context.Context, keyID string, data []byte) ([]byte, error)
	GetDecrypted(ctx context.Context, keyID string, data []byte) ([]byte, error)
}

UserKeyTool describes a tool that can encrypt/decrypt data based on user context

func GetUserKeyTool

func GetUserKeyTool(user string, pass []byte) UserKeyTool

GetUserKeyTool creates a keytool based on specified @user and @pass

func MasterKeyTool

func MasterKeyTool(ctx context.Context) (UserKeyTool, error)

MasterKeyTool creates the admin key tool

func NewMockUserKeyTool

func NewMockUserKeyTool() UserKeyTool

Jump to

Keyboard shortcuts

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