docs(tests): fix CommentChecker findings across tests/ — 13,392 → 0 (repo-wide scan clean)
Comment/XML-doc changes only: - add summaries to ~10k test methods, fixtures, fakes and helpers (+ <param> on theories, <returns> on async Task methods, <inheritdoc/> on interface implementations the checker can resolve) - strip ~2.6k project-tracking references (WP*, P*-*, row-NN, Task N, #NN, Component-0NN) from comments, keeping the explanatory text; reword false positives in comments only - real docs on fakes implementing BCL/library interfaces (IDisposable, ILogger, IOptionsMonitor, IAsyncLifetime) - reword the last 5 src/ false positives (CWE-1236, failures-1, year-0001, M365) Only non-comment edits: four one-line nested classes split across lines so members can carry docs. Build 0 errors / 0 warnings.
This commit is contained in:
@@ -6,7 +6,7 @@ using ZB.MOM.WW.ScadaBridge.Security;
|
||||
namespace ZB.MOM.WW.ScadaBridge.IntegrationTests;
|
||||
|
||||
/// <summary>
|
||||
/// WP-5 (Phase 8): Security hardening tests.
|
||||
/// Security hardening tests.
|
||||
/// Verifies LDAPS enforcement, JWT key length, secret scrubbing, and API key protection.
|
||||
/// </summary>
|
||||
public class SecurityHardeningTests
|
||||
@@ -23,6 +23,7 @@ public class SecurityHardeningTests
|
||||
return new JwtTokenService(options, NullLogger<JwtTokenService>.Instance);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: ldap Options, transport, defaults To Ldaps.</summary>
|
||||
[Fact]
|
||||
public void LdapOptions_Transport_DefaultsToLdaps()
|
||||
{
|
||||
@@ -32,6 +33,7 @@ public class SecurityHardeningTests
|
||||
Assert.Equal(LdapTransport.Ldaps, options.Transport);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: ldap Options, allow Insecure, defaults To False.</summary>
|
||||
[Fact]
|
||||
public void LdapOptions_AllowInsecure_DefaultsToFalse()
|
||||
{
|
||||
@@ -39,6 +41,7 @@ public class SecurityHardeningTests
|
||||
Assert.False(options.AllowInsecure);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: jwt Signing Key, minimum Length, enforced.</summary>
|
||||
[Fact]
|
||||
public void JwtSigningKey_MinimumLength_Enforced()
|
||||
{
|
||||
@@ -55,6 +58,7 @@ public class SecurityHardeningTests
|
||||
Assert.True(token.Length > 0);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: jwt Signing Key, short Key, fails Validation.</summary>
|
||||
[Fact]
|
||||
public void JwtSigningKey_ShortKey_FailsValidation()
|
||||
{
|
||||
@@ -63,6 +67,7 @@ public class SecurityHardeningTests
|
||||
"Test key must be shorter than 32 chars to verify minimum length enforcement");
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: log Output Template, does Not Contain Secrets.</summary>
|
||||
[Fact]
|
||||
public void LogOutputTemplate_DoesNotContainSecrets()
|
||||
{
|
||||
@@ -76,6 +81,7 @@ public class SecurityHardeningTests
|
||||
Assert.DoesNotContain("ConnectionString", template, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: log Enrichment, contains Expected Properties.</summary>
|
||||
[Fact]
|
||||
public void LogEnrichment_ContainsExpectedProperties()
|
||||
{
|
||||
@@ -88,6 +94,7 @@ public class SecurityHardeningTests
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: jwt Token, does Not Contain Signing Key.</summary>
|
||||
[Fact]
|
||||
public void JwtToken_DoesNotContainSigningKey()
|
||||
{
|
||||
@@ -103,6 +110,7 @@ public class SecurityHardeningTests
|
||||
Assert.DoesNotContain("signing-key", token, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: security Options, jwt Expiry Defaults, are Secure.</summary>
|
||||
[Fact]
|
||||
public void SecurityOptions_JwtExpiryDefaults_AreSecure()
|
||||
{
|
||||
@@ -113,6 +121,7 @@ public class SecurityHardeningTests
|
||||
Assert.Equal(5, options.JwtRefreshThresholdMinutes);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: jwt Token, tampered Payload, fails Validation.</summary>
|
||||
[Fact]
|
||||
public void JwtToken_TamperedPayload_FailsValidation()
|
||||
{
|
||||
@@ -142,6 +151,7 @@ public class SecurityHardeningTests
|
||||
Assert.Null(principal);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: jwt Refresh Token, preserves Identity.</summary>
|
||||
[Fact]
|
||||
public void JwtRefreshToken_PreservesIdentity()
|
||||
{
|
||||
@@ -171,6 +181,7 @@ public class SecurityHardeningTests
|
||||
Assert.Equal("orig_user", refreshedPrincipal.FindFirst(JwtTokenService.UsernameClaimType)?.Value);
|
||||
}
|
||||
|
||||
/// <summary>Verifies the case: startup Validator, rejects Insecure Ldap In Production.</summary>
|
||||
[Fact]
|
||||
public void StartupValidator_RejectsInsecureLdapInProduction()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user