using System; using xModels.Base; using System.ComponentModel.DataAnnotations; namespace xIdentityModels.Models { /// /// an Specified Api Key ... /// public class XApiKey : XBaseGuidIDEntity { /// /// Related Application Id ... /// [Required] public int ApplicationId { get; set; } /// /// Hash ... /// SHA256 of ApiKey ... /// [Required] [StringLength(512)] public string KeyHash { get; set; } /// /// a Prefix ... /// [StringLength(100)] public string KeyPrefix { get; set; } /// /// Expiration Type ... /// [Required] public DateTime ExpiresAt { get; set; } /// /// Cration Time ... /// public DateTime CreatedOn { get; set; } /// /// Last Usage Date ... /// public DateTime? LastUsedAt { get; set; } /// /// Revoked Time ... /// public DateTime? RevokedAt { get; set; } /// /// Revoker User Id ... /// public string RevokedBy { get; set; } /// /// a Json Array String ... /// XApiKeyScope ... /// [StringLength(1000)] public string AllowedScopes { get; set; } /// /// a Comma-separated List which Specified White List IP ... /// [StringLength(2000)] public string AllowedIPs { get; set; } /// /// Rate Limit Per Minute ... /// public int RateLimitPerMinute { get; set; } = 60; // #region Navigation ... /// /// Related Application ... /// public virtual XApplication Application { get; set; } #endregion } }