Releases: devbijay/FastAPI-Cap
Releases · devbijay/FastAPI-Cap
V0.2.0
This release brings significant enhancements to fastapicap, focusing on improved flexibility, robustness, and comprehensive documentation.
New Features:
- Advanced Guide: Added a comprehensive guide for advanced usage, focusing on dependency injection for rate limiting.
- Middleware Support: Introduced middleware support for global rate limiting.
- Tox Integration: Added tox configuration for improved testing across different Python environments.
Improvements:
- Enhanced Default Key Function: The default key function now uses endpoint metadata for better identification.
- Clearer Limiter Identification: Limiter instances now append their strategy name to Redis keys for easier distinction and debugging
Bug Fixes:
- Distributed System Compatibility: Fixed a critical bug by removing _instance_id from limiters, resolving issues when applying multiple limiters in distributed environments.
- Middleware Test Coverage: Added comprehensive tests for the new RateLimitMiddleware to ensure its stability and correctness.
- Test Reliability: Addressed and fixed issues in unit tests related to request scope and ensured distinct prefixes are used in tests to prevent conflicts.
Documentation & Formatting:
- Updated docs/quickstart.md with the latest information and best practices.
- Revised README.md for clarity and accuracy.
- Applied general code formatting and style consistency improvements.
V0.1.0: Initial release
🎉 Highlights
- First public release of FastAPI-Cap: a robust, extensible, and production-ready rate limiting library for FastAPI, powered by Redis and Lua scripting.
✨ Features
- Multiple Rate Limiting Algorithms:
- Fixed Window
- Sliding Window (Approximated)
- Sliding Window (Log-based)
- Token Bucket
- Leaky Bucket
- GCRA (Generic Cell Rate Algorithm)
- Easy FastAPI Integration:
Use as dependencies or decorators for seamless route protection. - Customizable:
Plug in your own key extraction and limit handling logic. - Distributed & High Performance:
All strategies are backed by Redis and atomic Lua scripts for consistent, scalable enforcement. - Developer Friendly:
Type hints, async support, and clear error messages.