feat: implement Turnstile verification for enhanced security during login and registration

refactor: remove unnecessary interfaces for services; change user key from UID to UUID
This commit is contained in:
2025-12-31 12:11:09 -05:00
parent 08c4be4f7e
commit 848b8598e5
27 changed files with 579 additions and 84 deletions
+8 -3
View File
@@ -4,6 +4,8 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using SharpbinV3.Server.Data;
using SharpbinV3.Server.Services;
using SharpbinV3.Server.Services.Verification;
using SharpbinV3.Server.Services.Verification.Providers;
using SharpbinV3.Server.Settings;
using System.Text;
using System.Threading.RateLimiting;
@@ -27,9 +29,11 @@ namespace SharpbinV3.Server
});
builder.Services.AddSingleton<ICompressionService, CompressionService>();
builder.Services.AddSingleton<IHostedService, PasteCleanUpService>();
builder.Services.AddScoped<IUserService, UserService>();
builder.Services.AddScoped<IAuthService, AuthService>();
builder.Services.AddScoped<IPasteService, PasteService>();
builder.Services.AddScoped<UserService>();
builder.Services.AddScoped<AuthService>();
builder.Services.AddScoped<PasteService>();
builder.Services.AddScoped<VerificationService>();
builder.Services.AddHttpClient<IVerificationProvider, TurnstileVerificationProvider>();
builder.Services.AddHealthChecks()
.AddDbContextCheck<AppDbContext>("Database");
@@ -85,6 +89,7 @@ namespace SharpbinV3.Server
});
builder.Services.Configure<PasteSettings>(builder.Configuration.GetSection("PasteSettings"));
builder.Services.Configure<JWTSettings>(builder.Configuration.GetSection("JWTSettings"));
builder.Services.Configure<AuthSettings>(builder.Configuration.GetSection("AuthSettings"));
var app = builder.Build();
app.UseRateLimiter();