Class HonuaAuthHandler<TOptions>
- Namespace
- Honua.Sdk.Abstractions.Authentication
- Assembly
- Honua.Sdk.Abstractions.dll
Shared authentication handler for Honua REST clients; rejects credentials over plain HTTP to non-loopback hosts.
public abstract class HonuaAuthHandler<TOptions> : DelegatingHandler, IDisposable where TOptions : class, IHonuaClientOptions, IHonuaAuthenticationOptions
Type Parameters
TOptions
- Inheritance
-
HonuaAuthHandler<TOptions>
- Implements
- Inherited Members
Constructors
HonuaAuthHandler(TOptions, string, Action<Uri?>)
Initializes a new instance of the HonuaAuthHandler<TOptions> class.
protected HonuaAuthHandler(TOptions options, string serviceName, Action<Uri?> validateBaseAddress)
Parameters
optionsTOptionsThe resolved client options carrying credentials and base address.
serviceNamestringThe logical Honua service name used in authentication diagnostics (for example
"stac"or"admin").validateBaseAddressAction<Uri>The owning package's base-address validation callback, invoked once at construction so the failure carries the client-specific display name.
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
requestHttpRequestMessageThe HTTP request message to send to the server.
cancellationTokenCancellationTokenA cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
requestwas null.- OperationCanceledException
The cancellation token was canceled. This exception is stored into the returned task.