You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(rate-limit): implement comprehensive rate limiting and listen validation
Add multi-tier rate limiting system with IP-based tracking for anonymous users and user-based tracking for authenticated users. Implements global request limits (150 req/min, 10 req/10sec burst) and song-specific listen validation including duration-based cooldowns.
Key changes:
- Add ListenValidator for validating listen requests before recording
- Implement global rate limit middleware with minute and burst protection
- Add RateLimited error variant with retry_after_secs support
- Extract song/album fetching logic from listen methods for validation
- Add ConnectInfo extraction for IP-based rate limiting
- Update comprehensive README with features, setup, and API documentation
The rate limiting prevents abuse while allowing normal usage patterns, with authenticated users receiving more generous limits than anonymous users.
0 commit comments