Refactor EmailAccountDto and improve encryption logic
Refactored `EmailAccountDto` to focus on SMTP-related properties, removing unused fields. Updated `DependencyInjection` to configure data protection with a new key storage path. Simplified `DataProtectionEncryptionService` by removing redundant checks and error handling for encryption and decryption methods.
This commit is contained in:
@@ -2,6 +2,7 @@ using DigitalData.EmailProfiler.Application.Common.Interfaces;
|
||||
using DigitalData.EmailProfiler.Infrastructure.Messaging;
|
||||
using DigitalData.EmailProfiler.Infrastructure.Queue;
|
||||
using DigitalData.EmailProfiler.Infrastructure.Services;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -43,9 +44,9 @@ public static class DependencyInjection
|
||||
services.AddHostedService<RabbitMqCommandConsumer>();
|
||||
|
||||
// --- Data Protection (for encryption) ---
|
||||
services.AddDataProtection();
|
||||
// .PersistKeysToFileSystem(new DirectoryInfo(@"C:\ProgramData\EmailProfiler\Keys"))
|
||||
// .SetApplicationName("EmailProfiler");
|
||||
services.AddDataProtection()
|
||||
.PersistKeysToFileSystem(new DirectoryInfo(@"C:\ProgramData\EmailService\Keys"))
|
||||
.SetApplicationName("EmailProfiler");
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user