mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
feat(automation): add template filter and test allowlist
This commit is contained in:
parent
99fd1a1338
commit
b4e5bf95a4
1 changed files with 31 additions and 0 deletions
31
surfsense_backend/app/automations/templating/allowlist.py
Normal file
31
surfsense_backend/app/automations/templating/allowlist.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
"""Filter and test names admitted into the sandboxed environment."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
ALLOWED_FILTERS: tuple[str, ...] = (
|
||||||
|
"default",
|
||||||
|
"first",
|
||||||
|
"join",
|
||||||
|
"last",
|
||||||
|
"length",
|
||||||
|
"lower",
|
||||||
|
"replace",
|
||||||
|
"reverse",
|
||||||
|
"sort",
|
||||||
|
"tojson",
|
||||||
|
"trim",
|
||||||
|
"truncate",
|
||||||
|
"upper",
|
||||||
|
"date",
|
||||||
|
"slugify",
|
||||||
|
)
|
||||||
|
|
||||||
|
ALLOWED_TESTS: tuple[str, ...] = (
|
||||||
|
"defined",
|
||||||
|
"none",
|
||||||
|
"number",
|
||||||
|
"string",
|
||||||
|
"mapping",
|
||||||
|
"sequence",
|
||||||
|
"boolean",
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue