using Ablera.Serdica.Common.Tools;
using Ablera.Serdica.Common.Tools.Models.Config;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Models;
using Ablera.Serdica.Extensions.Novell.Directory.Ldap.Contracts;

namespace Ablera.Serdica.Authority.Plugin.Ldap;

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

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