Files
OptixServe/OptixServe.Api/Configuration/AppSettings.cs
Huxley Deng 724b1d4dae Add JWT authentication.
Add: JWT authentication in Web API. Related configuration and services are added.
2025-07-10 20:08:48 +08:00

34 lines
823 B
C#

namespace OptixServe.Api.Configuration;
public record OptixServeSettings
{
public ApiSettings? Api { get; set; } = new();
public DatabaseSettings? Database { get; set; } = new();
public JwtSettings? Jwt { get; set; } = new();
}
public record ApiSettings
{
public string? Listen { get; set; } = "127.0.0.1";
public int? Port { get; set; } = 10086;
}
public record JwtSettings
{
public string Secret { get; set; } = string.Empty;
public string Issuer { get; set; } = "OptixServe";
public string Audience { get; set; } = "OptixServeUsers";
public int TokenExpirationMinutes { get; set; } = 60;
}
public enum DatabaseType
{
Sqlite,
MySQL
}
public record DatabaseSettings
{
public DatabaseType Type { get; set; } = DatabaseType.Sqlite;
public string? Host { get; set; }
}