Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Backport lib/utils/prompt improvements to [v9] #13822

Merged
merged 4 commits into from
Jun 24, 2022

Conversation

codingllama
Copy link
Contributor

prompt.ContextReader, along with various parts of lib/utils/prompt, where re-written in master so we can alleviate input swallowing issues.

For various reasons I didn't backport all changes to v9, but the less-eager input-swallowing loop is now what stands between us and issue #13021.

This isn't a backport of a specific PR, but instead a port of the entire lib/utils/prompt package, as the PRs that touch the package unfortunately do more than we want to backport. The interfaces are still compatible and I did test various tsh login and tsh ssh scenarios.

I've thrown in #13382 for good measure, as well.

Closes #13021.

@github-actions github-actions bot added the tsh tsh - Teleport's command line tool for logging into nodes running Teleport. label Jun 23, 2022
@codingllama
Copy link
Contributor Author

The initial commit is equivalent to:

rm lib/utils/prompt/*
git checkout master -- lib/utils/prompt/

tsh scenarios, including <ctrl+c> in pretty much every step. Showing so we can see the prompts.

$ ./tsh login --proxy=zarquon --user=llama
> Enter password for Teleport user llama:
> Tap any security key or enter a code from a OTP device:
> (ok)

$ ./tsh ssh --proxy=zarquon --user=llama llama@zarquon
> Tap any security key
> (ok, no input swallowed)

$ ./tsh ssh --proxy=zarquon --user=llama --mfa-mode=otp llama@zarquon
> Enter an OTP code from a device: <otp>
> (ok, no input swallowed)

@codingllama
Copy link
Contributor Author

Thanks for the quick reviews, folks.

@codingllama codingllama force-pushed the codingllama/v9-input-swallow-forever branch from ed8ca81 to ccf6c49 Compare June 24, 2022 16:23
@codingllama codingllama enabled auto-merge (squash) June 24, 2022 16:42
@codingllama codingllama merged commit 89f48f7 into branch/v9 Jun 24, 2022
@codingllama codingllama deleted the codingllama/v9-input-swallow-forever branch June 24, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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