Class AuthorizationContextBehavior<TMessage, TResponse>
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
TMessageAn authorization-marked Mediator message.
TResponseA 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
messageTMessagenextMessageHandlerDelegate<TMessage, TResponse>cancellationTokenCancellationToken
Returns
- ValueTask<TResponse>