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:
+2
-32
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user