helper/password: for reading passwords securely

This commit is contained in:
Mitchell Hashimoto
2015-03-04 00:31:35 -08:00
parent a513240662
commit 205857be65
4 changed files with 115 additions and 0 deletions

View File

@@ -1,7 +1,10 @@
package command
import (
"os"
"strings"
"github.com/hashicorp/vault/helper/password"
)
// UnsealCommand is a Command that unseals the vault.
@@ -16,6 +19,12 @@ func (c *UnsealCommand) Run(args []string) int {
return 1
}
value, err := password.Read(os.Stdin)
if err != nil {
return 1
}
c.Ui.Output(value)
return 0
}