teleport/tool
Alan Parra 70a0ad132e
Consistently prompt for OTPs as password (#11346)
Introduce the prompt.Password function and use it consistently whenever we read
a password, OTP or PIN.

The PR makes it easy to support PINs during MFA authentication, so now we do so.
It also adds the capability to mock prompt.Stdin() for tests, adding a uniform
way to fake user input in tests without having to swap functions.

Complements #10953 and #9160.

* Prompt for OTPs as passwords (take 1), read PINs on MFA authentication
* Add the prompt.Password method
* Add Stdin mocking capabilities to the prompt package
* Delegate password reads to prompt.Stdin().ReadPassword()
* Remove stdinHijack from PromptMFAChallenge
* Change api_login_test.go to FakeReader
* Change tsh_test.go to FakeReader
* Retire client.ReadPassword in favor of prompt.Password
2022-03-28 17:16:00 +00:00
..
tbot Improve cli usage when command name is long (#10981) 2022-03-23 19:08:42 +00:00
tctl Improve cli usage when command name is long (#10981) 2022-03-23 19:08:42 +00:00
teleport Improve cli usage when command name is long (#10981) 2022-03-23 19:08:42 +00:00
tsh Consistently prompt for OTPs as password (#11346) 2022-03-28 17:16:00 +00:00