stela ops usage fixes roles propagation and timoeut, one account to support multi tenants, migrations consolidation, search to support documentation, doctor and open api vector db search
This commit is contained in:
@@ -30,6 +30,7 @@ using StellaOps.PolicyDsl;
|
||||
using System.IO;
|
||||
using System.Threading.RateLimiting;
|
||||
|
||||
using StellaOps.Router.AspNet;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
var policyEngineConfigFiles = new[]
|
||||
@@ -342,6 +343,12 @@ if (bootstrap.Options.Authority.Enabled)
|
||||
});
|
||||
}
|
||||
|
||||
// Stella Router integration
|
||||
var routerEnabled = builder.Services.AddRouterMicroservice(
|
||||
builder.Configuration,
|
||||
serviceName: "policy-engine",
|
||||
version: System.Reflection.CustomAttributeExtensions.GetCustomAttribute<System.Reflection.AssemblyInformationalVersionAttribute>(System.Reflection.Assembly.GetExecutingAssembly())?.InformationalVersion ?? "1.0.0",
|
||||
routerOptionsSection: "Router");
|
||||
builder.TryAddStellaOpsLocalBinding("policy-engine");
|
||||
var app = builder.Build();
|
||||
app.LogStellaOpsLocalHostname("policy-engine");
|
||||
@@ -349,6 +356,7 @@ app.LogStellaOpsLocalHostname("policy-engine");
|
||||
app.UseStellaOpsCors();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.TryUseStellaRouter(routerEnabled);
|
||||
|
||||
if (rateLimitOptions.Enabled)
|
||||
{
|
||||
@@ -406,6 +414,7 @@ app.MapPolicySnapshotsApi();
|
||||
app.MapViolationEventsApi();
|
||||
app.MapConflictsApi();
|
||||
|
||||
app.TryRefreshStellaRouterEndpoints(routerEnabled);
|
||||
app.Run();
|
||||
|
||||
// Make Program class internal to prevent type conflicts when referencing this assembly
|
||||
@@ -413,3 +422,4 @@ namespace StellaOps.Policy.Engine
|
||||
{
|
||||
public partial class Program { }
|
||||
}
|
||||
|
||||
|
||||
@@ -52,4 +52,8 @@
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="StellaOps.Policy.Engine.Tests" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="StellaOpsReleaseVersion">
|
||||
<Version>1.0.0-alpha1</Version>
|
||||
<InformationalVersion>1.0.0-alpha1</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -32,6 +32,7 @@ using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
||||
using StellaOps.Router.AspNet;
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Logging.ClearProviders();
|
||||
@@ -301,6 +302,12 @@ builder.Services.AddHttpClient<IPolicyEngineClient, PolicyEngineClient>((service
|
||||
})
|
||||
.AddPolicyHandler(static (provider, _) => CreatePolicyEngineRetryPolicy(provider));
|
||||
|
||||
// Stella Router integration
|
||||
var routerEnabled = builder.Services.AddRouterMicroservice(
|
||||
builder.Configuration,
|
||||
serviceName: "policy-gateway",
|
||||
version: System.Reflection.CustomAttributeExtensions.GetCustomAttribute<System.Reflection.AssemblyInformationalVersionAttribute>(System.Reflection.Assembly.GetExecutingAssembly())?.InformationalVersion ?? "1.0.0",
|
||||
routerOptionsSection: "Router");
|
||||
builder.TryAddStellaOpsLocalBinding("policy-gateway");
|
||||
var app = builder.Build();
|
||||
app.LogStellaOpsLocalHostname("policy-gateway");
|
||||
@@ -316,6 +323,7 @@ app.UseStatusCodePages();
|
||||
app.UseStellaOpsCors();
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
app.TryUseStellaRouter(routerEnabled);
|
||||
|
||||
app.MapHealthChecks("/healthz");
|
||||
|
||||
@@ -655,6 +663,7 @@ app.MapAdvisorySourcePolicyEndpoints();
|
||||
// Assistant tool lattice endpoints (Sprint: SPRINT_20260113_005_POLICY_assistant_tool_lattice)
|
||||
app.MapToolLatticeEndpoints();
|
||||
|
||||
app.TryRefreshStellaRouterEndpoints(routerEnabled);
|
||||
app.Run();
|
||||
|
||||
static IAsyncPolicy<HttpResponseMessage> CreateAuthorityRetryPolicy(IServiceProvider provider)
|
||||
@@ -733,3 +742,4 @@ namespace StellaOps.Policy.Gateway
|
||||
{
|
||||
public partial class Program { }
|
||||
}
|
||||
|
||||
|
||||
@@ -30,4 +30,8 @@
|
||||
<PackageReference Include="Polly.Extensions.Http" />
|
||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="StellaOpsReleaseVersion">
|
||||
<Version>1.0.0-alpha1</Version>
|
||||
<InformationalVersion>1.0.0-alpha1</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user