mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: auth, compression, jwt, paste wip, roles, ratelimiting
This commit is contained in:
@@ -7,5 +7,6 @@ namespace SharpbinV3.Data
|
||||
{
|
||||
public DbSet<User> Users => Set<User>();
|
||||
public DbSet<Paste> Pastes => Set<Paste>();
|
||||
public DbSet<RefreshToken> RefreshTokens => Set<RefreshToken>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SharpbinV3.Data.Entities
|
||||
{
|
||||
public sealed class RefreshToken
|
||||
{
|
||||
[Key]
|
||||
public Guid UserUUID { get; set; }
|
||||
public required string Token { get; set; }
|
||||
public required string JwtId { get; set; }
|
||||
public required long CreatedAt { get; set; }
|
||||
public required long ExpiresAt { get; set; }
|
||||
public bool Used { get; set; } = false;
|
||||
public User? User { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.ValueGeneration.Internal;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace SharpbinV3.Data.Entities
|
||||
@@ -16,7 +15,7 @@ namespace SharpbinV3.Data.Entities
|
||||
public string? Email { get; set; }
|
||||
public string? DisplayName { get; set; }
|
||||
public long? LastLogin { get; set; }
|
||||
public int Type { get; set; } = 0; // 0 = regular user, 1 = moderator, 255 = admin
|
||||
public int[] Roles { get; set; } = [0]; // 0 = regular user, 1 = moderator, 255 = admin
|
||||
public int Visiblity { get; set; } = 0; // 0 = public, 1 = unlisted, 2 = private
|
||||
public List<Paste> Pastes { get; set; } = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user