Skip to content

v0.1.4

Choose a tag to compare

@github-actions github-actions released this 15 Oct 14:58

Added

  • Loader(sandbox=True) for untrusted templates: only engines with
    SANDBOXED = True take part (Jinja through SandboxedEnvironment, Liquid,
    Mustache, Handlebars, Go through a gotpl SandboxPolicy, shell, envsubst,
    copy); a file another engine claims raises SandboxError before it is read.
    A sandboxed template sees plain data: no method of the caller's objects, and
    a value that is not a plain type as its text.
  • tplx.evaluate and Loader.evaluate: an expression's value, its type kept,
    in Python (DEFAULT_ENGINE, refused by a sandbox) or an engine's syntax
    (engine="jinja", ".liquid", "go", ...), through Template.evaluate.
  • Loader.compile, cached; Template.references(), the names a template
    reads.

Full Changelog: v0.1.3...v0.1.4