Skip to content

feat: add event codec and per-entity DEK helper#134

Closed
nicolasburtey wants to merge 8 commits into
mainfrom
feat/event-payload-codec-poc
Closed

feat: add event codec and per-entity DEK helper#134
nicolasburtey wants to merge 8 commits into
mainfrom
feat/event-payload-codec-poc

Conversation

@nicolasburtey
Copy link
Copy Markdown
Member

@nicolasburtey nicolasburtey commented May 16, 2026

Summary

  • add an opt-in EventPayloadCodec hook for event JSONB payloads, defaulting to plaintext JSON
  • wire repo persistence, generic queries, and nested hydration through the selected codec
  • add PerEntityDataKey / PerEntityDataKeyState helpers for streams that keep a wrapped per-entity DEK in mutable projection state and clear it for crypto-shredding
  • add a toy encoded payload POC test that proves stored event JSONB can be opaque while hydration still works

Lana usage

Verification

  • cargo fmt --check --all
  • cargo test -p es-entity --lib crypto_shred
  • earlier on this branch: cargo test -p es-entity-macros
  • earlier on this branch: DATABASE_URL=<dedicated es_entity_poc db> cargo check --workspace
  • earlier on this branch: DATABASE_URL=<dedicated es_entity_poc db> cargo test -p es-entity

Notes

  • This remains a POC branch for the payload codec. The test codec is toy XOR/hex, not production crypto.
  • The per-entity DEK helper is crypto-library agnostic; applications own the actual wrapping, lookup, and erase semantics.

@nicolasburtey nicolasburtey changed the title feat: add event payload codec hook feat: add event codec and per-entity DEK helper May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant