You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.3 KiB
50 lines
1.3 KiB
namespace CellularManagement.Domain.Options;
|
|
|
|
/// <summary>
|
|
/// 认证配置
|
|
/// 用于配置用户认证相关的参数
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 设计说明:
|
|
/// 1. 使用强类型配置,避免魔法字符串
|
|
/// 2. 支持从配置文件加载
|
|
/// 3. 提供合理的默认值
|
|
/// 4. 集中管理认证相关配置
|
|
/// </remarks>
|
|
public class AuthConfiguration
|
|
{
|
|
/// <summary>
|
|
/// 配置节点名称
|
|
/// </summary>
|
|
public const string SectionName = "Auth";
|
|
|
|
/// <summary>
|
|
/// 登录尝试次数限制
|
|
/// </summary>
|
|
public int MaxLoginAttempts { get; set; } = 5;
|
|
|
|
/// <summary>
|
|
/// 登录尝试时间窗口(分钟)
|
|
/// </summary>
|
|
public int LoginAttemptsWindowMinutes { get; set; } = 15;
|
|
|
|
/// <summary>
|
|
/// 登录尝试缓存键格式
|
|
/// </summary>
|
|
public string LoginAttemptsCacheKeyFormat { get; set; } = "LoginAttempts_{0}";
|
|
|
|
/// <summary>
|
|
/// 默认用户角色
|
|
/// </summary>
|
|
public string DefaultUserRole { get; set; } = "User";
|
|
|
|
/// <summary>
|
|
/// 访问令牌过期时间(分钟)
|
|
/// </summary>
|
|
public int AccessTokenExpirationMinutes { get; set; } = 60;
|
|
|
|
/// <summary>
|
|
/// 刷新令牌过期时间(天)
|
|
/// </summary>
|
|
public int RefreshTokenExpirationDays { get; set; } = 7;
|
|
}
|
|
|