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!53
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/a5-correctness-durability"
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 A5: closes #21, #22, #24, #25.
Changes
MdidWs.Lock(:global.trans). Enrollment and standalone renewal hold a per-IC lock from the "active certificate" check to the save, and revocation takes the same lock and re-reads the record. The IC is normalised (dashes stripped) so dashed and plain forms share one lock. The login rate limiter locks per identifier;create_client/3locks perclient_id({:error, :client_exists}); duplicate client rows fail authentication closed (:ambiguous_client) instead of raising.superseded) and the CRL republished; a remote-only source is revoked at Trustgate after issuance. If that fails, the replacement record is deleted, so the subscriber keeps the old certificate.nextUpdate(72h,:crl_validity_hours) and a strictly increasing CRLNumber are set./revokeand/revoke-by-icaccept an optional RFC 5280reason(400 for unknown values). A failed publish after a committed revocation no longer 500s;MdidWs.CrlRepublisherretries after 60s and refreshes every 6h (disabled in test config).sync_transaction; the issuer (CA key) store usessync_dirty. The login-attempt store stays async.Behaviour changes / deploy notes
superseded) and appears in the CRL;/statusfollows the newest certificate. Two existing tests asserting the old behaviour were rewritten.ic_numberis now digits-only for dashed CSR serials.create_clientfor an existing id now returns{:error, :client_exists}.Tests and coverage
mix test: 275/277 pass; the 2 failures (TrustgateLifecycleTest) also fail on main. Race tests were verified to fail with the lock removed.Coverage of changed modules: CrlRepublisher 86%, CrlPublisher 82%, ClientCredentials 82%, CertManagementController 83%, RateLimiter 92%, Renewal 79.5%, Enrollment 76% (untested lines are pre-existing paths). Project total 73.4% (no project minimum stated).
Review
Pass 1 (complexity): clean (removed an unreachable
:abortedbranch from the lock). Pass 2: no critical issues; fixed the IC-format lock bypass, revoke/renew race, republisher crash-loop and stale-timer chain, rollback logging. Not fixed: lock held across SOAP calls (bounded by the 30s HTTP timeout), stray*.tmp-*files after a hard crash.🤖 Generated with Claude Code