fix(triggers): use explicit ValidationCategory + tighten expression syntax validation

This commit is contained in:
Joseph Doherty
2026-05-16 05:57:39 -04:00
parent bf3f572ad9
commit 5065384305
2 changed files with 69 additions and 34 deletions

View File

@@ -12,8 +12,13 @@ namespace ScadaLink.TemplateEngine.Validation;
/// </summary>
public class ScriptCompiler
{
// Forbidden namespace patterns - scripts must not use these
private static readonly string[] ForbiddenPatterns =
/// <summary>
/// Forbidden namespace patterns — scripts (and trigger expressions, via
/// <see cref="ValidationService"/>) must not use these. Trigger expressions run
/// under the same trust model as scripts, so the list is shared from here rather
/// than duplicated.
/// </summary>
internal static readonly string[] ForbiddenPatterns =
[
"System.IO.",
"System.Diagnostics.Process",