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.
This commit is contained in:
Joseph Doherty
2026-02-26 13:16:56 -05:00
parent 0a54d342ba
commit 88b1391ef0
56 changed files with 9006 additions and 6 deletions

View File

@@ -0,0 +1,42 @@
# Session 02: Utilities & Queues
## Summary
General utility functions, IP-based queue, send queue, task scheduler, and subject transform engine. These are infrastructure pieces used across the server.
## Scope
| Go File | Features | Feature IDs | Go LOC |
|---------|----------|-------------|--------|
| server/util.go | 21 | 34853505 | 244 |
| server/ipqueue.go | 14 | 13541367 | 175 |
| server/sendq.go | 3 | 29712973 | 76 |
| server/scheduler.go | 14 | 29522965 | 260 |
| server/subject_transform.go | 16 | 33883403 | 570 |
| **Total** | **68** | | **1,325** |
## .NET Classes
- `ServerUtilities` — string/byte helpers, random, hashing
- `IpQueue<T>` — lock-free concurrent queue with IP grouping
- `SendQueue` — outbound message queue
- `Scheduler` — time-based task scheduler
- `SubjectTransform` — NATS subject rewriting/mapping engine
## Test Files
| Test File | Tests | Test IDs |
|-----------|-------|----------|
| server/util_test.go | 13 | 30613073 |
| server/ipqueue_test.go | 28 | 688715 |
| server/subject_transform_test.go | 4 | 29582961 |
| server/split_test.go | 12 | 29292940 |
| **Total** | **57** | |
## Dependencies
- Session 01 (Foundation Types)
## .NET Target Location
- `dotnet/src/ZB.MOM.NatsNet.Server/Internal/`