`secret vault import` took only a vault without a long-term key, and `secret init` and `secret vault create` give every vault one, so it always failed. A mnemonic enters through those two commands, so the command goes, with its tests and its README entry. The help and the note of `secret generate mnemonic` named `secret import`, which imports a file as a secret; they now name `secret init` and `secret vault create`. `secret vault import` now prints the help of `secret vault` and exits 0, as cobra does for any subcommand of `secret vault` it does not know. Judgement call: TestWorkflowMismatch in internal/vault, which replayed the import step by step, is deleted. Model: opus-5-5
This commit was merged in pull request #174.
This commit is contained in:
@@ -371,19 +371,3 @@ func TestRemoveSecretAbortsWhenVersionsUnreadable(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
assert.True(t, exists, "the secret must not be removed")
|
||||
}
|
||||
|
||||
// TestVaultImportAbortsWhenPubKeyUnreadable asserts that a mnemonic import
|
||||
// stops when whether the vault already has a long-term key cannot be
|
||||
// determined.
|
||||
func TestVaultImportAbortsWhenPubKeyUnreadable(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
base := newListTestVault(t, 1)
|
||||
instance, cmd := newTestInstance(&statFailFs{
|
||||
Fs: base, path: filepath.Join(testVaultDir(listTestVaultName), "pub.age"),
|
||||
})
|
||||
|
||||
err := instance.importMnemonic(cmd, listTestVaultName)
|
||||
|
||||
require.ErrorIs(t, err, errStatFailed)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user