All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Type Validation Improvements: Resolved TypeAdapter compatibility issues when using the
@throttledecorator with complex Query Parameter extraction scenarios - Query Parameter Handling: Enhanced robustness for nested and multi-type query parameter processing in rate limiting contexts
- Decorator Stability: Improved error handling and type coercion for edge cases in parameter-based key extraction strategies
- Middleware Default Key Extraction: New
default_key_extractionparameter for RateLimitMiddleware - Fallback Key Extraction: New
KeyExtractionType.FALLBACKfor sequential extraction strategies - Helper Functions: Pre-built fallback strategies via
create_auth_header_fallback(),create_api_key_fallback(),create_user_id_fallback() - Enhanced Decorator: New
key_extraction_strategyparameter for@throttledecorator - Flexible Priority System: Route-specific > Middleware default > IP fallback
- Key extraction logic now supports complex fallback scenarios
- Middleware can set default extraction strategy for all routes
- Decorator supports complete KeyExtractionStrategy objects
- Improved documentation with comprehensive fallback examples
- Try multiple extraction methods in sequence (e.g., API key → Auth header → IP)
- Middleware-level defaults that apply to all routes unless overridden
- Route-specific strategies override middleware defaults
- Automatic fallback to IP address if all strategies fail
- Production-ready fallback patterns for authentication scenarios
- Multi-tenant SaaS applications with API key fallbacks
- Authentication-based rate limiting with IP fallbacks
- Complex user identification scenarios
- Graceful degradation for missing headers
0.0.3 - 2024-10-02
- Initial release of fastrict
- Rate limiting middleware for FastAPI applications
- Decorator-based route-specific rate limiting
- Redis backend with sliding window implementation
- Multiple key extraction strategies (IP, headers, query params, custom, combined)
- Built-in rate limiting strategies (short, medium, long-term)
- Bypass functions for conditional rate limiting
- Comprehensive error handling and logging
- Standard HTTP rate limiting headers
- Production-ready performance optimizations
- Clean Architecture implementation
- Comprehensive test suite
- Documentation and examples
- Support for 1K-30K concurrent connections
- Flexible key extraction strategies
- Custom error messages
- Monitoring and metrics support
- Graceful degradation and fallbacks
- Redis cluster support
- Automatic cleanup of expired keys
- Thread-safe operations