namespace ScadaLink.Security;
public class SecurityOptions
{
public string LdapServer { get; set; } = string.Empty;
public int LdapPort { get; set; } = 389;
public bool LdapUseTls { get; set; } = true;
///
/// Allow insecure (non-TLS) LDAP connections. ONLY for dev/test with GLAuth.
/// Must be false in production.
///
public bool AllowInsecureLdap { get; set; } = false;
///
/// Base DN for LDAP searches (e.g., "dc=example,dc=com").
///
public string LdapSearchBase { get; set; } = string.Empty;
///
/// Service account DN for LDAP user searches (e.g., "cn=admin,dc=example,dc=com").
/// Required for search-then-bind authentication. If empty, direct bind with
/// cn={username},{LdapSearchBase} is attempted instead.
///
public string LdapServiceAccountDn { get; set; } = string.Empty;
///
/// Service account password for LDAP user searches.
///
public string LdapServiceAccountPassword { get; set; } = string.Empty;
///
/// LDAP attribute that contains the user's display name.
///
public string LdapDisplayNameAttribute { get; set; } = "cn";
///
/// LDAP attribute that contains group membership.
///
public string LdapGroupAttribute { get; set; } = "memberOf";
public string JwtSigningKey { get; set; } = string.Empty;
public int JwtExpiryMinutes { get; set; } = 15;
public int IdleTimeoutMinutes { get; set; } = 30;
///
/// Minutes before token expiry to trigger refresh.
///
public int JwtRefreshThresholdMinutes { get; set; } = 5;
}