mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
Data protection for user columns at rest (#2571)
* ServerProtectedData for user entity * remove using statements * formatting * use data protection libs * no async * add data protection to ef user repo * switch to `SetApplicationName` per ASPNET docs * null checks * cleanup * value converter for EF * new line at eof * fix using * remove folder ref * restore ctor * fix lint * use global constant * UseApplicationServiceProvider for integration tests * implement constant for DatabaseFieldProtectedPrefix * Fix EF IntegrationTest * restore original values after protect and save * lint fixes * Use Constants Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
This commit is contained in:
@ -408,7 +408,7 @@ public static class ServiceCollectionExtensions
|
||||
public static void AddCustomDataProtectionServices(
|
||||
this IServiceCollection services, IWebHostEnvironment env, GlobalSettings globalSettings)
|
||||
{
|
||||
var builder = services.AddDataProtection(options => options.ApplicationDiscriminator = "Bitwarden");
|
||||
var builder = services.AddDataProtection().SetApplicationName("Bitwarden");
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
return;
|
||||
@ -433,7 +433,6 @@ public static class ServiceCollectionExtensions
|
||||
"dataprotection.pfx", globalSettings.DataProtection.CertificatePassword)
|
||||
.GetAwaiter().GetResult();
|
||||
}
|
||||
//TODO djsmith85 Check if this is the correct container name
|
||||
builder
|
||||
.PersistKeysToAzureBlobStorage(globalSettings.Storage.ConnectionString, "aspnet-dataprotection", "keys.xml")
|
||||
.ProtectKeysWithCertificate(dataProtectionCert);
|
||||
|
Reference in New Issue
Block a user