feat(furniture-bff): enforce single active edge protocol
This commit is contained in:
parent
0d86a012b4
commit
52307bc7e7
@ -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
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user