Fix build and code structure improvements. New but essential UI functionality. CI improvements. Documentation improvements. AI module improvements.

This commit is contained in:
StellaOps Bot
2025-12-26 21:54:17 +02:00
parent 335ff7da16
commit c2b9cd8d1f
3717 changed files with 264714 additions and 48202 deletions

View File

@@ -7,21 +7,12 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.OpenApi;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using StellaOps.VulnExplorer.Api.Data;
using StellaOps.VulnExplorer.Api.Models;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen(options =>
{
options.SwaggerDoc("v1", new OpenApiInfo
{
Title = "StellaOps Vuln Explorer API",
Version = "v1",
Description = "Deterministic vulnerability listing/detail and VEX decision endpoints"
});
});
builder.Services.AddSwaggerGen();
// Configure JSON serialization with enum string converter
builder.Services.ConfigureHttpJsonOptions(options =>
@@ -57,8 +48,7 @@ app.MapGet("/v1/vulns", ([AsParameters] VulnFilter filter) =>
var response = new VulnListResponse(page, next);
return Results.Ok(response);
})
.WithOpenApi();
});
app.MapGet("/v1/vulns/{id}", ([FromHeader(Name = "x-stella-tenant")] string? tenant, string id) =>
{
@@ -70,8 +60,7 @@ app.MapGet("/v1/vulns/{id}", ([FromHeader(Name = "x-stella-tenant")] string? ten
return SampleData.TryGetDetail(id, out var detail) && detail is not null
? Results.Ok(detail)
: Results.NotFound();
})
.WithOpenApi();
});
// ============================================================================
// VEX Decision Endpoints (API-VEX-06-001, API-VEX-06-002, API-VEX-06-003)
@@ -105,8 +94,7 @@ app.MapPost("/v1/vex-decisions", (
var decision = store.Create(request, effectiveUserId, effectiveUserName);
return Results.Created($"/v1/vex-decisions/{decision.Id}", decision);
})
.WithName("CreateVexDecision")
.WithOpenApi();
.WithName("CreateVexDecision");
app.MapPatch("/v1/vex-decisions/{id:guid}", (
[FromHeader(Name = "x-stella-tenant")] string? tenant,
@@ -124,8 +112,7 @@ app.MapPatch("/v1/vex-decisions/{id:guid}", (
? Results.Ok(updated)
: Results.NotFound(new { error = $"VEX decision {id} not found" });
})
.WithName("UpdateVexDecision")
.WithOpenApi();
.WithName("UpdateVexDecision");
app.MapGet("/v1/vex-decisions", ([AsParameters] VexDecisionFilter filter, VexDecisionStore store) =>
{
@@ -149,8 +136,7 @@ app.MapGet("/v1/vex-decisions", ([AsParameters] VexDecisionFilter filter, VexDec
return Results.Ok(new VexDecisionListResponse(decisions, next));
})
.WithName("ListVexDecisions")
.WithOpenApi();
.WithName("ListVexDecisions");
app.MapGet("/v1/vex-decisions/{id:guid}", (
[FromHeader(Name = "x-stella-tenant")] string? tenant,
@@ -167,8 +153,7 @@ app.MapGet("/v1/vex-decisions/{id:guid}", (
? Results.Ok(decision)
: Results.NotFound(new { error = $"VEX decision {id} not found" });
})
.WithName("GetVexDecision")
.WithOpenApi();
.WithName("GetVexDecision");
app.Run();
@@ -234,4 +219,5 @@ public record VexDecisionFilter(
[FromQuery(Name = "pageSize")] int? PageSize,
[FromQuery(Name = "pageToken")] string? PageToken);
public partial class Program { }
// Program class public for WebApplicationFactory<Program>
public partial class Program;

View File

@@ -0,0 +1,12 @@
{
"profiles": {
"StellaOps.VulnExplorer.Api": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:62547;http://localhost:62548"
}
}
}

View File

@@ -9,7 +9,7 @@
<RootNamespace>StellaOps.VulnExplorer.Api</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>
</Project>