feat: harden gateway reply remap and leaf loop transparency

This commit is contained in:
Joseph Doherty
2026-02-23 14:40:07 -05:00
parent d83b37fec1
commit 958c4aa8ed
5 changed files with 70 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
using NATS.Server.LeafNodes;
namespace NATS.Server.Tests.LeafNodes;
public class LeafLoopTransparencyRuntimeTests
{
[Fact]
public void Transport_internal_reply_and_loop_markers_never_leak_to_client_visible_subjects()
{
var nested = LeafLoopDetector.Mark(
LeafLoopDetector.Mark("orders.created", "S1"),
"S2");
LeafLoopDetector.TryUnmark(nested, out var unmarked).ShouldBeTrue();
unmarked.ShouldBe("orders.created");
unmarked.ShouldNotStartWith("$LDS.");
}
}