Table of Contents

Class RequireRoleFilter

Namespace
JD.AI.Gateway.Middleware
Assembly
JD.AI.Gateway.dll

Endpoint filter that enforces RequireRoleAttribute.

public sealed class RequireRoleFilter : IEndpointFilter
Inheritance
RequireRoleFilter
Implements
Inherited Members

Constructors

RequireRoleFilter(GatewayRole)

Endpoint filter that enforces RequireRoleAttribute.

public RequireRoleFilter(GatewayRole minimumRole)

Parameters

minimumRole GatewayRole

Methods

InvokeAsync(EndpointFilterInvocationContext, EndpointFilterDelegate)

Implements the core logic associated with the filter given a EndpointFilterInvocationContext and the next filter to call in the pipeline.

public ValueTask<object?> InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)

Parameters

context EndpointFilterInvocationContext

The EndpointFilterInvocationContext associated with the current request/response.

next EndpointFilterDelegate

The next filter in the pipeline.

Returns

ValueTask<object>

An awaitable result of calling the handler and apply any modifications made by filters in the pipeline.