I have set up a webhook from Shipmondo and added a secret key (they won't let you create a WH without one):
Receiving the message in Node-RED, the payload is encrypted.
I now need to decrypt the payload. I have tried using node-red-contrib-auth
with the following guide but the result is still encrypted.
Here is the flow:
{"_msgid":"9402f88c6802448e","payload":{"data":"eyJhbGciOiJIUzI1NiJ9.IntcImFjdGlvblwiOlwiY29ubmVjdGlvbl90ZXN0XCIsXCJkYXRhXCI6e319Ig.Z4uoPKAYB9Mze_amXlttnzDC3aip3SqOy4yex-pFemc"},"req":{"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":null,"tail":null,"length":0},"length":0,"pipes":[],"flowing":true,"ended":true,"endEmitted":true,"reading":false,"sync":false,"needReadable":false,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":true,"autoDestroy":false,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"dataEmitted":true,"decoder":null,"encoding":null},"_events":{},"_eventsCount":1,"socket":"[internal]","httpVersionMajor":1,"httpVersionMinor":1,"httpVersion":"1.1","complete":true,"headers":{"connection":"close","host":"a1.confluent.as","x-forwarded-scheme":"https","x-forwarded-proto":"https","x-forwarded-for":"34.240.195.248","x-real-ip":"34.240.195.248","content-length":"138","smd-resource-type":"Shipments","smd-webhook-name":"test","smd-action":"create","smd-user":"Sileco AS","content-type":"application/json","accept-encoding":"gzip;q=1.0,deflate;q=0.6,identity;q=0.3","accept":"*/*","user-agent":"Ruby","x-newrelic-id":"UwYHVVBQGwcCUFBQBgg=","x-newrelic-transaction":"PxQOWF8HXANTVQBTA1IHVwEFFB8EBw8RVU4aWwEBUFYDBggAAFVQUlVTA0NKQQEFU1dQUgFVFTs="},"rawHeaders":["Connection","close","Host","a1.confluent.as","X-Forwarded-Scheme","https","X-Forwarded-Proto","https","X-Forwarded-For","34.240.195.248","X-Real-IP","34.240.195.248","Content-Length","138","Smd-Resource-Type","Shipments","Smd-Webhook-Name","test","Smd-Action","create","Smd-User","Sileco AS","Content-Type","application/json","Accept-Encoding","gzip;q=1.0,deflate;q=0.6,identity;q=0.3","Accept","*/*","User-Agent","Ruby","X-Newrelic-Id","UwYHVVBQGwcCUFBQBgg=","X-Newrelic-Transaction","PxQOWF8HXANTVQBTA1IHVwEFFB8EBw8RVU4aWwEBUFYDBggAAFVQUlVTA0NKQQEFU1dQUgFVFTs="],"trailers":{},"rawTrailers":[],"aborted":false,"upgrade":false,"url":"/whtest","method":"POST","statusCode":null,"statusMessage":null,"client":"[internal]","_consuming":true,"_dumped":false,"baseUrl":"","originalUrl":"/whtest","_parsedUrl":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":null,"query":null,"pathname":"/whtest","path":"/whtest","href":"/whtest","_raw":"/whtest"},"params":{},"query":{},"res":"[internal]","body":{"data":"eyJhbGciOiJIUzI1NiJ9.IntcImFjdGlvblwiOlwiY29ubmVjdGlvbl90ZXN0XCIsXCJkYXRhXCI6e319Ig.Z4uoPKAYB9Mze_amXlttnzDC3aip3SqOy4yex-pFemc"},"_body":true,"_passport":{"instance":{"_key":"passport","_strategies":{"session":{"name":"session","_key":"passport"},"bearer":{"name":"bearer","_realm":"Users"},"oauth2-client-password":{"name":"oauth2-client-password"},"anon":{"name":"anon"},"tokens":{"name":"tokens"}},"_serializers":[],"_deserializers":[],"_infoTransformers":[],"_framework":{},"_sm":{"_key":"passport"},"strategies":{},"_userProperty":"user"}},"route":{"path":"/whtest","stack":[{"name":"cookieParser","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"httpMiddleware","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"corsHandler","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"metricsHandler","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"jsonParser","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"urlencodedParser","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"multipartParser","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"rawBodyParser","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"<anonymous>","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"},{"name":"<anonymous>","keys":[],"regexp":{"__enc__":true,"type":"regexp","data":"/^\\/?$/i"},"method":"post"}],"methods":{"post":true}},"cookies":{},"signedCookies":{}},"res":{},"token":{"access_token":"eyJhbGciOiJIUzI1NiJ9.IntcImFjdGlvblwiOlwiY29ubmVjdGlvbl90ZXN0XCIsXCJkYXRhXCI6e319Ig.Z4uoPKAYB9Mze_amXlttnzDC3aip3SqOy4yex-pFemc"},"error":{"message":"TypeError: jwtString.split is not a function","code":"general"}}
The key to decrypt the message is whtest1234
.
Can anyone help me find a working method to decrypt the payload?