Batch B6: deduplication (#36–#39) #59
No reviewers
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!59
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/b6-dedup"
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?
Batch B6 — deduplication, #36–#39. Net 31 files, about -920 lines.
MdidWs.MnesiaStore(usemacro) replaces five hand-writtenDataStoreProtocolimpls; each store is now configuration (table,struct,attributes,indexes,finders, optionalsync: false, hooksbefore_save/dump/load/migrate). Legacy-schema migrations (oauth_client scopes, certificate_request issuance fields), index backfill and signing-key encryption are preserved.LeafIssuer+Pemshared by enrollment and renewal; test-onlyRenewal.process/2and its 6 tests removed (same paths are covered through the standalone endpoints).CertificateRequest.find_by_serial/1), PEM→DER b64, "valid" status, issuer filter, secret generation; the three cert base URLs share one default inconfig/config.exs(ocsp_base_url,issuer_aia_base_url,crl_base_urlarefetch_env!now; prod runtime.exs already sets all three).scripts/lib/common.sh(token fetch, connection banner,--validityparsing, authenticated POST); client secret and bearer token go to curl over stdin, not argv; token format is validated before it is written to a curl config.Small behaviour changes:
{:by_id, id}works on every store (previously returned all rows on four of them);save(return_record: true)on oauth_client returns the default scopes; table-load wait is 15s and returns an error tuple; login_attempt no longer opens a schema transaction on every call; 07_full_workflow's token-failure message is no longer coloured.Not done: SOAP check-then-retry ladders (enrollment/renewal classify differently) and XML escaping shared with
scripts/10_soap_enroll.shstay duplicated. #36–#39 otherwise addressed.Verification:
mix precommit325 passed. Coverage: whole app 83.6% before the helper tests were added (MnesiaStore 100%, Status 96%, Revocation 94%; LeafIssuer/Pem/ClcData were 50–78% and now have direct tests, not re-measured). Scripts:bash -n, shellcheck, stub-curl and mock-server checks only; not run against a live API. Two-pass review: no must-fix/critical; findings applied (exact certificate_request schema match, banner helper, token guard, store tests). Not added: a direct certificate_request legacy-migration test (covered indirectly by 9 controller tests), tests asserting sync vs async.🤖 Generated with Claude Code