Skip to content

An insomnia plugin to simplify x-square-signature header when testing square webhook endpoints

License

Notifications You must be signed in to change notification settings

shanehandley-lt/square-signature-hmac-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

square-signature-hmac-plugin

This is an insomnia plugin for testing endpoints that respond to Square webhook POST requests and perform request signature verification.

Rationale

If the endpoint under test is performing signature verification, it can be difficult to post test data to verify correct behaviour, as there is no simple mechanism to ensure that the request is signed according to square's hmac-based url + requestbody scheme.

This plugin can generate a correct signature based on the request body (when provided a valid key) which can be used as the x-square-signature header to satisfy signature verification checks.

Installation

This is not available as a packaged plugin, from insomnia you will need to run:

git clone [email protected]:shanehandley-lt/square-signature-hmac-plugin.git ~/Library/Application\ Support/Insomnia/plugins/square-signature-hmac-plugin

Then reload plugins in insomnia via Preferences > Plugins > 'Reload Plugins'

Usage

Add a x-square-signature header to your request and 'sq' and wait for the variable selection popup (or press ctrl+space)

Header

Double click to variable and edit the Key to match the signature for your webhook.

UI

The computed signature should be added to the request header value.

References

About

An insomnia plugin to simplify x-square-signature header when testing square webhook endpoints

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published