Ask for the new passphrase in unlocker add when the variable is set (closes #154)
check / check (push) Waiting to run
check / check (push) Waiting to run
With SB_UNLOCK_PASSPHRASE set, `secret unlocker add passphrase` gave the new unlocker the passphrase in the variable without asking. It now asks on the terminal for the new passphrase and uses the variable only to unlock the vault. With no controlling terminal the new unlocker takes the variable's passphrase, as before, and the output says so. secret.ErrNoTerminal is exported so that the command can tell a missing terminal from other failures to read, such as nothing typed or a mismatched confirmation, which still fail the command. The in-process tests that add a passphrase unlocker with the variable set rely on the Docker test phase having no controlling terminal; at a terminal they would ask. Model: opus-5-5
This commit is contained in:
@@ -233,6 +233,12 @@ Creates a new unlocker of the specified type:
|
||||
A vault has one passphrase unlocker: adding one replaces the one the vault has,
|
||||
which is removed only once the new one is the current unlocker.
|
||||
|
||||
`secret unlocker add passphrase` asks on the terminal for the new passphrase
|
||||
even when `SB_UNLOCK_PASSPHRASE` is set, since the variable only unlocks the
|
||||
vault. With no controlling terminal, as under cron or in a CI job, the new
|
||||
unlocker takes its passphrase from `SB_UNLOCK_PASSPHRASE`, and the command says
|
||||
so.
|
||||
|
||||
#### `secret unlocker remove <unlocker-id> [--force]` / `secret unlocker rm` ⚠️ 🛑
|
||||
|
||||
**DANGER**: Permanently removes an unlocker. It first asks for confirmation,
|
||||
|
||||
Reference in New Issue
Block a user