feat(furniture-bff): enforce single active edge protocol

This commit is contained in:
José René White Enciso 2026-02-25 13:13:56 -06:00
parent 0d86a012b4
commit 52307bc7e7
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ Preserve BFF as an edge adapter layer that depends on service contracts only.
- REST edge exposure - REST edge exposure
- Service client adaptation - Service client adaptation
- Correlation/tracing propagation - Correlation/tracing propagation
- Single active edge protocol policy enforcement (`rest`)
## Prohibited ## Prohibited
- Direct DAL access - Direct DAL access

View File

@ -11,6 +11,12 @@ using Microsoft.Extensions.Primitives;
const string CorrelationHeaderName = "x-correlation-id"; const string CorrelationHeaderName = "x-correlation-id";
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
var edgeProtocol = builder.Configuration["FurnitureBff:EdgeProtocol"] ?? "rest";
if (!string.Equals(edgeProtocol, "rest", StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException(
$"Furniture BFF supports one active edge protocol per deployment. Configured: '{edgeProtocol}'. Expected: 'rest'.");
}
builder.Services.AddHttpContextAccessor(); builder.Services.AddHttpContextAccessor();
builder.Services.AddHealthChecks(); builder.Services.AddHealthChecks();