using Ablera.Serdica.Common.Tools;
using Ablera.Serdica.Common.Tools.Models.Config;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Models;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Contracts;

namespace Ablera.Serdica.Authority.Plugin.Bulstrad;

public class BulstradAsLdapSettingsProvider : GenericJsonSettingsProvider<LdapSettings[]>, ILdapSettingsProvider
{
    public const string JsonFileName = "bulstrad-settings.json";
    public static readonly string JsonFilePath =
        Path.GetDirectoryName(typeof(BulstradAsLdapSettingsProvider).Assembly.Location)
        ?? AppContext.BaseDirectory;

    public BulstradAsLdapSettingsProvider(
        ILogger<GenericJsonSettingsProvider<LdapSettings[]>> logger, 
        IOptions<JsonFileSettingsConfig> options) 
        : base(logger, options, JsonFileName, null, JsonFilePath)
    {
    }
}
