Simple plugin to add Ingenico GCS HMAC authorization header template tag to Insomnia. Largely based based on insomnia-plugin-hash.
On a request to a GCS endpoint,
- Create a
Date
header and set its value to any date following the RFC2822 (GMT) standard (e.g.:Wed, 16 Oct 2019 16:18:47 GMT
).
💡 The correct pattern for an RFC2822 date is
ddd, DD MMM YYYY HH:mm:ss [GMT]
formoment
andddd, dd MMM yyy HH:mm:ss 'GMT'
ondate-fns
.
- Create a
X-GCS-ServerMetaInfo
header and set its value to theServerMetaInfo
information sent by GCS Connect SDK. This is an invariant,base64
encoded payload (i.e.: always the same value on a given environment). You can inspect this value from request logs (setenableLogging: true
when initializing aconnect-sdk-nodejs
instance). Alternative, you can create it yourself - see here for understanding what it contains and how it can be built. - Create an
Authorization
header. - Use
^
+Space
(orCtrl
+Space
) to create a tag on theAuthorization
header value and select GCSHMAC. - Fill in requested plugin values.
Due to a current Insomnia limitation, it is not possible for tag plugins to render other tags - this means that the value of Date
cannot be set by another tag plugin, such as Timestamp and must be defined manually.
Made with 💛 by Flybondi.