feat(batch1): add init parity hooks for ciphers and constants
This commit is contained in:
@@ -56,6 +56,16 @@ public static class CipherSuites
|
|||||||
CipherMapById = byId;
|
CipherMapById = byId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Compatibility init hook for PortTracker parity with Go <c>init()</c>.
|
||||||
|
/// Safe and idempotent.
|
||||||
|
/// </summary>
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
_ = CipherMap;
|
||||||
|
_ = CipherMapById;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the default set of TLS 1.2 cipher suites.
|
/// Returns the default set of TLS 1.2 cipher suites.
|
||||||
/// .NET manages cipher suite selection at the OS/SChannel/OpenSSL level;
|
/// .NET manages cipher suite selection at the OS/SChannel/OpenSSL level;
|
||||||
|
|||||||
@@ -214,6 +214,15 @@ public static class ServerConstants
|
|||||||
GitCommit = string.Empty;
|
GitCommit = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Compatibility init hook for PortTracker parity with Go <c>init()</c>.
|
||||||
|
/// Safe and idempotent.
|
||||||
|
/// </summary>
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
_ = GitCommit;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Truncates a VCS revision string to 7 characters for display.
|
/// Truncates a VCS revision string to 7 characters for display.
|
||||||
/// Mirrors <c>formatRevision</c> in const.go.
|
/// Mirrors <c>formatRevision</c> in const.go.
|
||||||
|
|||||||
@@ -24,6 +24,19 @@ namespace ZB.MOM.NatsNet.Server.Tests.Auth;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class CipherSuitesTests
|
public class CipherSuitesTests
|
||||||
{
|
{
|
||||||
|
[Fact]
|
||||||
|
public void Init_CalledMultipleTimes_RemainsIdempotent()
|
||||||
|
{
|
||||||
|
var beforeCount = CipherSuites.CipherMap.Count;
|
||||||
|
var beforeByIdCount = CipherSuites.CipherMapById.Count;
|
||||||
|
|
||||||
|
CipherSuites.Init();
|
||||||
|
CipherSuites.Init();
|
||||||
|
|
||||||
|
CipherSuites.CipherMap.Count.ShouldBe(beforeCount);
|
||||||
|
CipherSuites.CipherMapById.Count.ShouldBe(beforeByIdCount);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void CipherMap_ContainsTls13Suites()
|
public void CipherMap_ContainsTls13Suites()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,6 +32,17 @@ namespace ZB.MOM.NatsNet.Server.Tests;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class ServerTests
|
public sealed class ServerTests
|
||||||
{
|
{
|
||||||
|
[Fact]
|
||||||
|
public void Init_CalledMultipleTimes_RemainsIdempotent()
|
||||||
|
{
|
||||||
|
var before = ServerConstants.GitCommit;
|
||||||
|
|
||||||
|
ServerConstants.Init();
|
||||||
|
ServerConstants.Init();
|
||||||
|
|
||||||
|
ServerConstants.GitCommit.ShouldBe(before);
|
||||||
|
}
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
// TestSemanticVersion — Test ID 2866
|
// TestSemanticVersion — Test ID 2866
|
||||||
// Validates that ServerConstants.Version matches semver format.
|
// Validates that ServerConstants.Version matches semver format.
|
||||||
|
|||||||
BIN
porting.db
BIN
porting.db
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
# NATS .NET Porting Status Report
|
# NATS .NET Porting Status Report
|
||||||
|
|
||||||
Generated: 2026-02-28 10:54:55 UTC
|
Generated: 2026-02-28 11:05:07 UTC
|
||||||
|
|
||||||
## Modules (12 total)
|
## Modules (12 total)
|
||||||
|
|
||||||
@@ -12,10 +12,10 @@ Generated: 2026-02-28 10:54:55 UTC
|
|||||||
|
|
||||||
| Status | Count |
|
| Status | Count |
|
||||||
|--------|-------|
|
|--------|-------|
|
||||||
| deferred | 2377 |
|
| deferred | 2375 |
|
||||||
| n_a | 24 |
|
| n_a | 24 |
|
||||||
| stub | 1 |
|
| stub | 1 |
|
||||||
| verified | 1271 |
|
| verified | 1273 |
|
||||||
|
|
||||||
## Unit Tests (3257 total)
|
## Unit Tests (3257 total)
|
||||||
|
|
||||||
@@ -34,4 +34,4 @@ Generated: 2026-02-28 10:54:55 UTC
|
|||||||
|
|
||||||
## Overall Progress
|
## Overall Progress
|
||||||
|
|
||||||
**2473/6942 items complete (35.6%)**
|
**2475/6942 items complete (35.7%)**
|
||||||
|
|||||||
37
reports/report_eed6169.md
Normal file
37
reports/report_eed6169.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# NATS .NET Porting Status Report
|
||||||
|
|
||||||
|
Generated: 2026-02-28 11:05:07 UTC
|
||||||
|
|
||||||
|
## Modules (12 total)
|
||||||
|
|
||||||
|
| Status | Count |
|
||||||
|
|--------|-------|
|
||||||
|
| verified | 12 |
|
||||||
|
|
||||||
|
## Features (3673 total)
|
||||||
|
|
||||||
|
| Status | Count |
|
||||||
|
|--------|-------|
|
||||||
|
| deferred | 2375 |
|
||||||
|
| n_a | 24 |
|
||||||
|
| stub | 1 |
|
||||||
|
| verified | 1273 |
|
||||||
|
|
||||||
|
## Unit Tests (3257 total)
|
||||||
|
|
||||||
|
| Status | Count |
|
||||||
|
|--------|-------|
|
||||||
|
| deferred | 2091 |
|
||||||
|
| n_a | 187 |
|
||||||
|
| verified | 979 |
|
||||||
|
|
||||||
|
## Library Mappings (36 total)
|
||||||
|
|
||||||
|
| Status | Count |
|
||||||
|
|--------|-------|
|
||||||
|
| mapped | 36 |
|
||||||
|
|
||||||
|
|
||||||
|
## Overall Progress
|
||||||
|
|
||||||
|
**2475/6942 items complete (35.7%)**
|
||||||
Reference in New Issue
Block a user