ibrows/hmac-bundle
ibrows/hmac-bundle provides HMAC-based authentication for Symfony/PHP applications, letting you sign and verify requests with shared secrets to secure APIs and protect endpoints from tampering and unauthorized access.
hash_hmac, hash_equals, and a Redis nonce store) that owning an internal implementation is almost certainly cheaper than carrying a dependency. Zero stars, zero dependents, and a score of 0 reinforce the build side of that call.kid-style rotation window. That gap is a product requirement to fund early, not a detail to retrofit after clients ship.Consider it only when:
IbrowsHmacBundle, a Symfony bundle (a Bundle subclass plus a DI extension registered in AppKernel/bundles.php), not a Laravel package. It is only directly relevant if you have inherited it as a dependency and need to understand, audit, or replace it.Look elsewhere, or build in-house, when:
symfony/framework-bundle requirement inside a Laravel app is not a viable path. Any "integration" is really a port of the signing logic into middleware and a service provider, after which the package is discarded.ContainerAware, non-hash_equals comparison, possibly weak default digests) until verified against PHP 8.2+/Symfony 6/7.clientId → secret map with rotation, the single-secret configuration model does not fit.To executives: This is an MIT-licensed implementation of HMAC request signing — a standard, well-understood way to authenticate server-to-server and partner API traffic. It is not a dependency we should adopt: no meaningful adoption, no visible maintenance, no security disclosure path, and it targets Symfony rather than our Laravel stack. The recommendation is to treat it as a design reference and fund a small internal implementation of the same pattern — roughly a day or two of engineering plus tests. That keeps security review, key rotation, and ownership in-house at negligible cost, and avoids converting a few hundred lines of code into a permanent fork-and-patch obligation. The real project cost is not the server-side code; it is client onboarding — signing docs and SDK snippets for integrators — and that budget is needed either way.
To engineering: Use it as a pattern reference, not a dependency. Read it for canonical request construction (method, path, timestamp, nonce, body digest), header conventions, and replay-window handling — then implement natively in Laravel: a Signer service, a VerifyHmacSignature middleware bound to a route group, hash_equals for comparison, raw-body hashing before request parsing, a kid header for key rotation, and Redis with TTL for the nonce store. Three things carry all the risk and deserve explicit decisions: (1) canonicalization — field ordering, encoding, duplicate and empty query params, empty and chunked bodies; mismatches here cause nearly all 401s; (2) fail-open vs. fail-closed when the nonce store is unavailable — default to fail-closed on write paths and document it; (3) route coverage — a test asserting every public route carries the middleware, so a route registered outside the protected group cannot silently bypass auth. Pin fixed sign+verify test vectors so any change to header names or field order breaks loudly. Roll out in shadow/log-only mode on one low-risk endpoint before enforcing. Also note the wire format only needs to match this bundle if we already run Symfony services that must interoperate — if not, standardize on our own documented scheme (Stripe/Svix-style) and implement once.
How can I help you explore Laravel packages today?