Skip to content

v1.0.0

Choose a tag to compare

@rennf93 rennf93 released this 23 Sep 23:26
· 61 commits to master since this release
v1.0.0
7fd3cc5

First stable release of psr15-guard, the PSR-15 middleware adapter for guard-core-php 4.0.4.

Added

  • PSR-15 middleware adapter for guard-core-php 4.0.4. GuardMiddleware translates any PSR-7 ServerRequestInterface into the guard-core engine (RenzoFranceschini\GuardCore\Engine\GuardEngine) and translates block verdicts back to PSR-7 responses, so the guard works with Slim 4, Mezzio, Symfony PSR-15 bridges, or any PSR-7/PSR-15 stack.
  • Exact block translation. Blocked requests get the engine's BlockResponse translated status-for-status, body-for-body and header-for-header: 403 Forbidden for a blacklisted IP, 429 Too many requests with Retry-After for a rate limit hit. Passing requests continue down the stack untouched.
  • Fail-closed behavior. If the engine throws, the middleware returns the engine's fail-closed response (500 Security check failed, honorably overridden by customErrorResponses) instead of letting the request through.
  • Bounded body read. The request body is scanned as a prefix of at most 256 KiB (PsrGuardRequest::MAX_BODY_BYTES, matching the engine's full-scan window).
  • Distributed state via Redis. Distributed rate limits, IP bans, and cloud-range caches require Redis (enableRedis: true); redisFailOpen: true keeps serving when Redis is unreachable, false fails closed at construction.

Changed

  • The engine dependency is pinned to rennf93/guard-core-php ^4.0.4, the first stable engine release, replacing the ^0.1.0 pin to the burned pre-release snapshot tag.

Internal (v1.0.0)

  • Plain-PHP test suite in bin/test_psr15.php (unit coverage always; Redis-backed shared-state integration cases run when REDIS_HOST points at a reachable Redis), plus a php -l sweep and composer audit in CI across PHP 8.2, 8.3 and 8.4.
  • Community workflows, a MkDocs documentation site, and simple and advanced example apps landed via the parity-polish pass.