diff --git a/docs/architecture/bff-service-boundary.md b/docs/architecture/bff-service-boundary.md index 94e2558..762e7d0 100644 --- a/docs/architecture/bff-service-boundary.md +++ b/docs/architecture/bff-service-boundary.md @@ -7,6 +7,7 @@ Preserve BFF as an edge adapter layer that depends on service contracts only. - REST edge exposure - Service client adaptation - Correlation/tracing propagation +- Single active edge protocol policy enforcement (`rest`) ## Prohibited - Direct DAL access diff --git a/src/Furniture.Bff.Rest/Program.cs b/src/Furniture.Bff.Rest/Program.cs index 3edd947..a99f89e 100644 --- a/src/Furniture.Bff.Rest/Program.cs +++ b/src/Furniture.Bff.Rest/Program.cs @@ -11,6 +11,12 @@ using Microsoft.Extensions.Primitives; const string CorrelationHeaderName = "x-correlation-id"; 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.AddHealthChecks();