34 lines
862 B
C#

using System;
using System.ComponentModel.DataAnnotations;
namespace ManagerService.Data
{
public class ApiKey
{
[Key]
public string Id { get; set; }
/// <summary>Plain text key — only for PIN-bootstrapped keys (re-retrievable)</summary>
public string? Key { get; set; }
/// <summary>SHA-256 hash — for manually created keys (returned plain text only once)</summary>
public string? KeyHash { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string InstanceId { get; set; }
public Instance Instance { get; set; }
public ApiKeyAppType AppType { get; set; }
public bool IsActive { get; set; } = true;
public DateTime DateCreation { get; set; }
public DateTime? DateExpiration { get; set; }
}
}