WebhookHttpClient
AgentPrism.Core.dllProvides the HttpClient used for webhook delivery, with built-in SSRF protection.
public sealed class WebhookHttpClient : IDisposableInheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Protection is built into the client itself, not caller
code. A single path that accidentally used an unprotected HttpClient
would defeat the entire defense. This type does not accept an external
Http.HttpMessageHandler; an internal constructor exists only for tests.
IHttpClientFactory is not used because it would add
Microsoft.Extensions.Http to the dependency graph, and a
consumer could reconfigure the factory and remove the protection.
Constructors
Section titled “Constructors”WebhookHttpClient(IOptionsMonitor<AgentPrismWebhookOptions>, IOptionsMonitor<AgentPrismEgressOptions>)
Section titled “ WebhookHttpClient(IOptionsMonitor<AgentPrismWebhookOptions>, IOptionsMonitor<AgentPrismEgressOptions>)”Initializes the production client.
public WebhookHttpClient(IOptionsMonitor<AgentPrismWebhookOptions> optionsMonitor, IOptionsMonitor<AgentPrismEgressOptions> egressOptions)Parameters
Section titled “Parameters”optionsMonitor IOptionsMonitor<AgentPrismWebhookOptions>
The webhook options.
egressOptions IOptionsMonitor<AgentPrismEgressOptions>
The shared egress options.
Exceptions
Section titled “Exceptions”optionsMonitor or egressOptions is null.
Methods
Section titled “Methods”Dispose()
Section titled “ Dispose()”public void Dispose()SendAsync(HttpRequestMessage, TimeSpan, CancellationToken)
Section titled “ SendAsync(HttpRequestMessage, TimeSpan, CancellationToken)”Sends a request.
public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, TimeSpan timeout, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”request HttpRequestMessage
The request.
timeout TimeSpan
The timeout specific to this request.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The response.
Exceptions
Section titled “Exceptions”request is null.