search and ai stabilization work, localization stablized.
This commit is contained in:
@@ -10,6 +10,7 @@ using StellaOps.Scanner.WebService.Services;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using static StellaOps.Localization.T;
|
||||
|
||||
namespace StellaOps.Scanner.WebService.Endpoints;
|
||||
|
||||
@@ -77,9 +78,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.Validation,
|
||||
"Invalid scan identifier",
|
||||
_t("scanner.scan.invalid_identifier"),
|
||||
StatusCodes.Status400BadRequest,
|
||||
detail: "Scan identifier is required.");
|
||||
detail: _t("scanner.scan.identifier_required"));
|
||||
}
|
||||
|
||||
var snapshot = await coordinator.GetAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -88,9 +89,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Scan not found",
|
||||
_t("scanner.scan.not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: "Requested scan could not be located.");
|
||||
detail: _t("scanner.scan.not_found_detail"));
|
||||
}
|
||||
|
||||
var layers = await layerSbomService.GetLayerSummariesAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -128,9 +129,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.Validation,
|
||||
"Invalid scan identifier",
|
||||
_t("scanner.scan.invalid_identifier"),
|
||||
StatusCodes.Status400BadRequest,
|
||||
detail: "Scan identifier is required.");
|
||||
detail: _t("scanner.scan.identifier_required"));
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(layerDigest))
|
||||
@@ -138,9 +139,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.Validation,
|
||||
"Invalid layer digest",
|
||||
_t("scanner.layer_sbom.invalid_layer_digest"),
|
||||
StatusCodes.Status400BadRequest,
|
||||
detail: "Layer digest is required.");
|
||||
detail: _t("scanner.layer_sbom.layer_digest_required"));
|
||||
}
|
||||
|
||||
var snapshot = await coordinator.GetAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -149,9 +150,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Scan not found",
|
||||
_t("scanner.scan.not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: "Requested scan could not be located.");
|
||||
detail: _t("scanner.scan.not_found_detail"));
|
||||
}
|
||||
|
||||
// Normalize layer digest (URL decode if needed)
|
||||
@@ -173,9 +174,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Layer SBOM not found",
|
||||
_t("scanner.layer_sbom.not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: $"SBOM for layer {normalizedDigest} could not be found.");
|
||||
detail: _tn("scanner.layer_sbom.not_found_detail", ("layerDigest", normalizedDigest)));
|
||||
}
|
||||
|
||||
var contentType = sbomFormat == "spdx"
|
||||
@@ -207,9 +208,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.Validation,
|
||||
"Invalid scan identifier",
|
||||
_t("scanner.scan.invalid_identifier"),
|
||||
StatusCodes.Status400BadRequest,
|
||||
detail: "Scan identifier is required.");
|
||||
detail: _t("scanner.scan.identifier_required"));
|
||||
}
|
||||
|
||||
var snapshot = await coordinator.GetAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -218,9 +219,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Scan not found",
|
||||
_t("scanner.scan.not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: "Requested scan could not be located.");
|
||||
detail: _t("scanner.scan.not_found_detail"));
|
||||
}
|
||||
|
||||
var recipe = await layerSbomService.GetCompositionRecipeAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -230,9 +231,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Composition recipe not found",
|
||||
_t("scanner.layer_sbom.recipe_not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: "Composition recipe for this scan is not available.");
|
||||
detail: _t("scanner.layer_sbom.recipe_not_found_detail"));
|
||||
}
|
||||
|
||||
var response = new CompositionRecipeResponseDto
|
||||
@@ -284,9 +285,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.Validation,
|
||||
"Invalid scan identifier",
|
||||
_t("scanner.scan.invalid_identifier"),
|
||||
StatusCodes.Status400BadRequest,
|
||||
detail: "Scan identifier is required.");
|
||||
detail: _t("scanner.scan.identifier_required"));
|
||||
}
|
||||
|
||||
var snapshot = await coordinator.GetAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -295,9 +296,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Scan not found",
|
||||
_t("scanner.scan.not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: "Requested scan could not be located.");
|
||||
detail: _t("scanner.scan.not_found_detail"));
|
||||
}
|
||||
|
||||
var verificationResult = await layerSbomService.VerifyCompositionRecipeAsync(parsed, cancellationToken).ConfigureAwait(false);
|
||||
@@ -307,9 +308,9 @@ internal static class LayerSbomEndpoints
|
||||
return ProblemResultFactory.Create(
|
||||
context,
|
||||
ProblemTypes.NotFound,
|
||||
"Composition recipe not found",
|
||||
_t("scanner.layer_sbom.recipe_not_found"),
|
||||
StatusCodes.Status404NotFound,
|
||||
detail: "Composition recipe for this scan is not available for verification.");
|
||||
detail: _t("scanner.layer_sbom.recipe_not_found_for_verification"));
|
||||
}
|
||||
|
||||
var response = new CompositionRecipeVerificationResponseDto
|
||||
|
||||
Reference in New Issue
Block a user