mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat(backend): implement api keys; rename token -> verificationToken in paste creation api
api keys can bypass authentication and captchas/verification
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SharpbinV3.Server.Data.Entities
|
||||
{
|
||||
public sealed class ApiKey
|
||||
{
|
||||
[Key]
|
||||
public Guid UUID { get; set; } = Guid.CreateVersion7();
|
||||
public required Guid UserUUID { get; set; }
|
||||
public User? User { get; set; }
|
||||
public required string KeyHash { get; set; }
|
||||
public required string Name { get; set; }
|
||||
public long CreatedAt { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
||||
public long? LastUsedAt { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user