aporat/laravel-auth-signature
Laravel middleware that authenticates incoming HTTP requests using signed signatures, letting you verify request integrity and identity without exposing credentials on each call.
Http::withSignature($clientId, $authVersion, $secret) macro signs at send time over the final method, path, query string and JSON/form body, reusing the same SignatureGenerator the validator verifies against. One shared primitive for both signing and verifying removes the most common class of integration bug (client and server canonicalizing differently) and makes "adopt signed service calls" a shippable roadmap item rather than a research spike.php artisan auth-signature:sign --curl emits a ready-to-run curl command for a given request; --debug/-v prints the exact canonical string being signed, with secrets never printed. This converts partner onboarding from "read the spec and guess" into "run one command and paste it." Budget impact: lower support load per integration and shorter time-to-first-successful-call — a measurable onboarding KPI.SignatureGenerator::generate() now accepts an optional $secret override, so one process can sign on behalf of multiple clients/tenants without reconfiguring the singleton. This is the enabling primitive for per-partner credentials, staged secret rotation (sign with new secret while old is still accepted during overlap), and delegated/on-behalf-of signing. Decide now whether rotation is in scope for the next quarter — the package now supports it, but the acceptance-window and secret-storage work is yours.bootstrap/app.php snippet to map them to their proper 4xx codes. Treat this as a pre-GA checklist item, not documentation trivia: unmapped failures pollute 5xx SLOs and alerting, inflate error budgets, and can trigger incident pages for what is actually a client bug. If signature validation is on a customer-facing or revenue path, "4xx mapping configured and verified in staging" should be an explicit exit criterion.RequestSigner (PSR-7) plus stringToSign() mean support engineers can reproduce a failing signature deterministically instead of instrumenting production. Lower MTTR on integration incidents, and a cheaper path to a "why did this request fail?" admin/diagnostic view if you ever want one.illuminate/http, illuminate/routing, illuminate/console and guzzlehttp/guzzle are now declared explicitly (less chance of transitive-version surprises), and the published archive no longer ships tests, CI config or dev tooling — smaller vendor footprint in your build artifacts. CI now actually installs the Laravel version each job claims, and end-to-end route tests were added: modest but real evidence that the compatibility matrix means something.Adopt when most of the following hold:
Look elsewhere — or plan significant additional build — when:
PHPUnit ^11 || ^12 and Laravel version matrix match your CI before betting a critical path on it.For executives (one paragraph): We're evaluating a small Laravel package that lets our services and partners cryptographically sign API requests and verify them on the other side. The new release is the meaningful one: previously it only checked signatures, so every caller had to hand-roll the signing logic; now the same library signs outgoing calls, provides a one-line CLI that generates a ready-to-run curl command for partners, and can sign on behalf of multiple clients with different secrets. Practically, that shortens partner onboarding, removes a recurring class of "signature mismatch" support tickets, and makes a standard for internal service-to-service calls achievable this quarter instead of as a bespoke build. Two caveats we should own rather than inherit: signature failures currently surface as HTTP 500 and need a small config change to return proper 4xx (otherwise they distort our error rates and on-call alerts), and replay protection is limited to a 5-minute timestamp window, which security needs to sign off on for anything high-value. Recommendation: pilot on one internal integration with the 4xx mapping in place, then decide on broader adoption.
For engineering (the ask):
Http::withSignature() macro and RequestSigner as the only signing path; do not hand-roll canonicalization anywhere. That's what keeps client and server verifiably in sync via stringToSign().bootstrap/app.php exception mapping in the same PR as adoption — signature failures must be 4xx, and we want a test asserting that.How can I help you explore Laravel packages today?