Table of Contents

Class AuthorizationContextBehavior<TMessage, TResponse>

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

Establishes an isolated authorization snapshot and lifetime for each Mediator dispatch.

public sealed class AuthorizationContextBehavior<TMessage, TResponse> : IPipelineBehavior<TMessage, TResponse> where TMessage : IAuthorizationMessage, IMessage where TResponse : IResult, IFailureFactory<TResponse>

Type Parameters

TMessage

An authorization-marked Mediator message.

TResponse

A result-compatible response.

Inheritance
AuthorizationContextBehavior<TMessage, TResponse>
Implements
IPipelineBehavior<TMessage, TResponse>
Inherited Members
Extension Methods

Remarks

Register before static and resource authorization. Standard Trellis and resource registration helpers install this infrastructure automatically. Actor resolution remains in the authorization stages; this behavior does not authenticate eagerly.

Methods

Handle(TMessage, MessageHandlerDelegate<TMessage, TResponse>, CancellationToken)

public ValueTask<TResponse> Handle(TMessage message, MessageHandlerDelegate<TMessage, TResponse> next, CancellationToken cancellationToken)

Parameters

message TMessage
next MessageHandlerDelegate<TMessage, TResponse>
cancellationToken CancellationToken

Returns

ValueTask<TResponse>