I have 2 nodejs microservices (let call them service x and service y). In service x, I will be making POST requests to service y.
Lets say service x will POST at this HTTPs endpoint in service y: /order/orderId
I think of service x as a webhooks producer, and service y to be webhooks consumer.
I want service y to be able to ensure that the message is coming from service x, and not from any malicious source. For this to work, I want to sign requests within service x before it makes POST request to service y.
What options do I have to sign these requests? How can I sign these reqeusts in service x, and how do I validate these requests in service y? Also what signing/encryption options do I have?
Concrete code examples in nodejs will be of great help.