Skip to content

feat: abstract oobi manager and add postgres backend#77

Closed
zdravko61 wants to merge 11 commits intoTHCLab:masterfrom
VereignAG:feat/oobi-manager-abstract
Closed

feat: abstract oobi manager and add postgres backend#77
zdravko61 wants to merge 11 commits intoTHCLab:masterfrom
VereignAG:feat/oobi-manager-abstract

Conversation

@zdravko61
Copy link
Copy Markdown
Contributor

@zdravko61 zdravko61 commented Mar 31, 2026

Introduces OobiStorageBackend trait, making OobiManager<S> generic over storage

Changes

  • Adds PostgresOobiStorage implementing the trait via sqlx (feature = "oobi-manager")
  • Moves RedbOobiStorage behind #[cfg(feature = "storage-redb")]
  • Fixes get_end_role returning Some([]) instead of None on empty results
  • Propagates OobiManager::new Result with ? at all call sites
  • Adds From<OobiError> conversions across controller, witness, watcher, and `keri_core::Error

seriouscoderone and others added 11 commits February 18, 2026 17:47
…tecture

Gate redb behind `storage-redb` feature flag (default ON) in keri-core and
teliox so the core protocol logic can compile and run without redb. This
enables future alternative storage backends (e.g., DynamoDB for serverless).

Key changes:
- Split EventStorage constructors: generic `new()` (no mailbox) vs
  `new_redb()` (RedbDatabase with mailbox) vs `new_with_mailbox()` (inject)
- Make mailbox_data an Option<MailboxData> to support non-redb backends
- Remove Any bound from EventValidator
- Gate TelLogDatabase, teliox EscrowDatabase, and escrow module behind
  storage-redb feature
- Genericize teliox escrow structs over K: EventDatabase for KEL storage
- Add in-memory MemoryDatabase implementing all database traits for
  validation and testing
- Move rkyv_adapter to database::rkyv_adapter (not under database::redb)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Introduce `storage-postgres` feature and dependencies
- Implement PostgresDatabase, log, escrow, and KSN log modules
- Add SQL migrations for all KERI tables
- Integrate with existing database traits and event flows

Signed-off-by: Zdravko Iliev <[email protected]>
Signed-off-by: Zdravko Iliev <[email protected]>
- Replace dual cfg-gated OobiManager struct definitions with a single
  generic struct and per-backend type aliases (RedbOobiManager,
  PostgresOobiManager)
- Make process_reply and process_signed_oobi generic over
  OobiStorageBackend
- Propagate CBOR deserialization errors instead of silently dropping
  corrupted rows
- Replace unwrap() on serde_json/serde_cbor serialization with ? via
  new Cbor/Json variants on PostgresError

Signed-off-by: Zdravko Iliev <[email protected]>
- Split EndRoleAdd and EndRoleCut into separate arms (was incorrectly
  merged)
- Add TODO comment on EndRoleCut matching redb's pending delete
  semantics
- Replace silent _ => {} catch-all with explicit Ksn => todo!()
- Add Cbor and Json error variants to PostgresError and propagate
  serialization/deserialization errors instead of panicking or silently
  dropping failures

Signed-off-by: Zdravko Iliev <[email protected]>
@mitfik
Copy link
Copy Markdown
Contributor

mitfik commented Apr 7, 2026

merged via #81

@mitfik mitfik closed this Apr 7, 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.

3 participants