Skip to content

5.0.0

Choose a tag to compare

@rennf93 rennf93 released this 26 Mar 01:58
· 42 commits to master since this release
3c537ae

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-core 1.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/, and guard/models.py are replaced by a single guard-core dependency and a new guard/adapters.py bridging Starlette requests/responses to guard-core's protocol.
  • Dependencies trimmedcachetools, httpx, maxminddb, pydantic, redis, requests, and typing-extensions are no longer direct dependencies (they come transitively through guard-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 shiftguard-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**

┌─────────────────────┬────────────────────────────────────────────┬─────────┐
│      FrameworkPackageVersion │
├─────────────────────┼────────────────────────────────────────────┼─────────┤
│ FastAPI / Starlettehttps://github.com/rennf93/fastapi-guard5.0.0   │
├─────────────────────┼────────────────────────────────────────────┼─────────┤
│ Flaskhttps://github.com/rennf93/flaskapi-guard2.0.0   │
├─────────────────────┼────────────────────────────────────────────┼─────────┤
│ Djangohttps://github.com/rennf93/djangoapi-guard2.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