feat(batch10): task4 wire ocsp cache load save and server lifecycle

This commit is contained in:
Joseph Doherty
2026-02-28 13:05:45 -05:00
parent 98cf350383
commit f5a13bedff
10 changed files with 674 additions and 14 deletions

View File

@@ -15,4 +15,40 @@ public sealed class OcspResponseCacheParserTests
config.PreserveRevoked.ShouldBeFalse();
config.SaveInterval.ShouldBe(TimeSpan.FromMinutes(5).TotalSeconds);
}
[Fact]
public void ParseOCSPResponseCache_StringDurationBelowMinimum_ClampsToOneSecond()
{
var input = new Dictionary<string, object?>
{
["type"] = "local",
["save_interval"] = "500ms",
};
var (config, error) = OcspHandler.ParseOCSPResponseCache(input);
error.ShouldBeNull();
config.ShouldNotBeNull();
config.SaveInterval.ShouldBe(1);
}
[Fact]
public void ParseOCSPResponseCache_NoneType_AcceptsConfiguration()
{
var input = new Dictionary<string, object?>
{
["type"] = "none",
["local_store"] = "_rc_",
["preserve_revoked"] = true,
["save_interval"] = 25.0,
};
var (config, error) = OcspHandler.ParseOCSPResponseCache(input);
error.ShouldBeNull();
config.ShouldNotBeNull();
config.Type.ShouldBe("none");
config.PreserveRevoked.ShouldBeTrue();
config.SaveInterval.ShouldBe(25.0);
}
}