feat: implement secure config and machine id key generator

This commit is contained in:
Stevan Freeborn
2026-03-30 08:03:27 -05:00
parent 43d64a1855
commit e05e959378
8 changed files with 321 additions and 5 deletions
@@ -0,0 +1,33 @@
using Microsoft.Extensions.Logging;
using Moq;
using StevanFreeborn.Extensions.Configuration.Secure.Cryptography;
namespace StevanFreeborn.Extensions.Configuration.Secure.Tests.Unit.Cryptography;
public class MachineIdKeyGeneratorTests
{
private readonly Mock<ILogger<MachineIdKeyGenerator>> _mockLogger = new();
private readonly MachineIdKeyGenerator _sut;
public MachineIdKeyGeneratorTests()
{
_sut = new(_mockLogger.Object);
}
[Fact]
public void GetId_WhenCalled_ItShouldReturnNonEmptyString()
{
_sut.GetId().Should().NotBeEmpty();
}
[Fact]
public void GetId_WhenCalledMultipleTimes_ItShouldReturnConsistentId()
{
var resultOne = _sut.GetId();
var resultTwo = _sut.GetId();
resultTwo.Should().Be(resultOne);
}
}
@@ -0,0 +1,6 @@
namespace StevanFreeborn.Extensions.Configuration.Secure.Tests.Unit.Cryptography;
public class MachineIdKeyProviderTests
{
}