Pin the no-client-address bucket of the vote budgets

Kills the Stryker survivor on the null-client key: a request with no address shares one
bucket and does not throw. Builds with a8c3ecf; test added after the main verify job.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-11 17:38:56 +02:00
commit 8f57dc89f0

View file

@ -284,6 +284,18 @@ public sealed class ConceptVoteRateLimitTests : IClassFixture<ConceptVoteRateLim
Assert.Null(limits.DenyCast(IPAddress.Parse("198.51.100.1"), null));
}
[Fact]
public void A_request_with_no_client_address_shares_one_bucket_apart_from_every_address()
{
var limits = new Bifrost.Web.Features.ConceptVotes.ConceptVoteRateLimits(
Microsoft.Extensions.Options.Options.Create(new Bifrost.Web.Configuration.ConceptVoteOptions { CastPermits = 1 }),
new TestClock());
Assert.Null(limits.DenyCast(null, null));
Assert.NotNull(limits.DenyCast(null, null));
Assert.Null(limits.DenyCast(IPAddress.Parse("198.51.100.1"), null));
}
[Fact]
public async Task Reads_are_not_under_the_vote_budgets()
{