5.0.0
FastAPI Guard 5.0.0 — guard-core Migration
FastAPI Guard is now a thin adapter over guard-core, the framework-agnostic security engine that also powers flaskapi-guard and djangoapi-guard.
What changed
- All security logic moved to guard-core — 17 security checks, 8 handlers, the detection engine, and suspicious pattern analysis now live in a shared engine (
guard-core1.0.0). This package provides only the FastAPI/Starlette integration layer. - ~31,000 lines removed, ~900 added — the entire
guard/core/,guard/handlers/,guard/detection_engine/,guard/protocols/, andguard/models.pyare replaced by a singleguard-coredependency and a newguard/adapters.pybridging Starlette requests/responses to guard-core's protocol. - Dependencies trimmed —
cachetools,httpx,maxminddb,pydantic,redis,requests, andtyping-extensionsare no longer direct dependencies (they come transitively throughguard-core).
Zero breaking changes to the public API
All existing imports continue to work exactly as before:
from guard.middleware import SecurityMiddleware
from guard.models import SecurityConfig
from guard import SecurityDecorator, RouteConfig, IPBanManager, RateLimitManager
**Why v5.0.0**
The major version bump reflects the architectural shift — guard-core is now a required dependency, and internal modules (guard.core.*, guard.handlers.*, guard.detection_engine.*) no longer exist. If you only used the public API, no migration is needed.
**One engine, three frameworks**
┌─────────────────────┬────────────────────────────────────────────┬─────────┐
│ Framework │ Package │ Version │
├─────────────────────┼────────────────────────────────────────────┼─────────┤
│ FastAPI / Starlette │ https://github.com/rennf93/fastapi-guard │ 5.0.0 │
├─────────────────────┼────────────────────────────────────────────┼─────────┤
│ Flask │ https://github.com/rennf93/flaskapi-guard │ 2.0.0 │
├─────────────────────┼────────────────────────────────────────────┼─────────┤
│ Django │ https://github.com/rennf93/djangoapi-guard │ 2.0.0 │
└─────────────────────┴────────────────────────────────────────────┴─────────┘
All three share the same security engine, ensuring consistent behavior across frameworks.
**Full Changelog**: https://github.com/rennf93/fastapi-guard/compare/4.4.1...5.0.0