This commit is contained in:
2026-10-04 22:02:30 +03:30
parent de36e7bfd1
commit 80978abefc
3 changed files with 166 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
using System;
using xModels.Base;
namespace xIdentityModels.Dtos
{
/// <summary>
/// an Specified Api Key ...
/// </summary>
public class XApiKeyDto : XBaseGuidIDEntityDto
{
/// <summary>
/// Related Application Id ...
/// </summary>
public int ApplicationId { get; set; }
/// <summary>
/// Hash ...
/// SHA256 of ApiKey ...
/// </summary>
public string KeyHash { get; set; }
/// <summary>
/// a Prefix ...
/// </summary>
public string KeyPrefix { get; set; }
/// <summary>
/// Expiration Type ...
/// </summary>
public DateTime ExpiresAt { get; set; }
/// <summary>
/// Cration Time ...
/// </summary>
public DateTime CreatedOn { get; set; }
/// <summary>
/// Last Usage Date ...
/// </summary>
public DateTime? LastUsedAt { get; set; }
/// <summary>
/// Revoked Time ...
/// </summary>
public DateTime? RevokedAt { get; set; }
/// <summary>
/// Revoker User Id ...
/// </summary>
public string RevokedBy { get; set; }
/// <summary>
/// a Json Array String ...
/// XApiKeyScope ...
/// </summary>
public string AllowedScopes { get; set; }
/// <summary>
/// a Comma-separated List which Specified White List IP ...
/// </summary>
public string AllowedIPs { get; set; }
/// <summary>
/// Rate Limit Per Minute ...
/// </summary>
public int RateLimitPerMinute { get; set; } = 60;
//
/// <summary>
/// Related Application ...
/// </summary>
public virtual XApplicationDto Application { get; set; }
}
}
+43
View File
@@ -0,0 +1,43 @@
using System;
using xModels.Base;
namespace xIdentityModels.Dtos
{
public class XApiKeyUsageDto : XBaseLongIDEntityDto
{
/// <summary>
/// Api Key Id ...
/// </summary>
public Guid ApiKeyId { get; set; }
/// <summary>
/// Called Endpoint ...
/// </summary>
public string Endpoint { get; set; }
/// <summary>
/// Called Http Method ...
/// </summary>
public string HttpMethod { get; set; }
/// <summary>
/// Client IP Address ...
/// </summary>
public string ClientIP { get; set; }
/// <summary>
/// Status Code ...
/// </summary>
public int StatusCode { get; set; }
/// <summary>
/// Request Time ...
/// </summary>
public DateTime RequestedOn { get; set; }
/// <summary>
/// Response Time in Milliseconds ...
/// </summary>
public long ResponseTimeMs { get; set; }
}
}
+49
View File
@@ -0,0 +1,49 @@
using System;
using xModels.Base;
using xModels.Dtos;
using xIdentityModels.Constants;
namespace xIdentityModels.Dtos
{
/// <summary>
/// an Application in xDashboard ...
/// </summary>
public class XApplicationDto : XBaseIntIDEntityDto
{
/// <summary>
/// Name ...
/// </summary>
public string Name { get; set; }
/// <summary>
/// Descriptor ...
/// </summary>
public string Description { get; set; }
/// <summary>
/// Owner Id ...
/// </summary>
public string OwnerId { get; set; }
public virtual XPersonDto Owner { get; set; }
/// <summary>
/// Application Type ...
/// </summary>
public XApplicationType Type { get; set; }
/// <summary>
/// Specified Application is Active or not ...
/// </summary>
public bool IsActive { get; set; } = true;
/// <summary>
/// Application Create Time ...
/// </summary>
public DateTime CreatedOn { get; set; }
/// <summary>
/// Application Update Type ...
/// </summary>
public DateTime UpdatedAt { get; set; }
}
}