feat: stub out secure config with dependencies

This commit is contained in:
Stevan Freeborn
2026-03-29 22:02:07 -05:00
parent a843976319
commit 43d64a1855
2 changed files with 45 additions and 0 deletions
@@ -0,0 +1,38 @@
using StevanFreeborn.Extensions.Configuration.Secure.Cryptography;
using StevanFreeborn.Extensions.Configuration.Secure.Storage;
namespace StevanFreeborn.Extensions.Configuration.Secure.Configuration;
internal interface ISecureConfig
{
Task DeleteAsync<t>(string key, CancellationToken ct = default);
Task<T?> GetAsync<T>(string key, CancellationToken ct = default);
Task SetAsync<T>(string key, T value, CancellationToken ct = default);
}
internal sealed class SecureConfig(
ISecureStorageProvider storageProvider,
ICryptoProvider cryptoProvider
) : ISecureConfig
{
private readonly ISecureStorageProvider _storageProvider = storageProvider ??
throw new ArgumentNullException(nameof(storageProvider));
private readonly ICryptoProvider _cryptoProvider = cryptoProvider ??
throw new ArgumentNullException(nameof(cryptoProvider));
public async Task SetAsync<T>(string key, T value, CancellationToken ct = default)
{
throw new NotImplementedException();
}
public async Task<T?> GetAsync<T>(string key, CancellationToken ct = default)
{
throw new NotImplementedException();
}
public async Task DeleteAsync<t>(string key, CancellationToken ct = default)
{
throw new NotImplementedException();
}
}
@@ -0,0 +1,7 @@
namespace StevanFreeborn.Extensions.Configuration.Secure.Cryptography;
internal interface ICryptoProvider
{
string Encrypt(string plainText);
string Decrypt(string cipherText);
}