Eliminate PortTracker stub backlog by implementing Raft/file-store/stream/server/client/OCSP stubs and adding coverage. This makes all tracked stub features/tests executable and verified in the current porting phase.

This commit is contained in:
Joseph Doherty
2026-02-27 08:56:26 -05:00
parent ba4f41cf71
commit 8849265780
33 changed files with 2938 additions and 407 deletions

View File

@@ -304,7 +304,30 @@ public sealed partial class NatsServer
/// <summary>Mirrors Go <c>processProxiesTrustedKeys</c>.</summary>
internal void ProcessProxiesTrustedKeys()
{
// TODO: parse proxy trusted key strings into _proxyTrustedKeys set
var opts = GetOpts();
var keys = new HashSet<string>(StringComparer.Ordinal);
if (opts.Proxies?.Trusted is { Count: > 0 })
{
foreach (var proxy in opts.Proxies.Trusted)
{
if (!string.IsNullOrWhiteSpace(proxy.Key))
keys.Add(proxy.Key.Trim());
}
}
if (opts.TrustedKeys is { Count: > 0 })
{
foreach (var key in opts.TrustedKeys)
{
if (!string.IsNullOrWhiteSpace(key))
keys.Add(key.Trim());
}
}
_proxiesKeyPairs.Clear();
foreach (var key in keys)
_proxiesKeyPairs.Add(key);
}
/// <summary>
@@ -318,7 +341,21 @@ public sealed partial class NatsServer
/// Config reload stub.
/// Mirrors Go <c>Server.Reload</c>.
/// </summary>
internal void Reload() => throw new NotImplementedException("TODO: config reload — implement in later session");
internal void Reload()
{
_reloadMu.EnterWriteLock();
try
{
_configTime = DateTime.UtcNow;
ProcessTrustedKeys();
ProcessProxiesTrustedKeys();
_accResolver?.Reload();
}
finally
{
_reloadMu.ExitWriteLock();
}
}
/// <summary>
/// Returns a Task that shuts the server down asynchronously.