| 1234567891011121314151617181920212223242526272829 |
- using Microsoft.AspNetCore.Authentication;
- using Microsoft.Extensions.DependencyInjection;
- namespace Admin.NET.Plugin.AiDOP.DataPlatform.UnifiedIngress;
- public static class MdpIngestServiceCollectionExtensions
- {
- public static IServiceCollection AddMdpUnifiedIngress(this IServiceCollection services)
- {
- services.AddTransient<MdpIngestReceiveService>();
- services.AddSingleton<MdpApiPullEgress>();
- services.AddSingleton<MdpApiPullClient>();
- services.AddScoped<MdpApiPullService>();
- services.AddScoped<MdpEdgeDeviceService>();
- services.AddTransient<MdpIngestBatchStatusService>();
- services.AddTransient<MdpIngestBatchTraceService>();
- services.AddTransient<MdpIngestRawRetentionService>();
- services.AddTransient<MdpIngestReplayService>();
- services.AddScoped<MdpIngestAdmissionStore>();
- services.AddSingleton<MdpIngestExternalIdentities>();
- services.AddHttpClient(MdpIngestExternalIdentities.MetadataClient, client => client.Timeout = TimeSpan.FromSeconds(8))
- .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false });
- services.AddScoped<ISecretStore, MdpIngestSecretStore>();
- services.AddSingleton<IMdpIngestSecretProvider, EnvironmentMdpIngestSecretProvider>();
- services.AddAuthentication().AddScheme<AuthenticationSchemeOptions, MdpIngestAuthenticationHandler>(
- MdpIngestProtocol.AuthenticationScheme, _ => { });
- return services;
- }
- }
|