From 97c4f7bf8f3e4f06e1a0c53861d3200d34cf9e72 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 9 Jan 2025 22:33:56 +0100 Subject: [PATCH] refactor(CryptographParams): umbenannt in CryptoFactoryParams --- .../{CryptographParams.cs => CryptoFactoryParams.cs} | 4 ++-- DigitalData.Core.Security/CryptoFactory.cs | 4 ++-- DigitalData.Core.Security/DIExtensions.cs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) rename DigitalData.Core.Security/Config/{CryptographParams.cs => CryptoFactoryParams.cs} (97%) diff --git a/DigitalData.Core.Security/Config/CryptographParams.cs b/DigitalData.Core.Security/Config/CryptoFactoryParams.cs similarity index 97% rename from DigitalData.Core.Security/Config/CryptographParams.cs rename to DigitalData.Core.Security/Config/CryptoFactoryParams.cs index 9a969b7..2bafa28 100644 --- a/DigitalData.Core.Security/Config/CryptographParams.cs +++ b/DigitalData.Core.Security/Config/CryptoFactoryParams.cs @@ -2,7 +2,7 @@ namespace DigitalData.Core.Security.Config { - public class CryptographParams : RSAFactoryParams + public class CryptoFactoryParams : RSAFactoryParams { public string PemDirectory { get; init; } = string.Empty; @@ -45,7 +45,7 @@ namespace DigitalData.Core.Security.Config public RSADecryptor? VaultDecryptor { get; init; } - public CryptographParams() + public CryptoFactoryParams() { // init decryptors AfterCreate += () => diff --git a/DigitalData.Core.Security/CryptoFactory.cs b/DigitalData.Core.Security/CryptoFactory.cs index 661f6f2..588fddd 100644 --- a/DigitalData.Core.Security/CryptoFactory.cs +++ b/DigitalData.Core.Security/CryptoFactory.cs @@ -6,7 +6,7 @@ using Microsoft.Extensions.Options; namespace DigitalData.Core.Security { - public class CryptoFactory : RSAFactory, ICryptoFactory, IAsymmetricKeyFactory + public class CryptoFactory : RSAFactory, ICryptoFactory, IAsymmetricKeyFactory { public IEnumerable Decryptors { get; } @@ -17,7 +17,7 @@ namespace DigitalData.Core.Security public IEnumerable TokenDescriptors { get; init; } = new List(); - public CryptoFactory(IOptions options, ILogger? logger = null) : base(options) + public CryptoFactory(IOptions options, ILogger? logger = null) : base(options) { logger?.LogInformation("Core.Secrets version: {Version}, Created on: {CreationDate}.", Secrets.Version, Secrets.CreationDate.ToString("dd.MM.yyyy")); diff --git a/DigitalData.Core.Security/DIExtensions.cs b/DigitalData.Core.Security/DIExtensions.cs index 5a369a9..883f957 100644 --- a/DigitalData.Core.Security/DIExtensions.cs +++ b/DigitalData.Core.Security/DIExtensions.cs @@ -14,7 +14,7 @@ namespace DigitalData.Core.Security => services.AddSingleton, ParamsConfigureOptions>(); private static IServiceCollection AddCryptoFactory(this IServiceCollection services) => services - .AddParamsConfigureOptions() + .AddParamsConfigureOptions() .AddAutoMapper(typeof(MappingProfile).Assembly) .AddSingleton(); @@ -25,7 +25,7 @@ namespace DigitalData.Core.Security /// /// The updated with the RSA Factory registered. public static IServiceCollection AddCryptoFactory(this IServiceCollection services, IConfigurationSection section) => services - .Configure(section) + .Configure(section) .AddCryptoFactory(); /// @@ -33,8 +33,8 @@ namespace DigitalData.Core.Security /// /// /// The updated with the RSA Factory registered. - public static IServiceCollection AddCryptoFactory(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services - .AddSingleton(Options.Create(asymCryptParams ?? new())) + public static IServiceCollection AddCryptoFactory(this IServiceCollection services, CryptoFactoryParams? factoryParams = null) => services + .AddSingleton(Options.Create(factoryParams ?? new())) .AddCryptoFactory(); ///