forked from gongxuegit/tiku-backend.net
feat: add rate limiting and startup options validation
This commit is contained in:
@@ -5,8 +5,16 @@ public sealed class CorsOptions
|
||||
public const string SectionName = "Cors";
|
||||
public const string PolicyName = "TikuCors";
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
public string[] AllowedOrigins { get; set; } = [];
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
[System.ComponentModel.DataAnnotations.MinLength(1)]
|
||||
public string[] AllowedHeaders { get; set; } = ["Authorization", "Content-Type", "x-tenant-code"];
|
||||
|
||||
[System.ComponentModel.DataAnnotations.Required]
|
||||
[System.ComponentModel.DataAnnotations.MinLength(1)]
|
||||
public string[] AllowedMethods { get; set; } = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
|
||||
|
||||
public bool AllowCredentials { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user