feat: ship agent-first mission control v0.2.57
CI - Build & Test / Backend (.NET) (push) Successful in 42s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 2m46s
CI - Build & Test / Security Check (push) Successful in 3s
CI - Build & Test / Deploy Nexus (push) Successful in 56s

This commit is contained in:
AzuTear
2026-07-31 22:39:47 +02:00
parent 3bc7622977
commit f5552218bc
535 changed files with 95242 additions and 8791 deletions
-12
View File
@@ -6,23 +6,11 @@ namespace Nexus.Api.Middleware;
/// Middleware that authenticates requests via the X-Nexus-Api-Key header.
/// On match, sets a ClaimsPrincipal with role "Service".
/// On mismatch or absent header, passes through to next middleware (JWT auth).
///
/// The MCP endpoint (/mcp) is intentionally skipped — the MCP SDK handles its own
/// authentication via X-Agent-Id + X-Nexus-Api-Key headers through NexusMcpTools.
/// </summary>
public sealed class ApiKeyMiddleware(RequestDelegate next)
{
private static readonly PathString McpPath = new("/mcp");
public async Task InvokeAsync(HttpContext context)
{
// MCP endpoint handles its own auth — skip ApiKey interference
if (context.Request.Path.StartsWithSegments(McpPath))
{
await next(context);
return;
}
var configuration = context.RequestServices.GetRequiredService<IConfiguration>();
var apiKey = configuration["NexusApiKey"];