http-api/src/Application/ConfigurationOptions.cs

44 lines
1.2 KiB
C#

namespace cuqmbr.TravelGuide.Application;
public sealed class ConfigurationOptions
{
public static string SectionName { get; } = "";
public LocalizationConfigurationOptions Localization { get; set; } = new();
public LoggingConfigurationOptions Logging { get; set; } = new();
public JsonWebTokenConfigurationOptions JsonWebToken { get; set; } = new();
}
public sealed class LocalizationConfigurationOptions
{
public string DefaultCultureName { get; set; } = "en-US";
public TimeSpan CacheDuration { get; set; } = TimeSpan.FromMinutes(30);
}
public sealed class LoggingConfigurationOptions
{
public string Type { get; set; } = "SimpleConsole";
public string LogLevel { get; set; } = "Information";
public string TimestampFormat { get; set; } = "yyyy-MM-ddTHH:mm:ss.fffK";
public bool UseUtcTimestamp { get; set; } = true;
}
public sealed class JsonWebTokenConfigurationOptions
{
public string Issuer { get; set; } = "localhost";
public string Audience { get; set; } = "localhost";
public string IssuerSigningKey { get; set; } = "change-me";
public TimeSpan AccessTokenValidity { get; set; } = TimeSpan.FromMinutes(15);
public TimeSpan RefreshTokenValidity { get; set; } = TimeSpan.FromDays(3);
}