begin: PHI Column Encryption
This commit is contained in:
@@ -14,6 +14,7 @@ using Microsoft.IdentityModel.Tokens;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using System.Text;
|
||||
using Microsoft.OpenApi;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.WriteTo.Console()
|
||||
@@ -72,8 +73,10 @@ try
|
||||
.Enrich.WithThreadId());
|
||||
}
|
||||
|
||||
builder.Services.AddDbContext<AppDbContext>(opts =>
|
||||
opts.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));
|
||||
builder.Services.AddDbContext<AppDbContext>((sp, opts) =>
|
||||
{
|
||||
opts.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"));
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton<IConnectionMultiplexer>(sp =>
|
||||
ConnectionMultiplexer.Connect(sp.GetRequiredService<IConfiguration>()["Redis:ConnectionString"]!));
|
||||
@@ -129,6 +132,14 @@ try
|
||||
builder.Services.Configure<PatientOptions>(
|
||||
builder.Configuration.GetSection(PatientOptions.Section));
|
||||
|
||||
builder.Services.AddDataProtection()
|
||||
.PersistKeysToFileSystem(new DirectoryInfo(
|
||||
builder.Configuration["DataProtection:KeyPath"] ?? "./data-protection-keys"))
|
||||
.SetApplicationName("VigilCareClinical");
|
||||
|
||||
builder.Services.Configure<PhiEncryptionOptions>(
|
||||
builder.Configuration.GetSection(PhiEncryptionOptions.Section));
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
options.AddPolicy("Dashboard", policy =>
|
||||
@@ -180,6 +191,8 @@ try
|
||||
builder.Services.AddScoped<ICurrentUserService, CurrentUserService>();
|
||||
builder.Services.AddScoped<IAuthService, AuthService>();
|
||||
builder.Services.AddScoped<IAuditService, AuditService>();
|
||||
builder.Services.AddSingleton<IPhiEncryptionService, PhiEncryptionService>();
|
||||
builder.Services.AddScoped<IPhiAccessLogService, PhiAccessLogService>();
|
||||
|
||||
builder.Services.AddHostedService<ThresholdCacheLoader>();
|
||||
builder.Services.AddHostedService<KafkaTopicProvisioner>();
|
||||
|
||||
Reference in New Issue
Block a user