namespace SharedKernel { public sealed class AppSettings { public AppSection App { get; set; } = new(); public ConnectionStringsSection ConnectionStrings { get; set; } = new(); public RedisSection Redis { get; set; } = new(); public SmtpSection SMTP { get; set; } = new(); public JwtSection JWT { get; set; } = new(); public ForwardedHeadersSection ForwardedHeaders { get; set; } = new(); public CorsPolicySection CorsPolicy { get; set; } = new(); public sealed class AppSection { public string Name { get; set; } = string.Empty; public string Company { get; set; } = string.Empty; public string BaseURL { get; set; } = string.Empty; public string ApiURL { get; set; } = string.Empty; public string FrontURL { get; set; } = string.Empty; } public sealed class ConnectionStringsSection { public string DefaultConnection { get; set; } = string.Empty; public int Timeout { get; set; } } public class RedisSection { public string DefaultConnection { get; set; } = string.Empty; public string CachePrefix { get; set; } = string.Empty; public string AuthTicketPrefix { get; set; } = string.Empty; public string DataProtectionKey { get; set; } = string.Empty; public TimeSpan DefaultKeyLifetime { get; set; } } public class SmtpSection { public string Server { get; set; } = string.Empty; public int Port { get; set; } public bool EnableSSL { get; set; } = false; public string Username { get; set; } = string.Empty; public string Password { get; set; } = string.Empty; public string FromEmail { get; set; } = string.Empty; public string FromName { get; set; } = string.Empty; } public class JwtSection { public string SecretKey { get; set; } = string.Empty; public string Issuer { get; set; } = string.Empty; public string Audience { get; set; } = string.Empty; public int AccessTokenExpiration { get; set; } public int RefreshTokenExpiration { get; set; } } public class ForwardedHeadersSection { public int? ForwardLimit { get; set; } = default; public List KnownProxies { get; set; } = []; public List KnownNetworks { get; set; } = []; } public class CorsPolicySection { public string Name { get; set; } = string.Empty; public long PreflightMaxAgeSeconds { get; set; } = 0; public List AllowedOrigins { get; set; } = []; } } }