fastapi-guard 7.2.2__tar.gz → 7.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ version_selector: true
2
2
  title_switch: true
3
3
  versions_file: docs/versions/versions.json
4
4
  versions:
5
+ - 7.3.0
5
6
  - 7.2.2
6
7
  - 7.2.1
7
8
  - 7.2.0
@@ -48,4 +49,4 @@ versions:
48
49
  - 0.3.2
49
50
  - latest
50
51
  aliases:
51
- latest: 7.2.2
52
+ latest: 7.3.0
@@ -3,6 +3,19 @@ Release Notes
3
3
 
4
4
  ___
5
5
 
6
+ v7.3.0 (2026-07-15)
7
+ -------------------
8
+
9
+ Security pipeline assembly delegated to guard-core's check factory (v7.3.0)
10
+ ---------------------------------------------------------------------------------
11
+
12
+ - **Changed** — The security pipeline is now assembled by guard-core's `build_default_pipeline()`. New guard-core checks are picked up automatically; the middleware no longer hand-lists check classes.
13
+ - **Compatibility (behavior change from guard-core 3.5.0)** — Global IP whitelist/blacklist and country rules now apply on routes carrying per-route decorator config; previously any decorated route silently bypassed every global IP and country rule. A client outside a configured global `whitelist` now receives `403` on decorated routes that previously served it. A route-level `@ip_whitelist` now grants access only, not trust: the matched request is still rate-limited, user-agent-filtered, cloud-provider-checked, attack-scanned, and country-checked, while global `whitelist` membership still confers full trust. The IP and country aspects are evaluated independently — a route `@ip_whitelist` match does not bypass country rules; only a route `@whitelist_countries` match overrides the global country gate. See the guard-core 3.5.0 changelog for the full description and migration guidance.
14
+ - **Tests** — The decorator test suite now exercises the rate-limiting, user-agent, and suspicious-activity decorators through the enforced security pipeline using a non-whitelisted client, with explicit coverage for the new decorated-route `403` behavior and for a route `@ip_whitelist` client still being rate-limited. Previously these tests sent requests from a globally-whitelisted address, so the security pipeline short-circuited and the decorator logic was never exercised.
15
+ - **Requires** — `guard-core>=3.5.0` (declared as unconstrained `guard-core` in pyproject; documented here for upgrade guidance). The pipeline factory (`build_default_pipeline`) and the decorated-route IP/country enforcement this release relies on ship in guard-core 3.5.0; installing against an older guard-core fails at middleware initialization with an `ImportError`.
16
+
17
+ ___
18
+
6
19
  v7.2.2 (2026-07-01)
7
20
  -------------------
8
21
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi_guard
3
- Version: 7.2.2
3
+ Version: 7.3.0
4
4
  Summary: Production-ready security middleware for FastAPI — IP filtering, rate limiting, penetration detection, and 20+ per-route security decorators.
5
5
  Project-URL: Homepage, https://guard-core.com
6
6
  Project-URL: Documentation, https://rennf93.github.io/fastapi-guard/latest/
@@ -242,51 +242,13 @@ class SecurityMiddleware(BaseHTTPMiddleware):
242
242
  return {"enabled": True, "degraded": self.agent_degraded, **handler_stats}
243
243
 
244
244
  def _build_security_pipeline(self) -> None:
245
- from guard_core.core.checks import (
246
- AuthenticationCheck,
247
- CloudIpRefreshCheck,
248
- CloudProviderCheck,
249
- CustomRequestCheck,
250
- CustomValidatorsCheck,
251
- EmergencyModeCheck,
252
- HttpsEnforcementCheck,
253
- IpSecurityCheck,
254
- RateLimitCheck,
255
- ReferrerCheck,
256
- RequestLoggingCheck,
257
- RequestSizeContentCheck,
258
- RequiredHeadersCheck,
259
- RouteConfigCheck,
260
- SecurityCheckPipeline,
261
- SuspiciousActivityCheck,
262
- TimeWindowCheck,
263
- UserAgentCheck,
264
- )
245
+ from guard_core.core.checks import build_default_pipeline
265
246
 
266
- checks = [
267
- RouteConfigCheck(self),
268
- EmergencyModeCheck(self),
269
- HttpsEnforcementCheck(self),
270
- RequestLoggingCheck(self),
271
- RequestSizeContentCheck(self),
272
- RequiredHeadersCheck(self),
273
- AuthenticationCheck(self),
274
- ReferrerCheck(self),
275
- CustomValidatorsCheck(self),
276
- TimeWindowCheck(self),
277
- CloudIpRefreshCheck(self),
278
- IpSecurityCheck(self),
279
- CloudProviderCheck(self),
280
- UserAgentCheck(self),
281
- RateLimitCheck(self),
282
- SuspiciousActivityCheck(self),
283
- CustomRequestCheck(self),
284
- ]
285
-
286
- self.security_pipeline = SecurityCheckPipeline(checks)
247
+ pipeline = build_default_pipeline(self)
248
+ self.security_pipeline = pipeline
287
249
  self.logger.info(
288
- f"Security pipeline initialized with {len(checks)} checks: "
289
- f"{self.security_pipeline.get_check_names()}"
250
+ f"Security pipeline initialized with {len(pipeline)} "
251
+ f"checks: {pipeline.get_check_names()}"
290
252
  )
291
253
 
292
254
  def _configure_security_headers(self, config: SecurityConfig) -> None:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fastapi_guard"
3
- version = "7.2.2"
3
+ version = "7.3.0"
4
4
  description = "Production-ready security middleware for FastAPI — IP filtering, rate limiting, penetration detection, and 20+ per-route security decorators."
5
5
  authors = [
6
6
  {name = "Renzo Franceschini", email = "rennf93@users.noreply.github.com"}
File without changes
File without changes
File without changes
File without changes
File without changes