wip: doctor/cli/docs/api to vector db consolidation; api hardening for descriptions, tenant, and scopes; migrations and conversions of all DALs to EF v10
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using StellaOps.Auth.ServerIntegration;
|
||||
using StellaOps.Auth.ServerIntegration.Tenancy;
|
||||
|
||||
namespace StellaOps.EvidenceLocker.Api;
|
||||
|
||||
@@ -22,33 +24,37 @@ public static class ExportEndpoints
|
||||
public static void MapExportEndpoints(this WebApplication app)
|
||||
{
|
||||
var group = app.MapGroup("/api/v1/bundles")
|
||||
.WithTags("Export");
|
||||
.WithTags("Export")
|
||||
.RequireTenant();
|
||||
|
||||
// POST /api/v1/bundles/{bundleId}/export
|
||||
group.MapPost("/{bundleId}/export", TriggerExportAsync)
|
||||
.WithName("TriggerExport")
|
||||
.WithSummary("Trigger an async evidence bundle export")
|
||||
.WithDescription("Enqueues an asynchronous export job for a specific evidence bundle. Returns 202 Accepted with the export job ID and a status polling URL. Returns 404 if the bundle ID is not registered.")
|
||||
.Produces<ExportTriggerResponse>(StatusCodes.Status202Accepted)
|
||||
.Produces(StatusCodes.Status404NotFound)
|
||||
.RequireAuthorization();
|
||||
.RequireAuthorization(StellaOpsResourceServerPolicies.ExportOperator);
|
||||
|
||||
// GET /api/v1/bundles/{bundleId}/export/{exportId}
|
||||
group.MapGet("/{bundleId}/export/{exportId}", GetExportStatusAsync)
|
||||
.WithName("GetExportStatus")
|
||||
.WithSummary("Get export status or download exported bundle")
|
||||
.WithDescription("Returns the current status of an evidence bundle export job. Returns 200 with the export manifest when complete, or 202 if the export is still in progress. Returns 404 if the export ID is not found.")
|
||||
.Produces<ExportStatusResponse>(StatusCodes.Status200OK)
|
||||
.Produces(StatusCodes.Status202Accepted)
|
||||
.Produces(StatusCodes.Status404NotFound)
|
||||
.RequireAuthorization();
|
||||
.RequireAuthorization(StellaOpsResourceServerPolicies.ExportViewer);
|
||||
|
||||
// GET /api/v1/bundles/{bundleId}/export/{exportId}/download
|
||||
group.MapGet("/{bundleId}/export/{exportId}/download", DownloadExportAsync)
|
||||
.WithName("DownloadExport")
|
||||
.WithSummary("Download the exported bundle")
|
||||
.WithDescription("Streams the completed evidence bundle as a gzip-compressed archive. Returns 409 Conflict if the export is still in progress. Returns 404 if the export ID is not found.")
|
||||
.Produces(StatusCodes.Status200OK, contentType: "application/gzip")
|
||||
.Produces(StatusCodes.Status404NotFound)
|
||||
.Produces(StatusCodes.Status409Conflict)
|
||||
.RequireAuthorization();
|
||||
.RequireAuthorization(StellaOpsResourceServerPolicies.ExportViewer);
|
||||
}
|
||||
|
||||
private static async Task<IResult> TriggerExportAsync(
|
||||
|
||||
Reference in New Issue
Block a user