using Ablera.Serdica.Plugin.Contracts;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Ablera.Serdica.Authority.Plugins.Base.Contracts;
using Ablera.Serdica.Authority.Plugin.Bulstrad;
using Microsoft.AspNetCore.Identity;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Attributes;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Normalizers;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Contracts;
namespace Ablera.Serdica.Identity.Plugin.Bulstrad;

public class ServiceRegistrator : IPluginServiceRegistrator
{
    public void RegisterServices(IServiceCollection services, IConfiguration configuration)
    => services
            // Add Ldap plugin registrations
            .AddSingleton<IEmailNormalizer, EmailNormalizer>()
            .AddSingleton<IUsernameNormalizer, UsernameNormalizer>()
            // Bulstrad plugin specific
            .AddSingleton<BulstradAsLdapSettingsProvider>()
            .AddScoped<BulstradAdIdentityFacade>()
            .AddScoped<IUserManagementFacade<IdentityUser<string>>, Ablera.Serdica.Authority.Plugin.Bulstrad.IdentityManagementFacade>();
}
