Batch B5: dead code removal and test gaps (#40–#43) #58

Merged
amiryahaya merged 2 commits from fix/b5-dead-code-tests into main 2026-11-15 16:39:28 +01:00
Owner

Batch B5 — #40, #41, #42 (part), #43.

Removed: Swoosh mailer (module, dep, config, dev mailbox route); CoreComponents, Layouts.app/flash_group/theme_toggle and the inline theme script; NationalIDClient.renewal/2,3; ClientCredentials.list_clients; scripts/verify-issuer.sh; test IO.inspect noise and the certs/-writing test helper.

Fixed along the way

  • :xmerl added to extra_applications (it only arrived transitively via Swoosh; SOAP parsing would fail in a release without it).
  • :invalid_client2 → :invalid_client (internal return value; HTTP responses unchanged).

Added tests: RateLimiter unit tests (lockout threshold, per-IP/client isolation, success reset, lockout expiry + cleanup, window rollover, concurrency), 401 tests for /revoke and /revoke-by-ic, OpenAPI/Swagger smoke tests.

Not done (kept on purpose): daisyUI/heroicons CSS plugins and LiveView socket (no visual check possible here), Renewal.process/2 and data-store wrap_with/exec(:reset) (belong to #36/#37), unreferenced PEM fixtures, script numbering gap. The concurrency test does not fail if the per-identifier lock is removed (race too narrow). #40, #42 stay open.

Verification: mix precommit 318 passed. Coverage: whole app 81.4%; RateLimiter 100%, ClientCredentials 87.1%, NationalIDClient 84.6%. Pass 1 and Pass 2 reviews: no must-fix/critical findings; the minor ones are fixed or listed above (no second Pass 1 after the last test/doc tweaks).

🤖 Generated with Claude Code

Batch B5 — #40, #41, #42 (part), #43. **Removed**: Swoosh mailer (module, dep, config, dev mailbox route); `CoreComponents`, `Layouts.app/flash_group/theme_toggle` and the inline theme script; `NationalIDClient.renewal/2,3`; `ClientCredentials.list_clients`; `scripts/verify-issuer.sh`; test `IO.inspect` noise and the `certs/`-writing test helper. **Fixed along the way** - `:xmerl` added to `extra_applications` (it only arrived transitively via Swoosh; SOAP parsing would fail in a release without it). - `:invalid_client2` → `:invalid_client` (internal return value; HTTP responses unchanged). **Added tests**: RateLimiter unit tests (lockout threshold, per-IP/client isolation, success reset, lockout expiry + cleanup, window rollover, concurrency), 401 tests for `/revoke` and `/revoke-by-ic`, OpenAPI/Swagger smoke tests. **Not done (kept on purpose)**: daisyUI/heroicons CSS plugins and LiveView socket (no visual check possible here), `Renewal.process/2` and data-store `wrap_with`/`exec(:reset)` (belong to #36/#37), unreferenced PEM fixtures, script numbering gap. The concurrency test does not fail if the per-identifier lock is removed (race too narrow). #40, #42 stay open. **Verification**: `mix precommit` 318 passed. Coverage: whole app 81.4%; RateLimiter 100%, ClientCredentials 87.1%, NationalIDClient 84.6%. Pass 1 and Pass 2 reviews: no must-fix/critical findings; the minor ones are fixed or listed above (no second Pass 1 after the last test/doc tweaks). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Removes Swoosh mailer, unused CoreComponents/layout components and theme
script, NationalIDClient.renewal, ClientCredentials.list_clients,
verify-issuer.sh and test debug output; adds :xmerl to extra_applications.
Adds RateLimiter unit tests, revoke 401 tests and OpenAPI smoke tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test/docs: B5 review fixes
All checks were successful
Lint / lint (pull_request) Successful in 1m43s
Security / Dependency advisories (mix hex.audit) (pull_request) Successful in 22s
Security / Secret scan (gitleaks) (pull_request) Successful in 12s
Unit tests / test (pull_request) Successful in 2m37s
110f1e6a07
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.