From 1bc2e0578356a3482c827d85eb44bf86c2895a4b Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sun, 10 Jul 2022 22:22:41 +0200 Subject: feat: Encrypt data protection data with a cert --- server/src/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'server/src/Program.cs') diff --git a/server/src/Program.cs b/server/src/Program.cs index 0d6b3d3..b74f348 100644 --- a/server/src/Program.cs +++ b/server/src/Program.cs @@ -39,6 +39,7 @@ global using IOL.GreatOffice.Api.Services; global using IOL.GreatOffice.Api.Utilities; using System.Reflection; using System.Security.Cryptography.X509Certificates; +using System.Text; using IOL.GreatOffice.Api.Endpoints.V1; using IOL.GreatOffice.Api.Jobs; using Microsoft.AspNetCore.HttpOverrides; @@ -89,11 +90,12 @@ public static class Program options.ForwardedHeaders = ForwardedHeaders.XForwardedProto; }); } - + builder.Services - .AddDataProtection() - .PersistKeysToDbContext() - .ProtectKeysWithCertificate(vaultService.Get("")); + .AddDataProtection() + .ProtectKeysWithCertificate(configuration.CERT1()) + .PersistKeysToDbContext(); + builder.Services.Configure(JsonSettings.Default); builder.Services.AddQuartz(options => { options.UsePersistentStore(o => { -- cgit v1.3