Table of Contents

Class FailureScenarioMiddleware

Namespace
ReferenceApplication.Web.Governance.FailureScenarios
Assembly
ReferenceApplication.Web.dll

Consumes the armed failure-scenario run a request names, and records how the request ended.

public sealed class FailureScenarioMiddleware
Inheritance
FailureScenarioMiddleware
Inherited Members

Remarks

Registered only while the failure scenarios are active, between authorization and endpoint governance. A request without the run header passes through untouched. A request with the header must consume an unexpired run armed for the same actor, or it is refused with 409 before governance runs, so a used, expired, or foreign run identifier never reaches an endpoint.

For the missing-capability-grant scenario, the request's principal is replaced with a copy that lacks the consequential capability claim, so the actor's own grant cannot satisfy the check for this one request.

Constructors

FailureScenarioMiddleware(RequestDelegate)

Consumes the armed failure-scenario run a request names, and records how the request ended.

public FailureScenarioMiddleware(RequestDelegate next)

Parameters

next RequestDelegate

The next middleware.

Remarks

Registered only while the failure scenarios are active, between authorization and endpoint governance. A request without the run header passes through untouched. A request with the header must consume an unexpired run armed for the same actor, or it is refused with 409 before governance runs, so a used, expired, or foreign run identifier never reaches an endpoint.

For the missing-capability-grant scenario, the request's principal is replaced with a copy that lacks the consequential capability claim, so the actor's own grant cannot satisfy the check for this one request.

Methods

InvokeAsync(HttpContext, FailureScenarioRegistry, IHttpGovernanceActorContextResolver, IHttpGovernanceRequestCorrelationResolver, IOptions<ApplicationAuthorizationOptions>)

Processes a request.

public Task InvokeAsync(HttpContext httpContext, FailureScenarioRegistry registry, IHttpGovernanceActorContextResolver actorContextResolver, IHttpGovernanceRequestCorrelationResolver correlationResolver, IOptions<ApplicationAuthorizationOptions> authorizationOptions)

Parameters

httpContext HttpContext

The request.

registry FailureScenarioRegistry

The run registry.

actorContextResolver IHttpGovernanceActorContextResolver

AsiBackbone's actor resolver.

correlationResolver IHttpGovernanceRequestCorrelationResolver

AsiBackbone's request correlation resolver.

authorizationOptions IOptions<ApplicationAuthorizationOptions>

The application's claim mapping.

Returns

Task

A task that completes when the request has been processed.