Skip to main content

CachingSecureHttpFetcherDecorator Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Features.SecureHttpFetch

CachingSecureHttpFetcherDecorator Class

A decorator for ISecureHttpFetcher that adds caching capabilities. Caches successful responses for the configured duration to reduce network calls and improve performance.

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

Inheritance System.Object → CachingSecureHttpFetcherDecorator

Implements ISecureHttpFetcher

Constructors

CachingSecureHttpFetcherDecorator(ISecureHttpFetcher, IMemoryCache, IOptionsMonitor<OidcOptions>) Constructor

A decorator for ISecureHttpFetcher that adds caching capabilities. Caches successful responses for the configured duration to reduce network calls and improve performance.

public CachingSecureHttpFetcherDecorator(Abblix.Oidc.Server.Features.SecureHttpFetch.ISecureHttpFetcher inner, Microsoft.Extensions.Caching.Memory.IMemoryCache cache, Microsoft.Extensions.Options.IOptionsMonitor<Abblix.Oidc.Server.Common.Configuration.OidcOptions> oidcOptions);

Parameters

inner ISecureHttpFetcher

The inner fetcher to decorate.

cache Microsoft.Extensions.Caching.Memory.IMemoryCache

The memory cache to store responses.

oidcOptions Microsoft.Extensions.Options.IOptionsMonitor<OidcOptions>

OIDC options containing the cache duration configuration.

Methods

CachingSecureHttpFetcherDecorator.FetchAsync<T>(Uri) Method

Fetches content from a URI with SSRF protection. For JSON content, deserializes to the specified type. For raw content like JWT strings, use string as the type parameter.

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. Use string for raw text content.

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 if the fetch operation fails.