-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Please provide a way to use HMAC in the templates #870
Comments
Can you elaborate on how exactly you want to use HMAC? Are you referring to a specific method for authorization over HTTP? Any more info you could provide would be appreciated 😄 |
Oh, yeah, of course I can! So, take the Amazon Marketplace Web Services API for example. Between other query string parameters they want a Signature of the request that is calculated as follows:
with the canonicalized request looking like this:
and the canonicalized query string being the list of query string parameters, encoded as per RFC3986, ordered lexically by parameter name, then transformed to a normal query string. In pseudo code that could look a bit like that:
(More info on the amazon way. Don't bother. Really.) Right now (I think) this is not possible to build with insomnia. With environment variables I've been able to emulate almost all of the "real" request (including calculating the hash of the request body and including that in the parameters), but with signing the request I fail. For a better understanding, see this screenshot I made that shows the whole process of generating the signature: Please let me know if I made things in terms of understanding worse. |
That sounds an awful lot like the AWS v4 auth that Insomnia already supports (not saying this negates the need for this feature but it might help you out if you haven't discovered it yet). The best way to do this now would probably be via a custom auth plugin. Someone just made one that does HMAC auth stuff https://github.com/jbharter/insomnia-plugin-kraken/blob/master/index.js |
Thank you, I did not know about that.
I think that just exposing the method that creates the hmacs would be sufficient.
I hear you, but I think since it's just about exposing the method, this could easily be in the core. Despite the fact that this practice is gaining popularity (laravel/framework#23519 for example) |
Ya, exposing hmac as a template tag would be easy and should be included in core 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Details
Hello everyone,
to sign URLs it's necessary to use HMAC, but afaics there is no possibility currently of doing so in Insomnia. With a growing demand in this type of security, I think many could benefit from that feature.
I'd love to hear your thoughts about that.
Thanks!
The text was updated successfully, but these errors were encountered: