diff --git a/Abblix.Oidc.Server/Endpoints/ServiceCollectionExtensions.cs b/Abblix.Oidc.Server/Endpoints/ServiceCollectionExtensions.cs index 44c0ff3..87acaa6 100644 --- a/Abblix.Oidc.Server/Endpoints/ServiceCollectionExtensions.cs +++ b/Abblix.Oidc.Server/Endpoints/ServiceCollectionExtensions.cs @@ -77,16 +77,30 @@ public static IServiceCollection AddAuthorizationEndpoint(this IServiceCollectio .AddScoped(); } + /// + /// Registers authorization request fetchers and related services into the provided IServiceCollection. + /// This method adds implementations for various authorization request fetchers as singletons, ensuring + /// that they are efficiently reused throughout the application. It also composes these fetchers into a + /// composite fetcher to handle different types of authorization requests seamlessly. + /// + /// The IServiceCollection to which the services will be added. + /// The updated IServiceCollection with the added authorization request fetchers. public static IServiceCollection AddAuthorizationRequestFetchers(this IServiceCollection services) { return services + // Add a JSON object binder as a singleton + .AddSingleton() + + // Add individual authorization request fetchers as singletons .AddSingleton() .AddSingleton() - .AddSingleton() .AddSingleton() + + // Compose the individual fetchers into a composite fetcher .Compose(); } + /// /// Adds a series of validators for authorization context as a composite service to ensure comprehensive validation /// of authorization requests.