Tests fixes, audit progress, UI completions

This commit is contained in:
StellaOps Bot
2025-12-30 09:03:22 +02:00
parent 7a5210e2aa
commit 82e55c206a
318 changed files with 7232 additions and 1256 deletions

View File

@@ -149,6 +149,9 @@ builder.Services.AddSingleton<IScanManifestRepository, InMemoryScanManifestRepos
builder.Services.AddSingleton<IProofBundleRepository, InMemoryProofBundleRepository>();
builder.Services.AddSingleton<IScoringService, DeterministicScoringService>();
builder.Services.AddSingleton<IScanManifestSigner, ScanManifestSigner>();
builder.Services.AddSingleton<IDeltaCompareService, DeltaCompareService>();
builder.Services.AddSingleton<IActionablesService, ActionablesService>();
builder.Services.AddSingleton<ICounterfactualApiService, CounterfactualApiService>();
builder.Services.AddDbContext<TriageDbContext>(options =>
options.UseNpgsql(bootstrapOptions.Storage.Dsn));
builder.Services.AddScoped<ITriageQueryService, TriageQueryService>();
@@ -541,6 +544,9 @@ if (app.Environment.IsEnvironment("Testing"))
apiGroup.MapScanEndpoints(resolvedOptions.Api.ScansSegment);
apiGroup.MapSbomUploadEndpoints();
apiGroup.MapReachabilityDriftRootEndpoints();
apiGroup.MapDeltaCompareEndpoints();
apiGroup.MapActionablesEndpoints();
apiGroup.MapCounterfactualEndpoints();
apiGroup.MapProofSpineEndpoints(resolvedOptions.Api.SpinesSegment, resolvedOptions.Api.ScansSegment);
apiGroup.MapReplayEndpoints();
if (resolvedOptions.ScoreReplay.Enabled)

View File

@@ -0,0 +1,20 @@
-- ============================================================================
-- SCANNER STORAGE - ENABLE PG_TRGM EXTENSION
-- ============================================================================
-- Migration: 019_enable_pg_trgm.sql
-- Description: Enables pg_trgm extension before trigram indexes are created
-- ============================================================================
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
DO $$
BEGIN
IF EXISTS (
SELECT 1
FROM pg_extension
WHERE extname = 'pg_trgm'
AND extnamespace <> 'public'::regnamespace
) THEN
ALTER EXTENSION pg_trgm SET SCHEMA public;
END IF;
END $$;

View File

@@ -7,6 +7,11 @@
-- CLI (external submissions), Git (source code scanning)
-- ============================================================================
-- ============================================================================
-- ENABLE TRIGRAM EXTENSION (if not exists)
-- ============================================================================
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
-- ============================================================================
-- ENUMS
-- ============================================================================
@@ -265,11 +270,6 @@ BEGIN
END;
$$ LANGUAGE plpgsql IMMUTABLE;
-- ============================================================================
-- ENABLE TRIGRAM EXTENSION (if not exists)
-- ============================================================================
CREATE EXTENSION IF NOT EXISTS pg_trgm;
-- ============================================================================
-- COMMENTS
-- ============================================================================

View File

@@ -16,7 +16,7 @@ namespace StellaOps.Scanner.WebService.Tests;
public sealed class ScannerApplicationFactory : WebApplicationFactory<ServiceStatus>
{
private readonly ScannerWebServicePostgresFixture postgresFixture;
private readonly Dictionary<string, string?> configuration = new()
private readonly Dictionary<string, string?> configuration = new(StringComparer.OrdinalIgnoreCase)
{
["scanner:storage:driver"] = "postgres",
["scanner:storage:dsn"] = string.Empty,
@@ -32,7 +32,9 @@ public sealed class ScannerApplicationFactory : WebApplicationFactory<ServiceSta
["scanner:telemetry:minimumLogLevel"] = "Information",
["scanner:telemetry:enableRequestLogging"] = "false",
["scanner:events:enabled"] = "false",
["scanner:features:enableSignedReports"] = "false"
["scanner:features:enableSignedReports"] = "false",
["scanner:offlineKit:requireDsse"] = "false",
["scanner:offlineKit:rekorOfflineMode"] = "false"
};
private Action<IDictionary<string, string?>>? configureConfiguration;