[M-15] cert_management_controller.ex is a 711-line god module — revocation/status business logic lives in the web layer #27

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

Finding

The controller contains the revocation state machine, direct persistence (StrapDataStore.save), CRL publication orchestration, SOAP orchestration, response shaping, URL building and date formatting. Enrollment and renewal were extracted into contexts; revocation and status were not.

Evidence

  • lib/mdid_ws_web/controllers/cert_management_controller.ex (711 lines) — e.g. process_revocation/1 at :391-436, direct store calls at :220, :352, :596

Impact

Business rules untestable without the web layer, duplicated patterns, and CA logic mixed with HTTP concerns.

Fix

  • Extract MdidWs.CertManagement.Revocation and Status contexts
  • Controllers only parse/render

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

## Finding The controller contains the revocation state machine, direct persistence (`StrapDataStore.save`), CRL publication orchestration, SOAP orchestration, response shaping, URL building and date formatting. Enrollment and renewal were extracted into contexts; revocation and status were not. ## Evidence - `lib/mdid_ws_web/controllers/cert_management_controller.ex` (711 lines) — e.g. `process_revocation/1` at :391-436, direct store calls at :220, :352, :596 ## Impact Business rules untestable without the web layer, duplicated patterns, and CA logic mixed with HTTP concerns. ## Fix - [ ] Extract `MdidWs.CertManagement.Revocation` and `Status` contexts - [ ] Controllers only parse/render _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): revocation and status logic moved to Revocation/Status modules; controller is 319 lines (B4).

Verified fixed on main (1b6216b): revocation and status logic moved to Revocation/Status modules; controller is 319 lines (B4).
Sign in to join this conversation.
No description provided.