kinetis / bref-adapter
AWS Lambda (Bref) runtime adapter for Kinetis — polls the Lambda Runtime API and converts API Gateway v2 payloads to/from PSR-7.
Requires
- php: ^8.4
- kinetis/framework: ^1.8.1
- nyholm/psr7: ^1.8.2
- psr/http-message: ^2.0
Requires (Dev)
- infection/infection: ^0.35.0
- phpstan/phpstan: ^2.2.8
- phpunit/phpunit: ^13.3.3
- vimeo/psalm: ^6.17
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
kinetis/bref-adapter
AWS Lambda (Bref) runtime adapter for Kinetis
Part of Kinetis, a non-blocking PHP framework for API-first applications, developed in the kinetis-dev/kinetis monorepo.
Polls the Lambda Runtime API and converts API Gateway v2 payloads to and from PSR-7.
The request's identity is rebuilt from one authoritative field each —
requestContext.domainName for the host, the forwarded headers for the
scheme and port, rawPath/rawQueryString for the request target — so
the URI, the Host header and the request target cannot disagree; an
event where they do is reported as an invocation error rather than
dispatched. An event whose header map names one header under two
spellings is refused too — an ambiguity resolved by key order is not an
identity anything downstream can rely on.
The body is handed on as raw PSR-7 bytes. Core's own
RequestBodyMiddleware stages it, holds it to
Kinetis\Http\Form\FormLimits and parses a form under
Kinetis\Http\Form\MultipartEnvelope's wire-level multipart contract —
the same ceilings, the same refusals and the same statuses every other
runtime delivers its bodies to. Those apply after delivery: API Gateway
has already accepted the request and materialized its body, up to the
platform's own 6 MB invocation payload limit, before this package runs.
There's nothing to configure or call directly: install the package, and
RuntimeDetector picks it up automatically the moment AWS_LAMBDA_RUNTIME_API
is set in the environment, alongside the two adapters that already ship in
core.
composer require kinetis/bref-adapter
Requires PHP 8.4+ and kinetis/framework. See
Runtime Adapters for how
runtime detection works, what changes under Lambda specifically, the
form-body contract's own numbers, and exactly which event fields are
validated and how a malformed one is reported.
License
MIT — see LICENSE.