[DUP-1] Five DataStoreProtocol implementations are ~75% copy-paste (~942 lines → ~120-line generic helper) #36
Labels
No labels
architecture
code-quality
correctness
critical
docs
high
low
medium
ops
performance
privacy
security
tests
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
antrapol/CA-MDID-eMudhra#36
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding
client/signing_key/access_token/login_attempt/certificate_request data stores share an identical skeleton (init, save+transaction, delete, exec(:reset), wrap_with, ensure_table_exists incl. wait_for_tables, generate_id); only table name, attributes, record tuple, to_struct and find patterns differ (diff-verified: 34-66 changed lines between siblings).
Evidence
lib/mdid_ws/oauth/client_data_store.ex(157),signing_key_data_store.ex(152),access_token_data_store.ex(163),lib/mdid_ws/auth/login_attempt_data_store.ex(183),lib/mdid_ws/cert_management/certificate_request_data_store.ex(287)Impact
~450-500 removable lines; 5 divergent copies of transaction/wait logic; schema changes touch 5 places by hand (the certificate_request legacy migration already demonstrates the pain).
Fix
Line numbers refer to the initial import commit
282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).Verified fixed on main (
1b6216b): five stores are configuration over MdidWs.MnesiaStore (B6, PR #59).