search and ai stabilization work, localization stablized.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using static StellaOps.Localization.T;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using StellaOps.Remediation.Core.Abstractions;
|
||||
using StellaOps.Remediation.WebService.Contracts;
|
||||
@@ -25,7 +26,7 @@ public static class RemediationMatchEndpoints
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(cve))
|
||||
{
|
||||
return Results.BadRequest(new { error = "cve query parameter is required." });
|
||||
return Results.BadRequest(new { error = _t("remediation.match.cve_required") });
|
||||
}
|
||||
|
||||
var items = await matcher.FindMatchesAsync(cve, purl, version, ct).ConfigureAwait(false);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using StellaOps.Localization;
|
||||
using StellaOps.Remediation.Core.Abstractions;
|
||||
using StellaOps.Remediation.Core.Services;
|
||||
using StellaOps.Remediation.Persistence.Repositories;
|
||||
@@ -17,6 +18,8 @@ builder.Services.AddAuthorization(options =>
|
||||
});
|
||||
builder.Services.AddAuthentication();
|
||||
builder.Services.AddStellaOpsTenantServices();
|
||||
builder.Services.AddStellaOpsLocalization(builder.Configuration);
|
||||
builder.Services.AddTranslationBundle(System.Reflection.Assembly.GetExecutingAssembly());
|
||||
|
||||
// Core services
|
||||
builder.Services.AddSingleton<IContributorTrustScorer, ContributorTrustScorer>();
|
||||
@@ -39,6 +42,7 @@ builder.Services.AddSingleton<IRemediationMatcher>(sp =>
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseAuthentication();
|
||||
app.UseStellaOpsLocalization();
|
||||
app.UseAuthorization();
|
||||
app.UseStellaOpsTenantMiddleware();
|
||||
|
||||
@@ -48,6 +52,7 @@ app.MapRemediationRegistryEndpoints();
|
||||
app.MapRemediationMatchEndpoints();
|
||||
app.MapRemediationSourceEndpoints();
|
||||
|
||||
await app.LoadTranslationsAsync();
|
||||
app.Run();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,5 +8,9 @@
|
||||
<ProjectReference Include="..\StellaOps.Remediation.Core\StellaOps.Remediation.Core.csproj" />
|
||||
<ProjectReference Include="..\StellaOps.Remediation.Persistence\StellaOps.Remediation.Persistence.csproj" />
|
||||
<ProjectReference Include="..\..\Authority\StellaOps.Authority\StellaOps.Auth.ServerIntegration\StellaOps.Auth.ServerIntegration.csproj" />
|
||||
<ProjectReference Include="..\..\__Libraries\StellaOps.Localization\StellaOps.Localization.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Translations\*.json" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"_meta": { "locale": "en-US", "namespace": "remediation", "version": "1.0" },
|
||||
|
||||
"remediation.match.cve_required": "cve query parameter is required.",
|
||||
"remediation.contributor.not_found_error": "contributor_not_found",
|
||||
"remediation.source.not_found_error": "source_not_found"
|
||||
}
|
||||
Reference in New Issue
Block a user