feat(backend): add JWT authentication, RBAC and consent/audit services
Add signup/signin with backend-issued JWT (Argon2 passwords in SurrealDB), role-based authorization policies, per-user data access levels, consent register and read audit log. Protect user endpoints and record sensitive reads.
This commit is contained in:
@@ -2,6 +2,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SurrealDb.Net;
|
||||
using TarninaHub.Application.Abstractions;
|
||||
using TarninaHub.Infrastructure.Auth;
|
||||
using TarninaHub.Infrastructure.Persistence;
|
||||
using TarninaHub.Infrastructure.Settings;
|
||||
|
||||
@@ -14,6 +15,7 @@ public static class DependencyInjection
|
||||
IConfiguration configuration)
|
||||
{
|
||||
services.Configure<SurrealDbSettings>(configuration.GetSection("SurrealDb"));
|
||||
services.Configure<AuthSettings>(configuration.GetSection("Auth"));
|
||||
|
||||
var settings = configuration.GetSection("SurrealDb").Get<SurrealDbSettings>()
|
||||
?? new SurrealDbSettings();
|
||||
@@ -46,6 +48,10 @@ public static class DependencyInjection
|
||||
|
||||
services.AddSingleton<IStorageService, StorageService>();
|
||||
services.AddSingleton<IMigrationRunner, MigrationRunner>();
|
||||
services.AddSingleton<ITokenService, TokenService>();
|
||||
services.AddSingleton<IUserService, UserService>();
|
||||
services.AddSingleton<IConsentService, ConsentService>();
|
||||
services.AddSingleton<IAuditLogService, AuditLogService>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user