feat(audit): Apply TreatWarningsAsErrors=true to 160+ production csproj files
Sprint: SPRINT_20251229_049_BE_csproj_audit_maint_tests Tasks: AUDIT-0001 through AUDIT-0147 APPLY tasks (approved decisions 1-9) Changes: - Set TreatWarningsAsErrors=true for all production .NET projects - Fixed nullable warnings in Scanner.EntryTrace, Scanner.Evidence, Scheduler.Worker, Concelier connectors, and other modules - Injected TimeProvider/IGuidProvider for deterministic time/ID generation - Added path traversal validation in AirGap.Bundle - Fixed NULL handling in various cursor classes - Third-party GostCryptography retains TreatWarningsAsErrors=false (preserves original) - Test projects excluded per user decision (rejected decision 10) Note: All 17 ACSC connector tests pass after snapshot fixture sync
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="../StellaOps.ExportCenter/StellaOps.ExportCenter.Infrastructure/StellaOps.ExportCenter.Infrastructure.csproj" />
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Description>SDK client for StellaOps ExportCenter WebService API</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -168,9 +168,9 @@ public sealed class RegistryTlsConfig
|
||||
return null;
|
||||
|
||||
if (!string.IsNullOrEmpty(ClientKeyPassword))
|
||||
return new X509Certificate2(ClientCertPath, ClientKeyPassword);
|
||||
return X509CertificateLoader.LoadPkcs12FromFile(ClientCertPath, ClientKeyPassword);
|
||||
|
||||
return new X509Certificate2(ClientCertPath);
|
||||
return X509CertificateLoader.LoadCertificateFromFile(ClientCertPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -217,7 +217,7 @@ public sealed class RegistryTlsConfig
|
||||
private X509Certificate2? LoadCaCertificate()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CaCertPath) && File.Exists(CaCertPath))
|
||||
return new X509Certificate2(CaCertPath);
|
||||
return X509CertificateLoader.LoadCertificateFromFile(CaCertPath);
|
||||
|
||||
if (!string.IsNullOrEmpty(CaCertPem))
|
||||
return X509Certificate2.CreateFromPem(CaCertPem);
|
||||
|
||||
@@ -20,8 +20,7 @@ public static class ExceptionReportEndpoints
|
||||
public static IEndpointRouteBuilder MapExceptionReportEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.MapGroup("/v1/exports/exceptions")
|
||||
.WithTags("Exception Reports")
|
||||
.WithOpenApi();
|
||||
.WithTags("Exception Reports");
|
||||
|
||||
group.MapPost("/", CreateReportAsync)
|
||||
.RequireAuthorization(StellaOpsResourceServerPolicies.ExportOperator)
|
||||
|
||||
@@ -24,8 +24,7 @@ public static class LineageExportEndpoints
|
||||
public static IEndpointRouteBuilder MapLineageExportEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.MapGroup("/api/v1/lineage")
|
||||
.WithTags("Lineage Export")
|
||||
.WithOpenApi();
|
||||
.WithTags("Lineage Export");
|
||||
|
||||
// POST /api/v1/lineage/export - Generate evidence pack
|
||||
group.MapPost("/export", ExportEvidencePackAsync)
|
||||
|
||||
@@ -100,7 +100,7 @@ builder.Services.AddOpenApi();
|
||||
var routerOptions = builder.Configuration.GetSection("ExportCenter:Router").Get<StellaRouterOptionsBase>();
|
||||
builder.Services.TryAddStellaRouter(
|
||||
serviceName: "exportcenter",
|
||||
version: typeof(Program).Assembly.GetName().Version?.ToString() ?? "1.0.0",
|
||||
version: typeof(StellaOps.ExportCenter.WebService.Program).Assembly.GetName().Version?.ToString() ?? "1.0.0",
|
||||
routerOptions: routerOptions);
|
||||
|
||||
var app = builder.Build();
|
||||
@@ -168,3 +168,9 @@ app.MapDelete("/exports/{id}", (string id) => Results.NoContent())
|
||||
app.TryRefreshStellaRouterEndpoints(routerOptions);
|
||||
|
||||
app.Run();
|
||||
|
||||
// Make Program class accessible for integration testing
|
||||
namespace StellaOps.ExportCenter.WebService
|
||||
{
|
||||
public partial class Program { }
|
||||
}
|
||||
|
||||
@@ -283,11 +283,14 @@ public sealed class SimulationReportExporter : ISimulationReportExporter
|
||||
Data = simulation.SignalAnalysis
|
||||
};
|
||||
|
||||
yield return new SimulationExportLine
|
||||
if (simulation.OverrideAnalysis is not null)
|
||||
{
|
||||
Type = "override_analysis",
|
||||
Data = simulation.OverrideAnalysis
|
||||
};
|
||||
yield return new SimulationExportLine
|
||||
{
|
||||
Type = "override_analysis",
|
||||
Data = simulation.OverrideAnalysis
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Emit distribution
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user