Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add ReadPassword functionality to ContextReader #11436

Merged
merged 8 commits into from
Mar 25, 2022

Conversation

codingllama
Copy link
Contributor

@codingllama codingllama commented Mar 24, 2022

This changes prompt.ContextReader in the following ways:

  1. Reads only happen as a response to Read methods being called. This allows ContextReader to coexist with other readers as long as no reads are abandoned.
  2. ReadPassword is now available, the underlying implementation being term.ReadPassword.
  3. An abandoned password read may be turned into a clean read. This gives us some UX flexibility when callers abandon password reads (looking at you, PromptMFAChallenge).

Turning clean reads into password reads is not supported. It's tricky and I have a few ideas, but it's not paramount at this moment.

This solves the woes caused by abandoned OTP reads followed by PIN reads in different packages, such as client.PromptMFAChallenge followed by tsh mfa add's implementation.

#9160

@github-actions github-actions bot added the tsh tsh - Teleport's command line tool for logging into nodes running Teleport. label Mar 24, 2022
@github-actions github-actions bot requested review from atburke and smallinsky March 24, 2022 21:26
espadolini
espadolini previously approved these changes Mar 25, 2022
@espadolini espadolini dismissed their stale review March 25, 2022 12:03

approved by mistake, meant to comment

@codingllama codingllama force-pushed the codingllama/context-pwd-reader branch from 80f560d to d103d60 Compare March 25, 2022 13:23
@codingllama codingllama force-pushed the codingllama/context-pwd-reader branch from d103d60 to e37cf8c Compare March 25, 2022 13:25
@codingllama
Copy link
Contributor Author

PTAL @zmb3 @espadolini ?

@codingllama
Copy link
Contributor Author

PTAL?

@codingllama codingllama force-pushed the codingllama/context-pwd-reader branch from f0afb4f to 2c89fa9 Compare March 25, 2022 15:04
@codingllama codingllama force-pushed the codingllama/context-pwd-reader branch from 2c89fa9 to 9fb0048 Compare March 25, 2022 15:47
@codingllama codingllama enabled auto-merge (squash) March 25, 2022 15:49
@codingllama codingllama force-pushed the codingllama/context-pwd-reader branch from 9fb0048 to 0ce2a5c Compare March 25, 2022 16:54
@codingllama codingllama merged commit 5a11006 into master Mar 25, 2022
@codingllama codingllama deleted the codingllama/context-pwd-reader branch March 25, 2022 17:17
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
tsh tsh - Teleport's command line tool for logging into nodes running Teleport.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants