Joseph Doherty
|
0df93c23b0
|
feat: port session 09 — Server Core Init & Config
Port server/server.go account management and initialization (~1950 LOC):
- NatsServer.cs: full server struct fields (atomic counters, locks, maps,
stubs for gateway/websocket/mqtt/ocsp/leafnode)
- NatsServer.Init.cs: factory methods (New/NewServer/NewServerFromConfig),
compression helpers (ValidateAndNormalizeCompressionOption,
SelectCompressionMode, SelectS2AutoModeBasedOnRtt, CompressOptsEqual),
cluster-name management, validation (ValidateCluster, ValidatePinnedCerts,
ValidateOptions), trusted-key processing, CLI helpers, running-state checks,
and Start() stub
- NatsServer.Accounts.cs: account management (ConfigureAccounts,
LookupOrRegisterAccount, RegisterAccount, SetSystemAccount,
SetDefaultSystemAccount, SetSystemAccountInternal, CreateInternalClient*,
ShouldTrackSubscriptions, RegisterAccountNoLock, SetAccountSublist,
SetRouteInfo, LookupAccount, LookupOrFetchAccount, UpdateAccount,
UpdateAccountWithClaimJwt, FetchRawAccountClaims, FetchAccountClaims,
VerifyAccountClaims, FetchAccountFromResolver, GlobalAccountOnly,
StandAloneMode, ConfiguredRoutes, ActivePeers, ComputeRoutePoolIdx)
- NatsServerTypes.cs: ServerInfo, ServerStats, NodeInfo, ServerProtocol,
CompressionMode constants, AccountClaims stub, InternalState stub, and
cross-session stubs for JetStream/gateway/websocket/mqtt/ocsp
- AuthTypes.cs: extend Account stub with Issuer, ClaimJwt, RoutePoolIdx,
Incomplete, Updated, Sublist, Server fields, and IsExpired()
- ServerOptions.cs: add Accounts property (List<Account>)
- ServerTests.cs: 38 standalone tests (IDs 2866, 2882, plus compression
and validation helpers); server-dependent tests marked n/a
Features: 77 complete (IDs 2974–3050)
Tests: 2 complete (2866, 2882); 18 n/a (server-dependent)
All tests: 545 unit + 1 integration pass
|
2026-02-26 14:18:18 -05:00 |
|