Table of Contents

Class TenantValidationMiddleware

Namespace
Compendium.Adapters.AspNetCore.Security
Assembly
Compendium.Adapters.AspNetCore.dll

Middleware that validates tenant identity from multiple sources (header, subdomain, JWT) and ensures consistency before allowing the request to proceed.

public sealed class TenantValidationMiddleware
Inheritance
TenantValidationMiddleware
Inherited Members

Constructors

TenantValidationMiddleware(RequestDelegate, IOptions<TenantValidationMiddlewareOptions>, ILogger<TenantValidationMiddleware>)

Initializes a new instance of the TenantValidationMiddleware class.

public TenantValidationMiddleware(RequestDelegate next, IOptions<TenantValidationMiddlewareOptions> options, ILogger<TenantValidationMiddleware> logger)

Parameters

next RequestDelegate
options IOptions<TenantValidationMiddlewareOptions>
logger ILogger<TenantValidationMiddleware>

Methods

InvokeAsync(HttpContext, ITenantConsistencyValidator, ITenantStore, TenantContext)

Processes the request through the tenant validation pipeline.

public Task InvokeAsync(HttpContext context, ITenantConsistencyValidator validator, ITenantStore tenantStore, TenantContext tenantContext)

Parameters

context HttpContext
validator ITenantConsistencyValidator
tenantStore ITenantStore
tenantContext TenantContext

Returns

Task