[loggi-71e] Replace hand-rolled rate limiter in check_username with Flask-Limiter #119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Bead ID:
loggi-71eType: task
Priority: P2
Status: closed
Close reason: Replaced hand-rolled in-memory rate limiter (_username_check_log dict + time.monotonic()) in routes.py check_username() with @limiter.limit('10 per minute') decorator using Flask-Limiter already in use for auth endpoints. Removed ~16 lines of dead code + unused time import. Updated test to use rl_app fixture from test_rate_limit.py. All 172 tests pass.
routes.py check_username() uses a custom in-memory rate limiter (_username_check_log dict + time.monotonic()) but Flask-Limiter is already configured and used in auth.py. The hand-rolled version is fragile (per-process, doesn't work with multiple workers) and creates a redundant pattern. Replace with @limiter.limit() decorator and remove the dead code (~10 lines + unused time import).