Lukas
a273b96563
feat: Complete repository protocol coverage
- Add missing protocol methods to Fail2BanDbRepository:
- get_ban_event_counts: Aggregate ban events per IP (used in ban_service)
- Add missing protocol methods to GeoCacheRepository:
- delete_stale_entries: Remove old geo cache entries (used in geo_cache_cleanup)
- Add missing protocol methods to HistoryArchiveRepository:
- purge_archived_history: Remove archived entries older than age threshold
- Add comprehensive protocol compliance tests:
- Created test_protocol_compliance.py with 8 test classes
- Validates all 7 repository modules fully implement their protocols
- Prevents silent protocol drift when methods change signatures
- Tests verify no unexpected public methods in repository modules
- Update documentation:
- Add Repository Protocol Coverage Checklist to Backend-Development.md
- Document procedure for adding new repositories with protocol definitions
- List current protocol coverage (all 7 repositories, 40 total methods)
- All repositories now have 100% protocol coverage:
- SessionRepository: 4 methods
- SettingsRepository: 4 methods
- BlocklistRepository: 6 methods
- ImportLogRepository: 4 methods
- GeoCacheRepository: 13 methods
- HistoryArchiveRepository: 5 methods
- Fail2BanDbRepository: 8 methods
This ensures:
- Enhanced mockability for testing
- Static contract verification
- Prevention of protocol drift
- Better IDE support and type checking
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-28 07:58:57 +02:00
..
2026-04-28 07:58:57 +02:00
2026-04-25 18:59:49 +02:00
2026-04-28 07:58:57 +02:00
2026-04-06 20:47:31 +02:00
2026-02-28 21:50:37 +01:00
2026-04-05 22:48:33 +02:00