Table of Contents

Class ValidateSwaggerRightMiddleware

Namespace
Arc4u.OAuth2.Middleware
Assembly
Arc4u.OAuth2.AspNetCore.dll

A middleware that protects the Swagger document path: when the current principal does not have the right Access, the response is a status 200 with ContentToDisplay instead of the document.

public class ValidateSwaggerRightMiddleware
Inheritance
ValidateSwaggerRightMiddleware
Inherited Members

Constructors

ValidateSwaggerRightMiddleware(RequestDelegate, ValidateSwaggerRightMiddlewareOption)

Initializes a new instance of the ValidateSwaggerRightMiddleware class.

public ValidateSwaggerRightMiddleware(RequestDelegate next, ValidateSwaggerRightMiddlewareOption option)

Parameters

next RequestDelegate

The next middleware of the pipeline.

option ValidateSwaggerRightMiddlewareOption

The path to protect and the right to check.

Exceptions

ArgumentNullException

An argument is null.

Methods

Invoke(HttpContext)

Processes the request.

public Task Invoke(HttpContext context)

Parameters

context HttpContext

The HTTP context.

Returns

Task

A task that completes when the response is written or the rest of the pipeline is done.