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

前端 未结 1 1081
借酒劲吻你
借酒劲吻你 2021-01-18 08:46

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 fi

相关标签:
1条回答
  • 2021-01-18 09:36

    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.

    0 讨论(0)
提交回复
热议问题