Implemented API key management with permission checks, database schema, and frontend integration. Adjusted string lengths for Role and API key attributes.
This commit is contained in:
24
Moonlight.Api/Database/Entities/ApiKey.cs
Normal file
24
Moonlight.Api/Database/Entities/ApiKey.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Moonlight.Api.Database.Interfaces;
|
||||
|
||||
namespace Moonlight.Api.Database.Entities;
|
||||
|
||||
public class ApiKey : IActionTimestamps
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[MaxLength(30)]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[MaxLength(300)]
|
||||
public required string Description { get; set; }
|
||||
|
||||
public string[] Permissions { get; set; } = [];
|
||||
|
||||
[MaxLength(32)]
|
||||
public string Key { get; set; }
|
||||
|
||||
// Action timestamps
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
public DateTimeOffset UpdatedAt { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user