| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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<string> KnownProxies { get; set; } = [];
- public List<string> KnownNetworks { get; set; } = [];
- }
- public class CorsPolicySection
- {
- public string Name { get; set; } = string.Empty;
- public long PreflightMaxAgeSeconds { get; set; } = 0;
- public List<string> AllowedOrigins { get; set; } = [];
- }
- }
- }
|