Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f66f6d8ed |
@@ -117,8 +117,7 @@ are allowed, and a name must not be empty, `.` or `..`.
|
||||
Switches to the specified vault for subsequent operations. When `currentvault`
|
||||
is empty or names a vault that does not exist, every command that uses the
|
||||
current vault fails with an error that names the file and says to run
|
||||
`secret vault select <name>`. `secret vault list` still lists the vaults, and
|
||||
`secret info` still runs; both show no vault as current.
|
||||
`secret vault select <name>`; `secret vault list` still lists the vaults.
|
||||
|
||||
#### `secret vault remove <name> [--force]` / `secret vault rm` ⚠️ 🛑
|
||||
|
||||
|
||||
@@ -17,16 +17,15 @@ import (
|
||||
|
||||
// TestListFailsWhenCurrentVaultDoesNotExist is a regression test for
|
||||
// https://git.eeqj.de/sneak/secret/issues/156, where a currentvault file
|
||||
// that was empty, held an invalid vault name, or named a vault that does
|
||||
// not exist, made `secret list` report an empty vault. Listing must fail
|
||||
// with an error that names the file and says to run `secret vault select`,
|
||||
// `secret vault list` must still list the vaults, and selecting a vault
|
||||
// must make listing work again. The name "." would make vaults.d itself the
|
||||
// vault, and "../vaults.d/work" would reach the vault work by a path.
|
||||
// that was empty, or named a vault that does not exist, made `secret list`
|
||||
// report an empty vault. Listing must fail with an error that names the
|
||||
// file and says to run `secret vault select`, `secret vault list` must
|
||||
// still list the vaults, and selecting a vault must make listing work
|
||||
// again.
|
||||
func TestListFailsWhenCurrentVaultDoesNotExist(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, name := range []string{"", ".", "../vaults.d/work", "gone"} {
|
||||
for _, name := range []string{"", "gone"} {
|
||||
t.Run(strconv.Quote(name), func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user