feat(security): register TimeProvider + S18/S19 option knobs (archreview 03/S18,S19)

This commit is contained in:
Joseph Doherty
2026-08-20 09:36:04 -04:00
parent dd7f495432
commit 894444376e
9 changed files with 266 additions and 54 deletions
@@ -236,8 +236,10 @@ public sealed class MeshRegistrationRoleScopingTests
}
/// <summary>
/// Pins the scanner's expected result shape against today's Program.cs — 6 markers,
/// 5 braced blocks + the 1 braceless ConfigDb gate, so 6 scanned ranges. Without this, a
/// Pins the scanner's expected result shape against today's Program.cs — 5 markers,
/// 4 braced blocks + the 1 braceless ConfigDb gate, so 5 scanned ranges (the data-plane
/// key-store branch moved into <c>DataPlaneAuthRegistration</c> for arch-review 03/S18, taking
/// one braced marker with it). Without this, a
/// scanner bug that silently drops or merges a marker (as the pre-fix version did to the
/// braceless marker — it fabricated a phantom range spanning an unrelated if-block and swallowed
/// a real nested 'if (hasAdmin)' block inside it, yielding 5 ranges instead of 6) would not
@@ -248,13 +250,13 @@ public sealed class MeshRegistrationRoleScopingTests
{
var source = ReadProgramSource();
CountOccurrences(source, HasAdminMarker).ShouldBe(6,
CountOccurrences(source, HasAdminMarker).ShouldBe(5,
"Program.cs's 'if (hasAdmin)' marker count changed. If a marker was added or removed, " +
"update this pin — and check whether the new/removed occurrence is braced or braceless — " +
"rather than letting the scanner silently mis-shape its result.");
var ranges = FindHasAdminBlockRanges(source);
ranges.Count.ShouldBe(6,
ranges.Count.ShouldBe(5,
"expected one scanned range per 'if (hasAdmin)' marker, including the braceless ConfigDb " +
"gate. A mismatch means the scanner adopted an unrelated brace or otherwise merged/dropped " +
"a marker instead of handling each one independently.");