Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paw rest client : how to compute HMAC-SHA256 using absolute url as input

Tags:

paw-app

I'm using the awesome Paw software to make Htpp requests. It has a lot of great features including the ability to compute HMAC-SHA256 signatures, unfortunately, I cannot find how to use the full url of the current request as input of this. What is the keywork to enter in the input field?

like image 237
Antoine M. Avatar asked Nov 29 '14 08:11

Antoine M.


1 Answers

Step 1

  • Right-click on the field you want to insert the hash into, pick Crypto > HMAC-SHA256
  • In the Input field, right-click and pick Request > Request URL

Step 2

  • You should now see a Request URL dynamic value in the input field, this means the HMAC-SHA256 dynamic value will take the current request's URL as its input for hash computation
  • Enter your HMAC key in the Key field (tip: right-click and pick Values > Secure Value to keep your key encrypted = safer!)

Compute the hash of a request URL in Paw


Old version/original answer (not up-to-date):

There is not (yet) a Dynamic Value that returns the URL, that's a missing thing. But here's a workaround:

In the HMAC-SHA256 "Input" field, right-click and choose "Extensions" > "Custom". You'll have a JavaScript text field, make the function return:

return context.getCurrentRequest().url;

Compute the Request URL Hash in Paw

See the Extensions Reference for more details.

like image 120
Micha Mazaheri Avatar answered Oct 19 '22 11:10

Micha Mazaheri