Search by

mk-josias / laravel-microservices-rpc-http

mk-josias

HTTP driver for the RPC of mk-josias/laravel-microservices: signed calls between services, one endpoint per service.

Package info

github.com/mk-josias/laravel-microservices-rpc-http

pkg:composer/mk-josias/laravel-microservices-rpc-http

Statistics

Installs: 15

Dependents: 1

Suggesters: 2

Stars: 0

Open Issues: 0

v0.1.0 2026-10-11 19:52 UTC

This package is auto-updated.

Last update: 2026-10-11 20:33:01 UTC


README

The http RPC driver of laravel-microservices: signed calls between services.

composer require mk-josias/laravel-microservices-rpc-http

Its provider is discovered. It registers the driver of the shipped http transport, and serves POST {service}/rpc/{method} for each service this process runs. It reads these keys of config/microservices.php:

'rpc' => [
    'path' => env('MICROSERVICES_RPC_PATH', '{service}/rpc/{method}'), // the same in every service
    'middleware_group' => 'rpc',                                      // the group of those routes, which checks the signature
    'secret' => env('MICROSERVICES_RPC_SECRET', env('APP_KEY', '')),  // shared by caller and called
    'signature_ttl' => 30,                                            // seconds a signature stays valid
],
What it guarantees
Signed an HMAC of the timestamp, a nonce, the path, the body and the propagated context
Fresh a call older than signature_ttl is rejected
Once each nonce is accepted once, through the cache
Answers 200 the return value as JSON · 404 null · 400 no such contract or method · 403 bad signature

What a service written in another language has to send is in Services in other languages.