[M-17] Issuer data store breaks the protocol it implements: dirty ops on CA-key records, inconsistent signatures, omits wait_for_tables #29

Closed
opened 2026-11-14 18:28:54 +01:00 by amiryahaya · 1 comment
Owner

Finding

The Issuer implementation uses dirty_write/dirty_delete/dirty_read for the most sensitive records (CA keys) while every sibling uses transactions; its find(id, ...) argument order and exec(context, fun) shape contradict the protocol's other implementations; it's the only init without wait_for_tables — contradicting the invariant documented in AGENTS.md. IssuerManager works around it by bypassing the facade.

Evidence

  • lib/mdid_ws/cert_management/issuer.ex:44-119 (dirty ops at :72, :79, :84)

Impact

CA-key records skip the transaction/log barrier; any generic protocol call would misbehave for Issuer.

Fix

  • Reconcile with the transactional pattern (or stop implementing the protocol and make IssuerManager's access explicit)
  • Add wait_for_tables to init

Line numbers refer to the initial import commit 282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).

## Finding The Issuer implementation uses `dirty_write`/`dirty_delete`/`dirty_read` for the most sensitive records (CA keys) while every sibling uses transactions; its `find(id, ...)` argument order and `exec(context, fun)` shape contradict the protocol's other implementations; it's the only init without `wait_for_tables` — contradicting the invariant documented in AGENTS.md. IssuerManager works around it by bypassing the facade. ## Evidence - `lib/mdid_ws/cert_management/issuer.ex:44-119` (dirty ops at :72, :79, :84) ## Impact CA-key records skip the transaction/log barrier; any generic protocol call would misbehave for Issuer. ## Fix - [ ] Reconcile with the transactional pattern (or stop implementing the protocol and make IssuerManager's access explicit) - [ ] Add wait_for_tables to init _Line numbers refer to the initial import commit `282cb11`. Source: comprehensive audit, 2026-11-12 (first review of this codebase)._
Author
Owner

Verified fixed on main (1b6216b): Issuer store uses sync_transaction, protocol-conformant find and wait_for_tables (A6).

Verified fixed on main (1b6216b): Issuer store uses sync_transaction, protocol-conformant find and wait_for_tables (A6).
Sign in to join this conversation.
No description provided.