dregsy icon indicating copy to clipboard operation
dregsy copied to clipboard

implement js tags filter

Open nikolaevn opened this issue 2 years ago • 1 comments

added js tags filter for complex scenarios when regex and semver uncomfortable

nikolaevn avatar Apr 27 '22 11:04 nikolaevn

Great PR! Thanks a lot! I just reviewed and this is looking good. A few questions came up:

  1. For each JS tag filter, an Otto VM is instantiated. I'm not familiar with the Otto library, but from a quick glance it looks as if this could be a bit resource heavy if many JS tag filters are used. Would it be possible to set aside a shared Otto VM? Note: currently, dregsy is processing tasks strictly in serial, so concurrent use of the VM wouldn't be a problem. This may change in the future though, so it would be good to keep concurrent access in mind when using a shared VM.
  2. Is it possible to somehow limit what can be run with the Otto VM? Potentially you could write any kind of JS code in a tag filter, even file deletions and the like. It's not that big of a security concern, since as the dregsy config author, you usually have full access to the system anyway. But limiting the scope of expressions could help prevent mishaps.
  3. Do you think you could add a few tests that are using JS tag filters?

xelalexv avatar Apr 28 '22 09:04 xelalexv

Closing due to inactivity.

xelalexv avatar Jan 22 '24 14:01 xelalexv