Documentation
¶
Overview ¶
AutoConfig cache encryption.
The cache stores environment metadata (including SDK keys and mobile keys) in Redis or DynamoDB. Encryption at rest provides defense in depth against unauthorized read access to the persistent store.
Uses AES-256-GCM with a random nonce per item and HKDF-SHA256 for key derivation from the configured CacheEncryptionKey (or the AutoConfig key as a fallback).
Index ¶
Constants ¶
const CurrentModelVersion = 1
CurrentModelVersion is the version of the serialization format. Increment this when the shape of EnvironmentRep or FilterRep changes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachedItem ¶
type CachedItem struct {
Kind ModelKind `json:"kind"`
ModelVersion int `json:"modelVersion"`
Data json.RawMessage `json:"data"`
}
CachedItem is the versioned envelope stored in the cache. It wraps the actual data with kind and version metadata so we can detect and handle format changes on read.
type ModelKind ¶
type ModelKind string
ModelKind identifies the type of data stored in a CachedItem.
type Store ¶
type Store interface {
io.Closer
// GetAll returns the cached PutContent, or nil if the cache is empty.
GetAll(ctx context.Context) (*autoconfig.PutContent, error)
// SetAll writes the full PutContent to the store, removing stale items.
SetAll(ctx context.Context, content autoconfig.PutContent) error
// Upsert writes a single item to the store.
Upsert(ctx context.Context, kind autoconfig.CacheKind, id string, data interface{}) error
// Delete removes a single item from the store.
Delete(ctx context.Context, kind autoconfig.CacheKind, id string) error
}
Store reads and writes the encrypted AutoConfig cache in the configured persistent store (Redis or DynamoDB). Each environment and filter is stored as an individual item, encrypted separately. The cache key namespaces entries so multiple Relay instances can share the same store.