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

Prevent reauthentication for tilde prefix expansion errors #51464

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Jan 24, 2025

In #24254 expansion of tilde prefixes(i.e. tsh scp CHANGELOG.md root@host:~foo/) was explicitly denied. However, because the error returned to the user is a trace.BadParameter error the reauthentication logic kicks in and attempts to resolve the issue with fresh credentials. This error is now caught and wrapped in a NonRetryableError to prevent the authentication logic from providing a weird UX.

Related to #22886.

@rosstimothy rosstimothy added no-changelog Indicates that a PR does not require a changelog entry backport/branch/v15 backport/branch/v16 backport/branch/v17 labels Jan 24, 2025
@rosstimothy rosstimothy marked this pull request as ready for review January 24, 2025 16:58
@github-actions github-actions bot requested review from Joerger and nklaassen January 24, 2025 16:59
@rosstimothy
Copy link
Contributor Author

Friendly ping @Joerger @nklaassen

@rosstimothy rosstimothy force-pushed the tross/sftp_expansion_errors branch from 735e897 to f044617 Compare January 28, 2025 18:54
@rosstimothy rosstimothy requested a review from nklaassen January 29, 2025 18:17
lib/sshutils/sftp/sftp_test.go Outdated Show resolved Hide resolved
In #24254 expansion
of tilde prefixes(i.e. `tsh scp CHANGELOG.md root@host:~foo/`) was
explicitly denied. However, because the error returned to the user
is a trace.BadParameter error the reauthentication logic kicks in
and attempts to resolve the issue with fresh credentials. This
error is now caught and wrapped in a NonRetryableError to prevent
the authentication logic from providing a weird UX.

Updates #22886.
@rosstimothy rosstimothy force-pushed the tross/sftp_expansion_errors branch from 3ae7afa to 75c24b0 Compare January 29, 2025 21:18
@rosstimothy rosstimothy added this pull request to the merge queue Jan 29, 2025
Merged via the queue into master with commit b25252a Jan 29, 2025
41 checks passed
@rosstimothy rosstimothy deleted the tross/sftp_expansion_errors branch January 29, 2025 23:07
@public-teleport-github-review-bot

@rosstimothy See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants