feat: Initialize Zastava Webhook service with TLS and Authority authentication

- Added Program.cs to set up the web application with Serilog for logging, health check endpoints, and a placeholder admission endpoint.
- Configured Kestrel server to use TLS 1.3 and handle client certificates appropriately.
- Created StellaOps.Zastava.Webhook.csproj with necessary dependencies including Serilog and Polly.
- Documented tasks in TASKS.md for the Zastava Webhook project, outlining current work and exit criteria for each task.
This commit is contained in:
2025-10-19 18:36:22 +03:00
parent 7e2fa0a42a
commit 5ce40d2eeb
966 changed files with 91038 additions and 1850 deletions

View File

@@ -23,11 +23,11 @@ internal static class ScanEndpoints
Converters = { new JsonStringEnumConverter() }
};
public static void MapScanEndpoints(this RouteGroupBuilder apiGroup)
public static void MapScanEndpoints(this RouteGroupBuilder apiGroup, string scansSegment)
{
ArgumentNullException.ThrowIfNull(apiGroup);
var scans = apiGroup.MapGroup("/scans");
var scans = apiGroup.MapGroup(NormalizeSegment(scansSegment));
scans.MapPost("/", HandleSubmitAsync)
.WithName("scanner.scans.submit")
@@ -295,4 +295,15 @@ internal static class ScanEndpoints
var payload = JsonSerializer.Serialize(value, SerializerOptions);
return Results.Content(payload, "application/json", System.Text.Encoding.UTF8, statusCode);
}
private static string NormalizeSegment(string segment)
{
if (string.IsNullOrWhiteSpace(segment))
{
return "/scans";
}
var trimmed = segment.Trim('/');
return "/" + trimmed;
}
}