Closed lassebomh closed 3 years ago
I'll look into it. I will have to make some changes to the JS engine, as currently it can only deal with strings, not byte arrays.
Just to confirm, by byte array you mean Uint8Array
?
@lassebomh Version 2.10.0 is now available for beta testing in the Play Store. It contains some key changes to enable this usecase. Could you give it a try and let me know if it addresses your issue? Beta testing signup can be found here: https://play.google.com/apps/testing/ch.rmy.android.http_shortcuts
Awesome! I'll check it out tomorrow and make sure to provide an example if anyone else is interested.
It got it working :) I have created a repository that includes an example and a guide. Thanks for the help!
@lassebomh Thanks for confirming that it works for you. I will then close this issue, as version 2.10.0 is now released.
For your repository, I recommend that you export a working solution from the app and include the exported file into your repository, such that others can easily download and import it, or even import it directly via a URL. Just make sure to remove the secret values from the variables in the exported file.
Is your feature request related to a problem? Please describe. AWS API requests from a regular HTTP client is surprisingly complicated but it is incredibly close to being possible with a JavaScript shortcut. One of the things it requires is creating a signed signature but this is currently (extremely close but) impossible to do.
Describe the solution you'd like 2 functions:
Describe alternatives you've considered Option 1: Creating my own implementation of the HMAC function from scratch. ~Option 2: Pray to the gods that it's possible to hash a hex string that has been converted to binary and then to a regular string.~
Additional context This is how you create a signed signature in python. I have marked all places that cannot be done in a JavaScript shortcut.
The complete example can be found here
I would personally use this to get HTTP-Shortcuts to start a EC2 Spot instance (basically a unused and very cheap server) to run a workload once every day. Really cool if I can control this from my phone.
Oh yeah and great work on the app. It's awesome