feat: harden isolated Tornado test workflow

This commit is contained in:
2026-07-10 11:27:40 +09:00
parent 5a8c7028dc
commit fc932b27f6
36 changed files with 3919 additions and 226 deletions

View File

@@ -28,4 +28,51 @@ public static class PlayoutEngineFactory
new EnvironmentLiveAuthorization(),
TimeProvider.System);
}
/// <summary>
/// Applies the same fail-closed Test-mode configuration, scene-root, file-name and
/// allowlist validation used by the runtime before a diagnostic tool creates an engine.
/// This method never creates a dispatcher or activates COM.
/// </summary>
public static void ValidateIsolatedTestCommand(
PlayoutOptions options,
IEnumerable<PlayoutCue> cues)
{
ArgumentNullException.ThrowIfNull(options);
ArgumentNullException.ThrowIfNull(cues);
if (options.Mode != PlayoutMode.Test || options.TrustedLiveOutputEnabled)
{
throw new PlayoutConfigurationException(
"The isolated test command requires Test mode with live output disabled.");
}
var validated = ValidatedPlayoutOptions.Create(options);
foreach (var cue in cues)
{
if (cue is null)
{
throw new PlayoutConfigurationException(
"The isolated test command contains an invalid scene.");
}
PlayoutCue resolved;
try
{
resolved = validated.ResolveCue(cue);
}
catch (PlayoutRequestException exception)
{
throw new PlayoutConfigurationException(
"The isolated test command contains an invalid scene.",
exception);
}
if (!validated.IsTestSceneAllowed(resolved))
{
throw new PlayoutConfigurationException(
"The isolated test command contains a scene that is not allowlisted.");
}
}
}
}