using System.ComponentModel.DataAnnotations;

namespace Tiku.Api.Options;

public sealed class CorsOptions
{
    public const string SectionName = "Cors";
    public const string PolicyName = "TikuCors";

    [Required] public string[] AllowedOrigins { get; set; } = [];

    [Required]
    [MinLength(1)]
    public string[] AllowedHeaders { get; set; } = ["Authorization", "Content-Type", "x-tenant-code"];

    [Required]
    [MinLength(1)]
    public string[] AllowedMethods { get; set; } = ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];

    public bool AllowCredentials { get; set; }
}