save progress
This commit is contained in:
@@ -26,6 +26,12 @@ public static class VexLensEndpointExtensions
|
||||
.Produces<ComputeConsensusResponse>(StatusCodes.Status200OK)
|
||||
.Produces(StatusCodes.Status400BadRequest);
|
||||
|
||||
group.MapPost("/consensus:withProof", ComputeConsensusWithProofAsync)
|
||||
.WithName("ComputeConsensusWithProof")
|
||||
.WithDescription("Compute consensus with full proof object for audit trail")
|
||||
.Produces<ComputeConsensusWithProofResponse>(StatusCodes.Status200OK)
|
||||
.Produces(StatusCodes.Status400BadRequest);
|
||||
|
||||
group.MapPost("/consensus:batch", ComputeConsensusBatchAsync)
|
||||
.WithName("ComputeConsensusBatch")
|
||||
.WithDescription("Compute consensus for multiple vulnerability-product pairs")
|
||||
@@ -130,6 +136,18 @@ public static class VexLensEndpointExtensions
|
||||
return Results.Ok(result);
|
||||
}
|
||||
|
||||
private static async Task<IResult> ComputeConsensusWithProofAsync(
|
||||
[FromBody] ComputeConsensusWithProofRequest request,
|
||||
[FromServices] IVexLensApiService service,
|
||||
HttpContext context,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var tenantId = GetTenantId(context) ?? request.TenantId;
|
||||
var requestWithTenant = request with { TenantId = tenantId };
|
||||
var result = await service.ComputeConsensusWithProofAsync(requestWithTenant, cancellationToken);
|
||||
return Results.Ok(result);
|
||||
}
|
||||
|
||||
private static async Task<IResult> ComputeConsensusBatchAsync(
|
||||
[FromBody] ComputeConsensusBatchRequest request,
|
||||
[FromServices] IVexLensApiService service,
|
||||
|
||||
Reference in New Issue
Block a user