Repository navigation
v1.0.0
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.
GuardMiddlewaretranslates any PSR-7ServerRequestInterfaceinto 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
BlockResponsetranslated status-for-status, body-for-body and header-for-header:403 Forbiddenfor a blacklisted IP,429 Too many requestswithRetry-Afterfor 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 bycustomErrorResponses) 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: truekeeps serving when Redis is unreachable,falsefails 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.0pin 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 whenREDIS_HOSTpoints at a reachable Redis), plus aphp -lsweep andcomposer auditin 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.