Class ProtoHttpAuthenticationApplier

Namespace
ProtoTest.Http
Assembly
ProtoTest.Http.dll

Resolves and applies (or explicitly skips) authentication for one outgoing HTTP request, shared by every protocol request builder. The outcome is an attribute of the request operation the caller owns, not a separate entry: authentication is part of the request, not a step beside it.

public static class ProtoHttpAuthenticationApplier
Inheritance
ProtoHttpAuthenticationApplier
Inherited Members

Methods

ApplyAsync(Func<ProtoExecutionContext, IProtoHttpAuthenticator>?, IProtoHttpAuthenticator?, HttpRequestMessage, ProtoExecutionContext, string, ProtoTraceOperation?, CancellationToken)

Resolves authenticator from factory when not already resolved, applies it, and returns the resolved authenticator so the caller can cache it for later requests built from the same fluent builder. Sets auth.outcome and auth.type on requestOperation.

public static ValueTask<IProtoHttpAuthenticator?> ApplyAsync(Func<ProtoExecutionContext, IProtoHttpAuthenticator>? factory, IProtoHttpAuthenticator? authenticator, HttpRequestMessage request, ProtoExecutionContext context, string clientName, ProtoTraceOperation? requestOperation, CancellationToken cancellationToken)

Parameters

factory Func<ProtoExecutionContext, IProtoHttpAuthenticator>
authenticator IProtoHttpAuthenticator
request HttpRequestMessage
context ProtoExecutionContext
clientName string
requestOperation ProtoTraceOperation
cancellationToken CancellationToken

Returns

ValueTask<IProtoHttpAuthenticator>