test(batch0): port account/auth/options implementable tests

This commit is contained in:
Joseph Doherty
2026-02-28 04:39:13 -05:00
parent 564b91ded1
commit 27bbd63ce2
5 changed files with 53 additions and 51 deletions

View File

@@ -108,20 +108,10 @@ public sealed class AuthCalloutTests
server.ShouldNotBeNull();
}
[Fact] // T:117
[Fact(Skip = "DEFERRED: requires full operator-mode auth callout integration runtime")] // T:117
public void AuthCalloutOperatorModeBasics_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions());
err.ShouldBeNull();
var opts = new ServerOptions
{
TrustedOperators = [new object()],
AuthCallout = new AuthCalloutOpts { Account = "AUTH", Issuer = "OP" },
};
Should.Throw<NotImplementedException>(() =>
server!.ProcessClientOrLeafAuthentication(CreateClient(1, "h", "u", "p"), opts));
// DEFERRED: requires end-to-end operator resolver + auth service runtime setup.
}
[Fact] // T:120
@@ -228,51 +218,22 @@ public sealed class AuthCalloutTests
req.ConnectOptions!.Username.ShouldBe("leaf-user");
}
[Fact] // T:138
[Fact(Skip = "DEFERRED: requires leafnode auth callout integration runtime")] // T:138
public void AuthCalloutLeafNodeAndConfigMode_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions());
err.ShouldBeNull();
var opts = new ServerOptions
{
AuthCallout = new AuthCalloutOpts { Account = "AUTH" },
};
Should.Throw<NotImplementedException>(() =>
server!.ProcessClientOrLeafAuthentication(CreateClient(21, "leaf", kind: ClientKind.Leaf), opts));
// DEFERRED: requires multi-server leafnode handshake + callout service.
}
[Fact] // T:140
[Fact(Skip = "DEFERRED: requires operator-mode credential mismatch integration runtime")] // T:140
public void AuthCalloutOperatorModeMismatchedCalloutCreds_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions());
err.ShouldBeNull();
var opts = new ServerOptions
{
TrustedOperators = [new object()],
AuthCallout = new AuthCalloutOpts { Account = "AUTH", Issuer = "OP", AuthUsers = ["bad-user"] },
};
Should.Throw<NotImplementedException>(() =>
server!.ProcessClientOrLeafAuthentication(CreateClient(30, "h", "user", "pass"), opts));
// DEFERRED: requires connected external auth service with mismatched user creds.
}
[Fact] // T:141
[Fact(Skip = "DEFERRED: requires leafnode+operator mismatched credentials integration runtime")] // T:141
public void AuthCalloutLeafNodeOperatorModeMismatchedCreds_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions());
err.ShouldBeNull();
var opts = new ServerOptions
{
TrustedOperators = [new object()],
AuthCallout = new AuthCalloutOpts { Account = "AUTH", Issuer = "OP", AuthUsers = ["leaf-bad"] },
};
Should.Throw<NotImplementedException>(() =>
server!.ProcessClientOrLeafAuthentication(CreateClient(31, "leaf", "lu", "lp", kind: ClientKind.Leaf), opts));
// DEFERRED: requires multiple servers and live leafnode credential exchange.
}
private static ClientConnection CreateClient(