Skip to content

Add test coverage for ScanRateLimiter._make_key#1693

Open
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1693
Open

Add test coverage for ScanRateLimiter._make_key#1693
tmdeveloper007 wants to merge 1 commit into
utksh1:mainfrom
tmdeveloper007:#1693

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Problem

ScanRateLimiter._make_key in backend/secuscan/rate_limiter.py builds Redis key strings for per-IP rate-limit buckets. No direct unit tests exist for it.

Fix

  1. Extract RateLimiterKeyBuilder.make_key into backend/secuscan/ratelimit_helpers.py.
  2. Write 7 unit tests covering IP variants, window types, edge cases, and key format.
  3. Update rate_limiter.py to re-export from the new module.

Acceptance Criteria

  • New ratelimit_helpers.py created with RateLimiterKeyBuilder.make_key.
  • 7 tests pass locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant