release: bump version to 0.3.0
- Refactor Redis backend connection handling and pool management - Update algorithm implementations with improved type annotations - Enhance config loader validation with stricter Pydantic schemas - Improve decorator and middleware error handling - Expand example scripts with better docstrings and usage patterns - Add new 00_basic_usage.py example for quick start - Reorganize examples directory structure - Fix type annotation inconsistencies across core modules - Update dependencies in pyproject.toml
This commit is contained in:
91
docs/changelog.rst
Normal file
91
docs/changelog.rst
Normal file
@@ -0,0 +1,91 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
All notable changes to FastAPI Traffic are documented here.
|
||||
|
||||
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.1.0/>`_,
|
||||
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
|
||||
|
||||
[0.2.1] - 2026-03-07
|
||||
--------------------
|
||||
|
||||
Changed
|
||||
^^^^^^^
|
||||
|
||||
- Improved config loader validation using Pydantic schemas
|
||||
- Added pydantic>=2.0 as a core dependency
|
||||
- Fixed sync wrapper in decorator to properly handle rate limiting
|
||||
- Updated pyright settings for stricter type checking
|
||||
- Fixed repository URL in pyproject.toml
|
||||
|
||||
Removed
|
||||
^^^^^^^
|
||||
|
||||
- Removed unused main.py
|
||||
|
||||
[0.2.0] - 2026-02-04
|
||||
--------------------
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
- **Configuration Loader** — Load rate limiting configuration from external files:
|
||||
|
||||
- ``ConfigLoader`` class for loading ``RateLimitConfig`` and ``GlobalConfig``
|
||||
- Support for ``.env`` files with ``FASTAPI_TRAFFIC_*`` prefixed variables
|
||||
- Support for JSON configuration files
|
||||
- Environment variable loading with ``load_rate_limit_config_from_env()`` and ``load_global_config_from_env()``
|
||||
- Auto-detection of file format with ``load_rate_limit_config()`` and ``load_global_config()``
|
||||
- Custom environment variable prefix support
|
||||
- Type validation and comprehensive error handling
|
||||
- 47 new tests for configuration loading
|
||||
|
||||
- Example ``11_config_loader.py`` demonstrating all configuration loading patterns
|
||||
- ``get_stats()`` method to ``MemoryBackend`` for consistency with ``RedisBackend``
|
||||
- Comprehensive test suite with 134 tests covering:
|
||||
|
||||
- All five rate limiting algorithms with timing and concurrency tests
|
||||
- Backend tests for Memory and SQLite with edge cases
|
||||
- Decorator and middleware integration tests
|
||||
- Exception handling and configuration validation
|
||||
- End-to-end integration tests with FastAPI apps
|
||||
|
||||
- ``httpx`` and ``pytest-asyncio`` as dev dependencies for testing
|
||||
|
||||
Changed
|
||||
^^^^^^^
|
||||
|
||||
- Improved documentation in README.md and DEVELOPMENT.md
|
||||
- Added ``asyncio_default_fixture_loop_scope`` config for pytest-asyncio compatibility
|
||||
|
||||
[0.1.0] - 2025-01-09
|
||||
--------------------
|
||||
|
||||
Initial release.
|
||||
|
||||
Added
|
||||
^^^^^
|
||||
|
||||
- Core rate limiting with ``@rate_limit`` decorator
|
||||
- Five algorithms:
|
||||
|
||||
- Token Bucket
|
||||
- Sliding Window
|
||||
- Fixed Window
|
||||
- Leaky Bucket
|
||||
- Sliding Window Counter
|
||||
|
||||
- Three storage backends:
|
||||
|
||||
- Memory (default) — In-memory with LRU eviction
|
||||
- SQLite — Persistent storage with WAL mode
|
||||
- Redis — Distributed storage with Lua scripts
|
||||
|
||||
- Middleware support for global rate limiting via ``RateLimitMiddleware``
|
||||
- Dependency injection support with ``RateLimitDependency``
|
||||
- Custom key extractors for flexible rate limit grouping (by IP, API key, user, etc.)
|
||||
- Configurable exemptions with ``exempt_when`` callback
|
||||
- Rate limit headers (``X-RateLimit-Limit``, ``X-RateLimit-Remaining``, ``X-RateLimit-Reset``)
|
||||
- ``RateLimitExceeded`` exception with ``retry_after`` and ``limit_info``
|
||||
- Full async support throughout
|
||||
- Strict type hints (pyright/mypy compatible)
|
||||
Reference in New Issue
Block a user