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, including multipart/form-data support.
Requires
- php: ^8.4
- kinetis/framework: ^1.4.0
- nyholm/psr7: ^1.8.2
- psr/http-message: ^2.0
- riverline/multipart-parser: ^2.2.2
Requires (Dev)
- infection/infection: ^0.35.0
- phpstan/phpstan: ^2.2.8
- phpunit/phpunit: ^12.5.33
- vimeo/psalm: ^6.16.1
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/from
PSR-7, including multipart/form-data support — the one piece Lambda
specifically needs that core's FrankenPhpAdapter/FpmAdapter don't.
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. Form bodies are held to Kinetis\Http\Form\FormLimits, the
same ceilings core applies under every other runtime, and to
Kinetis\Http\Form\MultipartEnvelope's wire-level multipart contract,
which runs before riverline/multipart-parser expands anything. That
matters more here than anywhere else: there is no SAPI at all, so the
framework's own contract is the whole defense. 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.
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.