MdpIngestServiceCollectionExtensions.cs 791 B

123456789101112131415161718
  1. using Microsoft.AspNetCore.Authentication;
  2. using Microsoft.Extensions.DependencyInjection;
  3. namespace Admin.NET.Plugin.AiDOP.DataPlatform.UnifiedIngress;
  4. public static class MdpIngestServiceCollectionExtensions
  5. {
  6. public static IServiceCollection AddMdpUnifiedIngress(this IServiceCollection services)
  7. {
  8. services.AddTransient<MdpIngestReceiveService>();
  9. services.AddScoped<MdpIngestAdmissionStore>();
  10. services.AddScoped<ISecretStore, MdpIngestSecretStore>();
  11. services.AddSingleton<IMdpIngestSecretProvider, EnvironmentMdpIngestSecretProvider>();
  12. services.AddAuthentication().AddScheme<AuthenticationSchemeOptions, MdpIngestAuthenticationHandler>(
  13. MdpIngestProtocol.AuthenticationScheme, _ => { });
  14. return services;
  15. }
  16. }