mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
Miscellaneous Packages from Shared Into Proper Folders (#9638)
* slashutil * builds * interop * viz Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
22
cmd/password_reader.go
Normal file
22
cmd/password_reader.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
)
|
||||
|
||||
// PasswordReader reads a password from a mock or stdin.
|
||||
type PasswordReader interface {
|
||||
ReadPassword() (string, error)
|
||||
}
|
||||
|
||||
// StdInPasswordReader reads a password from stdin.
|
||||
type StdInPasswordReader struct {
|
||||
}
|
||||
|
||||
// ReadPassword reads a password from stdin.
|
||||
func (pr StdInPasswordReader) ReadPassword() (string, error) {
|
||||
pwd, err := terminal.ReadPassword(int(os.Stdin.Fd()))
|
||||
return string(pwd), err
|
||||
}
|
||||
Reference in New Issue
Block a user