feat: add stubs and guards for Start() parity

- Add CheckAuthForWarnings() no-op stub (NatsServer.Auth.cs)
- Add StartDelayedApiResponder() no-op stub (NatsServer.JetStreamCore.cs)
- Guard StartMqtt() to warn instead of throwing NotImplementedException
This commit is contained in:
Joseph Doherty
2026-03-01 15:01:23 -05:00
parent 99399ac917
commit 8973db0027
4 changed files with 42 additions and 3 deletions

View File

@@ -133,8 +133,10 @@ internal static class MqttServerExtensions
/// Start listening for MQTT client connections.
/// Mirrors Go <c>(*Server).startMQTT()</c>.
/// </summary>
public static void StartMqtt(this NatsServer server) =>
throw new NotImplementedException("TODO: session 22");
public static void StartMqtt(this NatsServer server)
{
server.Warnf("MQTT listener not yet implemented; skipping MQTT startup");
}
/// <summary>
/// Configure MQTT authentication overrides from the MQTT options block.

View File

@@ -362,4 +362,22 @@ public sealed partial class NatsServer
/// Wraps the synchronous <see cref="Shutdown"/> method.
/// </summary>
internal Task ShutdownAsync() => Task.Run(Shutdown);
// =========================================================================
// CheckAuthForWarnings (feature 3049 — Start parity)
// =========================================================================
/// <summary>
/// Checks for insecure auth configurations and logs warnings.
/// Mirrors Go <c>Server.checkAuthforWarnings()</c> in server/server.go.
/// Stub — full implementation deferred.
/// </summary>
internal void CheckAuthForWarnings()
{
// No-op stub. Go logs warnings about:
// - Password auth without TLS
// - Token auth without TLS
// - NKey auth without TLS
// These are informational warnings only.
}
}

View File

@@ -571,4 +571,23 @@ public sealed partial class NatsServer
_jetStream == null ? null : new JetStreamEngine(_jetStream);
internal JetStream? GetJetStreamState() => _jetStream;
// =========================================================================
// Delayed API responder (feature 3049 — Start parity)
// =========================================================================
/// <summary>
/// Starts the delayed JetStream API response handler goroutine.
/// Started regardless of JetStream being enabled (can be enabled via config reload).
/// Mirrors Go <c>Server.delayedAPIResponder()</c> in server/jetstream_api.go.
/// Stub — full implementation deferred.
/// </summary>
internal void StartDelayedApiResponder()
{
StartGoRoutine(() =>
{
// No-op: exits when quit is signaled.
_quitCts.Token.WaitHandle.WaitOne();
});
}
}

View File

@@ -1,6 +1,6 @@
# NATS .NET Porting Status Report
Generated: 2026-03-01 19:52:36 UTC
Generated: 2026-03-01 20:01:24 UTC
## Modules (12 total)