g105b / api.horse

API testing without horsing around.
https://www.api.horse
0 stars 0 forks source link

Variables: allow calculation of variables for injection #6

Open g105b opened 9 months ago

g105b commented 9 months ago

Inject variables in the same way as with secrets {{like_this}}, but this feature is to allow calculating variables by executing a script of some sort.

The main use case here is how Spektrix calculates its authentication header. It requires a multi-step cryptography process to generate a time-based auth header for each request. This is impossible to calculate prior to execution, so has to be generated on the fly for each request. I would love to use horsey to test this API!

g105b commented 9 months ago

Current thoughts: a docker container on the server to execute a PHP script. You get a syntax-highlighted text editor to edit a single index.php, but a modal for adding Composer dependencies that are automatically made available within the script. This is a bit advanced, but I don't see any other way to get a useful script that can't destroy a server.