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`
|
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
|
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
|
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 vault select <name>`; `secret vault list` still lists the vaults.
|
||||||
`secret info` still runs; both show no vault as current.
|
|
||||||
|
|
||||||
#### `secret vault remove <name> [--force]` / `secret vault rm` ⚠️ 🛑
|
#### `secret vault remove <name> [--force]` / `secret vault rm` ⚠️ 🛑
|
||||||
|
|
||||||
|
|||||||
@@ -17,16 +17,15 @@ import (
|
|||||||
|
|
||||||
// TestListFailsWhenCurrentVaultDoesNotExist is a regression test for
|
// TestListFailsWhenCurrentVaultDoesNotExist is a regression test for
|
||||||
// https://git.eeqj.de/sneak/secret/issues/156, where a currentvault file
|
// 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
|
// that was empty, or named a vault that does not exist, made `secret list`
|
||||||
// not exist, made `secret list` report an empty vault. Listing must fail
|
// report an empty vault. Listing must fail with an error that names the
|
||||||
// with an error that names the file and says to run `secret vault select`,
|
// file and says to run `secret vault select`, `secret vault list` must
|
||||||
// `secret vault list` must still list the vaults, and selecting a vault
|
// still list the vaults, and selecting a vault must make listing work
|
||||||
// must make listing work again. The name "." would make vaults.d itself the
|
// again.
|
||||||
// vault, and "../vaults.d/work" would reach the vault work by a path.
|
|
||||||
func TestListFailsWhenCurrentVaultDoesNotExist(t *testing.T) {
|
func TestListFailsWhenCurrentVaultDoesNotExist(t *testing.T) {
|
||||||
t.Parallel()
|
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.Run(strconv.Quote(name), func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user