feat(batch10): task4 wire ocsp cache load save and server lifecycle
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user