middleware

package
v0.7.15 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptionConfig

type EncryptionConfig struct {
	// ActiveKey is the key used for encrypting new data.
	// Must be 32 bytes for AES-256.
	ActiveKey []byte

	// FallbackKeys is a list of old keys to try when decryption fails.
	// This enables zero-downtime key rotation.
	FallbackKeys [][]byte
}

EncryptionConfig holds the keys for encryption and decryption.

type Middleware

type Middleware func(ports.StateStore) ports.StateStore

Middleware allows wrapping a StateStore to add behavior.

func NewEncryptionMiddleware

func NewEncryptionMiddleware(config EncryptionConfig) Middleware

NewEncryptionMiddleware creates a middleware that encrypts state using AES-GCM (Envelope Encryption)

func NewPIIMiddleware

func NewPIIMiddleware(patternStrings []string) Middleware

NewPIIMiddleware creates a middleware that masks values of keys matching the patterns.

Jump to

Keyboard shortcuts

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