refactor(securestore): remove password-based authentication in favor of key-file only

Simplify SecureStore by removing MasterKeyEnvVar and password-based methods, leaving only key-file authentication for better security practices.
This commit is contained in:
Joseph Doherty
2026-01-23 00:17:19 -05:00
parent 9c4a184233
commit 1b7bb26def
22 changed files with 101 additions and 1421 deletions
@@ -97,27 +97,12 @@ public class MainWindowViewModelTests
_mockStoreManager.GetKeys().Returns(new List<string>().AsReadOnly());
// Act
await _sut.CreateNewStoreAsync(storePath, keyPath, null);
await _sut.CreateNewStoreAsync(storePath, keyPath);
// Assert
_mockStoreManager.Received(1).CreateStore(storePath, keyPath);
}
[Fact]
public async Task CreateNewStoreAsync_WithPassword_CallsStoreManagerCreateStoreWithPassword()
{
// Arrange
var storePath = "/path/to/store.json";
var password = "password123";
_mockStoreManager.GetKeys().Returns(new List<string>().AsReadOnly());
// Act
await _sut.CreateNewStoreAsync(storePath, null, password);
// Assert
_mockStoreManager.Received(1).CreateStoreWithPassword(storePath, password);
}
[Fact]
public async Task OpenExistingStoreAsync_WithKeyFile_CallsStoreManagerOpenStore()
{
@@ -127,27 +112,12 @@ public class MainWindowViewModelTests
_mockStoreManager.GetKeys().Returns(new List<string>().AsReadOnly());
// Act
await _sut.OpenExistingStoreAsync(storePath, keyPath, null);
await _sut.OpenExistingStoreAsync(storePath, keyPath);
// Assert
_mockStoreManager.Received(1).OpenStore(storePath, keyPath);
}
[Fact]
public async Task OpenExistingStoreAsync_WithPassword_CallsStoreManagerOpenStoreWithPassword()
{
// Arrange
var storePath = "/path/to/store.json";
var password = "password123";
_mockStoreManager.GetKeys().Returns(new List<string>().AsReadOnly());
// Act
await _sut.OpenExistingStoreAsync(storePath, null, password);
// Assert
_mockStoreManager.Received(1).OpenStoreWithPassword(storePath, password);
}
[Fact]
public async Task SaveSecretAsync_CallsStoreManagerSetSecret()
{