feat: port session 11 — Accounts & Directory JWT Store

- Account: full Account class (200 features) with subject mappings,
  connection counting, export/import checks, expiration timers
- DirJwtStore: directory-based JWT storage with sharding and expiry
- AccountResolver: IAccountResolver, MemoryAccountResolver,
  UrlAccountResolver, DirAccountResolver, CacheDirAccountResolver
- AccountTypes: all supporting types (AccountLimits, SConns, ExportMap,
  ImportMap, ServiceExport, StreamExport, ServiceLatency, etc.)
- 34 unit tests (599 total), 234 features complete (IDs 150-349, 793-826)
This commit is contained in:
Joseph Doherty
2026-02-26 15:37:08 -05:00
parent 06779a1f77
commit 12a14ec476
14 changed files with 5297 additions and 66 deletions

View File

@@ -671,8 +671,15 @@ public sealed partial class NatsServer
{
if (_accResolver == null)
return (string.Empty, ServerErrors.ErrNoAccountResolver);
var (jwt, err) = _accResolver.Fetch(name);
return (jwt, err);
try
{
var jwt = _accResolver.FetchAsync(name).GetAwaiter().GetResult();
return (jwt, null);
}
catch (Exception ex)
{
return (string.Empty, ex);
}
}
/// <summary>