refactor: relocate options classes to dedicated Options folders
Move configuration options from Core/DataAccess/DataSync/ExcelIO to dedicated Options folders within each project for better organization. Update all references and tests accordingly.
This commit is contained in:
@@ -2,7 +2,7 @@ using System.DirectoryServices.Protocols;
|
||||
using System.Net;
|
||||
using JdeScoping.Core.Interfaces;
|
||||
using JdeScoping.Core.Models;
|
||||
using JdeScoping.Core.Options;
|
||||
using JdeScoping.Infrastructure.Options;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
@@ -16,16 +16,13 @@ public sealed class LdapAuthService : IAuthService
|
||||
private const string LdapLookupFormat = "(sAMAccountName={0})";
|
||||
|
||||
private readonly LdapOptions _options;
|
||||
private readonly AuthOptions _authOptions;
|
||||
private readonly ILogger<LdapAuthService> _logger;
|
||||
|
||||
public LdapAuthService(
|
||||
IOptions<LdapOptions> options,
|
||||
IOptions<AuthOptions> authOptions,
|
||||
ILogger<LdapAuthService> logger)
|
||||
{
|
||||
_options = options.Value;
|
||||
_authOptions = authOptions.Value;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@@ -41,7 +38,7 @@ public sealed class LdapAuthService : IAuthService
|
||||
}
|
||||
|
||||
// Check if user is in admin bypass list
|
||||
var isAdminBypass = _authOptions.AdminBypassUsers
|
||||
var isAdminBypass = _options.AdminBypassUsers
|
||||
.Any(u => string.Equals(u, username, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
// Try each configured LDAP server
|
||||
|
||||
Reference in New Issue
Block a user