Closed trentontrees closed 8 years ago
A rule action has that opts
property, which has a map as a value. This property was more or less designed for this sort of extension, so we can use that. Maybe "opts":{"base64": true, ... }
.
Generalize encoding specification to "opts":{"encoding":"base64", ... }
.
It would be very helpful to be able to upload the code section of a rule as base64 and then have it decode before running.
Example:
cat <<EOF | curl -s -d "@-" $ENDPOINT/api/loc/rules/add {"location":"$LOCATION", "rule": { "schedule" : "+1s" ,"action": {"code" : ["ZW52LmNvbnNvbGUoJ0hlbGxvJyk7"] } }}} EOF
When run, this will result in
env.console('Hello');
I think this would be an all or nothing as an endpoint option or with a flag.