save development progress

This commit is contained in:
StellaOps Bot
2025-12-25 23:09:58 +02:00
parent d71853ad7e
commit aa70af062e
351 changed files with 37683 additions and 150156 deletions

View File

@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\src\__Libraries\StellaOps.Router.Gateway\StellaOps.Router.Gateway.csproj" />
<ProjectReference Include="..\..\..\..\src\__Libraries\StellaOps.Router.Transport.InMemory\StellaOps.Router.Transport.InMemory.csproj" />
<ProjectReference Include="..\..\..\..\src\__Libraries\StellaOps.Router.Config\StellaOps.Router.Config.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="router.yaml" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,50 @@
using StellaOps.Router.Gateway;
using StellaOps.Router.Gateway.Authorization;
using StellaOps.Router.Gateway.DependencyInjection;
using StellaOps.Router.Config;
using StellaOps.Router.Transport.InMemory;
var builder = WebApplication.CreateBuilder(args);
// Router configuration from YAML
builder.Services.AddRouterConfig(options =>
{
options.ConfigPath = "router.yaml";
options.EnableHotReload = true;
});
// Router gateway services
builder.Services.AddRouterGateway(builder.Configuration);
// In-memory transport for demo (can switch to TCP/TLS for production)
builder.Services.AddInMemoryTransport();
// Authority integration (no-op for demo)
builder.Services.AddNoOpAuthorityIntegration();
// Required for app.UseAuthentication() even when running without a real auth scheme (demo/tests).
builder.Services.AddAuthentication();
var app = builder.Build();
// Middleware pipeline
app.UseForwardedHeaders();
app.UseAuthentication();
app.UseClaimsAuthorization();
// Map OpenAPI endpoints
app.MapRouterOpenApi();
// Simple health endpoint
app.MapGet("/health", () => Results.Ok(new { status = "healthy" }));
// Router gateway middleware (endpoint resolution, routing decision, dispatch)
app.UseRouterGateway();
app.Run();
// Partial class for WebApplicationFactory integration testing
namespace Examples.Gateway
{
public partial class Program { }
}

View File

@@ -0,0 +1,13 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"GatewayNode": {
"Region": "demo",
"NodeId": "gw-demo-01"
}
}

View File

@@ -0,0 +1,50 @@
# Router Configuration for Example Gateway
# This file configures how the gateway routes requests to microservices
gateway:
nodeId: "gw-demo-01"
region: "demo"
listenPort: 8080
# Payload limits
payloadLimits:
maxRequestBodyBytes: 10485760 # 10 MB
maxStreamingChunkBytes: 65536 # 64 KB
# Health monitoring
healthMonitoring:
staleThreshold: "00:00:30"
checkInterval: "00:00:05"
# Transport configuration
transports:
# In-memory transport (for demo)
inMemory:
enabled: true
# TCP transport (production)
# tcp:
# enabled: true
# port: 5100
# backlog: 100
# TLS transport (production with encryption)
# tls:
# enabled: true
# port: 5101
# certificatePath: "certs/gateway.pfx"
# certificatePassword: "demo"
# Routing configuration
routing:
# Default routing algorithm
algorithm: "round-robin"
# Region affinity (prefer local microservices)
regionAffinity: true
affinityWeight: 0.8
# Logging
logging:
level: "Information"
requestLogging: true