webhook
webhook copied to clipboard
Option to pass stdin to the executing command
Since command arguments and environment variable content have limits on the size, we could implement option to pass request values via stdin.
Definition could look something like:
"pass-stdin-to-command": [
{ "source": "payload", "name": "something" },
{ "source": "string", "name": "blah blah" }
]
Questions
What format should we use to encode these values so scripts can easily figure out which content resembles which value
-
We could use newline as value separator, but then we'd have to escape all newlines in the actual value.
-
Other option would be something like HTTP is doing when sending multipart messages by using boundaries.
-
Third option would be to encode data using JSON? Tools like
jq
make this an easy task to handle in shell scripts.
My 2 cents would be to restrict this feature only the entire-payload. Smaller things could be passed in as args or env vars.
If not, then I would vote for your option 3, encode it as JSON
My 2 cents would be to restrict this feature only the entire-payload.
:+1: