5100* tests strengthtenen work
This commit is contained in:
@@ -8,6 +8,7 @@ using StellaOps.PacksRegistry.WebService;
|
||||
using StellaOps.PacksRegistry.WebService.Contracts;
|
||||
using StellaOps.PacksRegistry.WebService.Options;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using StellaOps.Router.AspNet;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -54,6 +55,13 @@ builder.Services.AddSingleton(TimeProvider.System);
|
||||
|
||||
builder.Services.AddHealthChecks();
|
||||
|
||||
// Stella Router integration
|
||||
var routerOptions = builder.Configuration.GetSection("PacksRegistry:Router").Get<StellaRouterOptionsBase>();
|
||||
builder.Services.TryAddStellaRouter(
|
||||
serviceName: "packsregistry",
|
||||
version: typeof(Program).Assembly.GetName().Version?.ToString() ?? "1.0.0",
|
||||
routerOptions: routerOptions);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
@@ -62,6 +70,7 @@ if (app.Environment.IsDevelopment())
|
||||
}
|
||||
|
||||
app.MapHealthChecks("/healthz");
|
||||
app.TryUseStellaRouter(routerOptions);
|
||||
|
||||
// Serve static OpenAPI stubs for packs APIs (until unified spec is generated)
|
||||
var openApiDir = Path.Combine(app.Environment.ContentRootPath, "OpenApi");
|
||||
@@ -713,6 +722,9 @@ app.MapGet("/api/v1/compliance/summary", async (string? tenant, ComplianceServic
|
||||
.Produces(StatusCodes.Status401Unauthorized)
|
||||
.Produces(StatusCodes.Status403Forbidden);
|
||||
|
||||
// Refresh Router endpoint cache
|
||||
app.TryRefreshStellaRouterEndpoints(routerOptions);
|
||||
|
||||
app.Run();
|
||||
|
||||
static bool IsAuthorized(HttpContext context, AuthOptions auth, out IResult result)
|
||||
|
||||
Reference in New Issue
Block a user