jinja
jinja copied to clipboard
Support for SandboxedNativeEnvironment
We need to use NativeEnvironment since we are templating JSONs using Jinja, at the same time the templates are from untrusted sources so we need to sandbox them.
It seems to us it might be as simple as something in the vein of
class SandboxedNativeEnvironment(SandboxedEnvironment):
code_generator_class = NativeCodeGenerator
concat = staticmethod(native_concat) # type: ignore
but we aren't sure if we aren't missing something?
We'll be happy to contribute a PR as a followup.