From 52307bc7e7b88caf39e27de525e6d0f4126f40e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Ren=C3=A9=20White=20Enciso?= Date: Wed, 25 Feb 2026 13:13:56 -0600 Subject: [PATCH] feat(furniture-bff): enforce single active edge protocol --- docs/architecture/bff-service-boundary.md | 1 + src/Furniture.Bff.Rest/Program.cs | 6 ++++++ 2 files changed, 7 insertions(+) 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();