2using System.Net.Http.Headers;
3using System.Threading.Tasks;
5using Microsoft.Extensions.Logging;
39 ILogger<GraphQLServerClient>
logger,
59 ILogger<GraphQLServerClient>
logger,
62 IOperationResult<ILoginResult> loginResult,
78#pragma warning disable CA2012
82#pragma warning restore CA2012
87 var baseTask = base.CreateUpdatedAuthenticationHeader(bearer);
89 await
restClient.DisposeAsync().ConfigureAwait(
false);
94 return await baseTask.ConfigureAwait(
false);
AuthenticatedGraphQLServerClient(IGraphQLClient graphQLClient, IAsyncDisposable serviceProvider, ILogger< GraphQLServerClient > logger, IRestServerClient restClient)
Initializes a new instance of the AuthenticatedGraphQLServerClient class.
IRestServerClient? restClient
The current IRestServerClient.
AuthenticatedGraphQLServerClient(IGraphQLClient graphQLClient, IAsyncDisposable serviceProvider, ILogger< GraphQLServerClient > logger, Action< AuthenticationHeaderValue > setAuthenticationHeader, AuthenticationHeaderValue? basicCredentialsHeader, IOperationResult< ILoginResult > loginResult, Func< string, IRestServerClient > getRestClientForToken)
Initializes a new instance of the AuthenticatedGraphQLServerClient class.
override async ValueTask< AuthenticationHeaderValue > CreateUpdatedAuthenticationHeader(string bearer)
Create a AuthenticationHeaderValue from a given bearer token.A new AuthenticationHeaderValue.
ITransferClient TransferClient
The REST ITransferClient.
readonly? Func< string, IRestServerClient > getRestClientForToken
A Func<T, TResult> that takes a bearer token as input and outputs a ITransferClient that uses it.
override ValueTask DisposeAsync()
readonly IAsyncDisposable serviceProvider
The IAsyncDisposable to be DisposeAsync'd with the GraphQLServerClient.
readonly ILogger< GraphQLServerClient > logger
The ILogger for the GraphQLServerClient.
readonly IGraphQLClient graphQLClient
The IGraphQLClient for the GraphQLServerClient.
readonly? Action< AuthenticationHeaderValue > setAuthenticationHeader
The Action<T> which sets the AuthenticationHeaderValue for HTTP request in the current async context.
readonly? AuthenticationHeaderValue basicCredentialsHeader
The AuthenticationHeaderValue containing the authenticated user's password credentials.
Extension methods for the ValueTask and ValueTask<TResult> classes.
static async ValueTask WhenAll(IEnumerable< ValueTask > tasks)
Fully await a given list of tasks .
A IGraphQLServerClient known to be authenticated.
Main client for communicating with a server.
ITransferClient Transfer
Access the ITransferClient.
For transferring data Streams.