Skip to content

Support for SandboxedNativeEnvironment #2010

@pasky

Description

@pasky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions