Skip to main content

SecureHttpFetcher Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.SecureHttpFetch

SecureHttpFetcher Class

Securely fetches content from external URIs with SSRF protection. This class should be registered with AddHttpClient for proper HTTP client configuration.

public class SecureHttpFetcher : Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher

Inheritance System.Object → SecureHttpFetcher

Implements ISecureHttpFetcher

Constructors

SecureHttpFetcher(ILogger<SecureHttpFetcher>, HttpClient, IOptions<SecureHttpFetchOptions>) Constructor

Securely fetches content from external URIs with SSRF protection. This class should be registered with AddHttpClient for proper HTTP client configuration.

public SecureHttpFetcher(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetcher> logger, System.Net.Http.HttpClient httpClient, Microsoft.Extensions.Options.IOptions<Abblix.Oidc.Server.Features.SecureHttpFetch.SecureHttpFetchOptions> options);

Parameters

logger Microsoft.Extensions.Logging.ILogger<SecureHttpFetcher>

The logger for recording fetch operations and errors.

httpClient System.Net.Http.HttpClient

The HTTP client for making secure requests.

options Microsoft.Extensions.Options.IOptions<SecureHttpFetchOptions>

Configuration options for secure HTTP fetching.

Methods

SecureHttpFetcher.FetchAsync<T>(Uri) Method

Fetches content from a URI with SSRF protection and response validation. Automatically handles JSON deserialization or raw string content based on the response Content-Type.

public System.Threading.Tasks.Task<Abblix.Utils.Result<T,Abblix.Oidc.Server.Common.OidcError>> FetchAsync<T>(System.Uri uri);

Type parameters

T

The type to deserialize the response to.

Parameters

uri System.Uri

The URI to fetch content from.

Implements FetchAsync<T>(Uri)

Returns

System.Threading.Tasks.Task<Abblix.Utils.Result<T,OidcError>>
A Result containing either the deserialized content or an OidcError.