Add AST check to catch calls, remove regex for block and template

This commit is contained in:
binwiederhier
2026-07-08 21:56:57 +02:00
parent 1d69ebaf58
commit 165f012ae6
10 changed files with 858 additions and 75 deletions
+1 -4
View File
@@ -150,10 +150,7 @@ var (
templatesFs embed.FS // Contains template config files (e.g. grafana.yml, github.yml, ...)
templatesDir = "templates"
// templateDisallowedRegex tests a template for disallowed expressions. While not really dangerous, they
// are not useful, and seem potentially troublesome.
templateDisallowedRegex = regexp.MustCompile(`(?m)\{\{-?\s*(call|template|define)\b`)
templateNameRegex = regexp.MustCompile(`^[-_A-Za-z0-9]+$`)
templateNameRegex = regexp.MustCompile(`^[-_A-Za-z0-9]+$`)
)
const (