feat(DIExtensions): Umbenennung der AddCryptograph-Methoden in AddCryptoFactory

This commit is contained in:
Developer 02 2025-01-09 20:38:15 +01:00
parent 7f9459f6cf
commit 1875bf46fa

View File

@ -13,7 +13,7 @@ namespace DigitalData.Core.Security
private static IServiceCollection AddParamsConfigureOptions<TParams>(this IServiceCollection services) where TParams : RSAFactoryParams private static IServiceCollection AddParamsConfigureOptions<TParams>(this IServiceCollection services) where TParams : RSAFactoryParams
=> services.AddSingleton<IConfigureOptions<TParams>, ParamsConfigureOptions<TParams>>(); => services.AddSingleton<IConfigureOptions<TParams>, ParamsConfigureOptions<TParams>>();
private static IServiceCollection AddCryptograph(this IServiceCollection services) => services private static IServiceCollection AddCryptoFactory(this IServiceCollection services) => services
.AddParamsConfigureOptions<CryptographParams>() .AddParamsConfigureOptions<CryptographParams>()
.AddAutoMapper(typeof(MappingProfile).Assembly) .AddAutoMapper(typeof(MappingProfile).Assembly)
.AddSingleton<ICryptoFactory, CryptoFactory>(); .AddSingleton<ICryptoFactory, CryptoFactory>();
@ -24,18 +24,18 @@ namespace DigitalData.Core.Security
/// <param name="services"></param> /// <param name="services"></param>
/// <param name="section"></param> /// <param name="section"></param>
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns> /// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
public static IServiceCollection AddCryptograph(this IServiceCollection services, IConfigurationSection section) => services public static IServiceCollection AddCryptoFactory(this IServiceCollection services, IConfigurationSection section) => services
.Configure<CryptographParams>(section) .Configure<CryptographParams>(section)
.AddCryptograph(); .AddCryptoFactory();
/// <summary> /// <summary>
/// Registers an asym crypt service with the specified parameters from the given instance. /// Registers an asym crypt service with the specified parameters from the given instance.
/// </summary> /// </summary>
/// <param name="services"></param> /// <param name="services"></param>
/// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns> /// <returns>The updated <see cref="IServiceCollection"/> with the RSA Factory registered.</returns>
public static IServiceCollection AddCryptograph(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services public static IServiceCollection AddCryptoFactory(this IServiceCollection services, CryptographParams? asymCryptParams = null) => services
.AddSingleton(Options.Create(asymCryptParams ?? new())) .AddSingleton(Options.Create(asymCryptParams ?? new()))
.AddCryptograph(); .AddCryptoFactory();
/// <summary> /// <summary>
/// Registers a custom RSA Factory with specified parameters from the given configuration section. /// Registers a custom RSA Factory with specified parameters from the given configuration section.