feat(batch9): implement f1 auth and dirstore foundations

This commit is contained in:
Joseph Doherty
2026-02-28 12:12:50 -05:00
parent 26e4729e8b
commit 78d222a86d
6 changed files with 212 additions and 38 deletions

View File

@@ -22,6 +22,7 @@ using NSubstitute.ExceptionExtensions;
using Shouldly;
using Xunit;
using ZB.MOM.NatsNet.Server.Auth;
using ZB.MOM.NatsNet.Server.Internal;
namespace ZB.MOM.NatsNet.Server.Tests;
@@ -218,6 +219,21 @@ public sealed class ServerTests
err.ShouldNotBeNull();
}
[Fact]
public void MatchesPinnedCert_NullPinnedSet_ReturnsTrue()
{
var client = new ClientConnection(ClientKind.Client, nc: new MemoryStream());
client.MatchesPinnedCert(null).ShouldBeTrue();
}
[Fact]
public void MatchesPinnedCert_NoTlsCertificate_ReturnsFalse()
{
var client = new ClientConnection(ClientKind.Client, nc: new MemoryStream());
var pinned = new PinnedCertSet([new string('a', 64)]);
client.MatchesPinnedCert(pinned).ShouldBeFalse();
}
// =========================================================================
// GetServerProto
// =========================================================================