feat(server): harden hostile input and overload behavior (#15)
quality-gate / quality (push) Failing after 1m5s
quality-gate / quality (push) Failing after 1m5s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using FinalFactory.Rendezvous.Contracts;
|
||||
using FinalFactory.Rendezvous.Server.Abuse;
|
||||
using FinalFactory.Rendezvous.Server.Transport;
|
||||
using FinalFactory.Rendezvous.Tests.JoinAttempts;
|
||||
using LiteNetLib;
|
||||
@@ -327,10 +328,12 @@ public sealed class UdpMediatorServiceTests
|
||||
{
|
||||
using CancellationTokenSource timeout = new(TimeSpan.FromSeconds(5));
|
||||
using JoinAttemptFixture fixture = new();
|
||||
AbuseProtectionService protection = new(Options.Create(new AbuseProtectionOptions()));
|
||||
NatMediationProcessor processor = new(
|
||||
fixture.Sessions.Store,
|
||||
fixture.Sessions.Capabilities,
|
||||
fixture.Service);
|
||||
fixture.Service,
|
||||
protection);
|
||||
using UdpMediatorService service = new(
|
||||
Options.Create(new UdpMediatorOptions
|
||||
{
|
||||
@@ -358,6 +361,7 @@ public sealed class UdpMediatorServiceTests
|
||||
using CancellationTokenSource noResponse = new(TimeSpan.FromMilliseconds(150));
|
||||
await Assert.ThrowsAnyAsync<OperationCanceledException>(async () =>
|
||||
await sender.ReceiveAsync(noResponse.Token));
|
||||
Assert.InRange(protection.TrackedKeyCount, 3, 5);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user