Joseph Doherty
25d78b77f3
feat(batch1): complete proto/const/ciphers/nkey/jwt feature set
2026-02-28 06:37:02 -05:00
Joseph Doherty
d8d71eab95
feat(batch1): implement jwt wipe and nonce-required internal logic
2026-02-28 06:30:23 -05:00
Joseph Doherty
f9b582dcca
feat(batch1): add init parity hooks for ciphers and constants
2026-02-28 06:05:06 -05:00
Joseph Doherty
a660e38575
Implement deferred WaitQueue, DiskAvailability, and NoOpCache behavior with tests
2026-02-27 09:58:37 -05:00
Joseph Doherty
8849265780
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.
2026-02-27 08:56:26 -05:00
Joseph Doherty
a0c9c0094c
fix: session B — Go-faithful auth error states, NKey padding, permissions, signal disposal
2026-02-26 17:49:13 -05:00
Joseph Doherty
8c380e7ca6
feat: session B — auth implementation + signals (26 stubs complete)
...
Implement ConfigureAuthorization, CheckAuthentication, and full auth
dispatch in NatsServer.Auth.cs; add HandleSignals in NatsServer.Signals.cs;
extend AuthHandler with GetAuthErrClosedState, ValidateProxies,
GetTlsAuthDcs, CheckClientTlsCertSubject, ProcessUserPermissionsTemplate;
add ReadOperatorJwt/ValidateTrustedOperators to JwtProcessor; add
AuthCallout stub; add auth accessor helpers to ClientConnection; add
NATS.NKeys package for NKey signature verification; 12 new tests pass.
2026-02-26 17:38:46 -05:00
Joseph Doherty
a58e8e2572
feat: port sessions 21-23 — Streams, Consumers, MQTT, WebSocket & OCSP
...
Session 21 (402 features, IDs 3195-3387, 584-792):
- JetStream/StreamTypes.cs: StreamInfo, ConsumerInfo, SequenceInfo,
JSPubAckResponse, WaitQueue, ClusterInfo, PeerInfo, message types,
ConsumerAction enum, CreateConsumerRequest, PriorityGroupState
- JetStream/NatsStream.cs: NatsStream class (stub methods, IDisposable)
- JetStream/NatsConsumer.cs: NatsConsumer class (stub methods, IDisposable)
- Updated JetStreamApiTypes.cs: removed duplicate StreamInfo/ConsumerInfo stubs
Session 22 (153 features, IDs 2252-2404):
- Mqtt/MqttConstants.cs: all MQTT protocol constants, packet types, flags
- Mqtt/MqttTypes.cs: MqttSession, MqttSubscription, MqttWill, MqttJsa,
MqttAccountSessionManager, MqttHandler and supporting types
- Mqtt/MqttHandler.cs: per-client MQTT state, MqttServerExtensions stubs
Session 23 (97 features, IDs 3506-3543, 2443-2501):
- WebSocket/WebSocketConstants.cs: WsOpCode enum, frame bits, close codes
- WebSocket/WebSocketTypes.cs: WsReadInfo, SrvWebsocket (replaces stub),
WebSocketHandler stubs
- Auth/Ocsp/OcspTypes.cs: OcspMode, OcspMonitor (replaces stub),
IOcspResponseCache (replaces stub), NoOpCache, LocalDirCache
All features (3503 complete, 0 not_started). Phase 6 now at 58.9%.
2026-02-26 16:31:42 -05:00
Joseph Doherty
12a14ec476
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)
2026-02-26 15:37:08 -05:00
Joseph Doherty
06779a1f77
feat: port session 10 — Server Core Runtime, Accept Loops & Listeners
...
Ports server/server.go lines 2577–4782 (~1,881 Go LOC), implementing ~97
features (IDs 3051–3147) across three new partial-class files.
New files:
- NatsServer.Lifecycle.cs: Shutdown, WaitForShutdown, RemoveClient,
SendLDMToClients, LameDuckMode, LDMClientByID, rate-limit logging,
DisconnectClientByID, SendAsyncInfoToClients
- NatsServer.Listeners.cs: AcceptLoop, GetServerListener, InProcessConn,
AcceptConnections, GenerateInfoJson, CopyInfo, CreateClient/Ex/InProcess,
StartMonitoring (HTTP/HTTPS), AddConnectURLs/RemoveConnectURLs,
TlsVersion/TlsVersionFromString, GetClientConnectURLs, ResolveHostPorts,
PortsInfo/PortFile/LogPorts, ReadyForListeners, GetRandomIP, AcceptError
- Internal/WaitGroup.cs: Go-style WaitGroup using TaskCompletionSource
Modified:
- Auth/AuthTypes.cs: Account now implements INatsAccount (stub)
- NatsServerTypes.cs: ServerInfo.ShallowClone(), removed duplicate RefCountedUrlSet
- NatsServer.cs: _info promoted to internal for test access
- Properties/AssemblyInfo.cs: InternalsVisibleTo(DynamicProxyGenAssembly2)
- ServerTests.cs: 20 new session-10 unit tests (GenerateInfoJson, TlsVersion,
CopyInfo, GetRandomIP — Test IDs 2895, 2906)
All 565 unit tests + 1 integration test pass.
2026-02-26 15:08:23 -05:00
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
Joseph Doherty
88b1391ef0
feat: port session 07 — Protocol Parser, Auth extras (TPM/certidp/certstore), Internal utilities & data structures
...
Session 07 scope (5 features, 17 tests, ~1165 Go LOC):
- Protocol/ParserTypes.cs: ParserState enum (79 states), PublishArgument, ParseContext
- Protocol/IProtocolHandler.cs: handler interface decoupling parser from client
- Protocol/ProtocolParser.cs: Parse(), ProtoSnippet(), OverMaxControlLineLimit(),
ProcessPub/HeaderPub/RoutedMsgArgs/RoutedHeaderMsgArgs, ClonePubArg(), GetHeader()
- tests/Protocol/ProtocolParserTests.cs: 17 tests via TestProtocolHandler stub
Auth extras from session 06 (committed separately):
- Auth/TpmKeyProvider.cs, Auth/CertificateIdentityProvider/, Auth/CertificateStore/
Internal utilities & data structures (session 06 overflow):
- Internal/AccessTimeService.cs, ElasticPointer.cs, SystemMemory.cs, ProcessStatsProvider.cs
- Internal/DataStructures/GenericSublist.cs, HashWheel.cs
- Internal/DataStructures/SubjectTree.cs, SubjectTreeNode.cs, SubjectTreeParts.cs
All 461 tests pass (460 unit + 1 integration). DB updated for features 2588-2592 and tests 2598-2614.
2026-02-26 13:16:56 -05:00
Joseph Doherty
0a54d342ba
feat: port session 06 — Authentication & JWT types, validators, cipher suites
...
Port independently-testable auth functions from auth.go, ciphersuites.go,
and jwt.go. Server-dependent methods (configureAuthorization, checkAuthentication,
auth callout, etc.) are stubbed for later sessions.
- AuthTypes: User, NkeyUser, SubjectPermission, ResponsePermission, Permissions,
RoutePermissions, Account — all with deep Clone() methods
- AuthHandler: IsBcrypt, ComparePasswords, ValidateResponsePermissions,
ValidateAllowedConnectionTypes, ValidateNoAuthUser, ValidateAuth,
DnsAltNameLabels, DnsAltNameMatches, WipeSlice, ConnectionTypes constants
- CipherSuites: CipherMap, CipherMapById, DefaultCipherSuites,
CurvePreferenceMap, DefaultCurvePreferences
- JwtProcessor: JwtPrefix, WipeSlice, ValidateSrc (CIDR matching),
ValidateTimes (time-of-day ranges), TimeRange type
- ServerOptions: added Users, Nkeys, TrustedOperators properties
- 67 new unit tests (all 328 tests pass)
- DB: 18 features complete, 25 stubbed; 6 Go tests complete, 125 stubbed
2026-02-26 12:27:33 -05:00