forked from gongxuegit/tiku-backend.net
feat: add rate limiting and startup options validation
This commit is contained in:
@@ -2,10 +2,21 @@ namespace Tiku.Application.Security;
|
||||
|
||||
public sealed class JwtOptions
|
||||
{
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
public string Issuer { get; set; } = "tiku-backend";
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
public string Audience { get; set; } = "tiku-api";
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
[System.ComponentModel.DataAnnotations.MinLength(32)]
|
||||
public string SigningKey { get; set; } = "development-only-tiku-signing-key-change-before-production";
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Range(1, 1440)]
|
||||
public int AccessTokenMinutes { get; set; } = 30;
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Range(1, 365)]
|
||||
public int RefreshTokenDays { get; set; } = 30;
|
||||
|
||||
public bool ValidateSessions { get; set; } = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user