Skip to content

Add support for tsh logout --proxy to work without --user flag when only one identity exists#60851

Merged
kshi36 merged 5 commits intomasterfrom
kevin/tsh-logout-one-identity
Nov 15, 2025
Merged

Add support for tsh logout --proxy to work without --user flag when only one identity exists#60851
kshi36 merged 5 commits intomasterfrom
kevin/tsh-logout-one-identity

Conversation

@kshi36
Copy link
Copy Markdown
Contributor

@kshi36 kshi36 commented Oct 30, 2025

Fixes #58495

changelog: Added support for tsh logout --proxy (or TELEPORT_PROXY set) to work without --user flag when one identity exists

Manual Tests

Test: When proxy is specified with either --proxy or TELEPORT_PROXY env var set, and only one user identity exists for that proxy, tsh logout logs the user out. Identity is defined as user certificate present in the current session.

  • --proxy is set, --user is not given
    • When one identity is logged into the proxy, verify tsh logout logs the user out
    • When multiple identities are logged into the proxy, verify tsh logout specifies the user to include --user flag
  • TELEPORT_PROXY is set, --proxy is not given, --user is not given
    • When one identity is logged into the proxy, verify tsh logout logs the user out
    • When multiple identities are logged into the proxy, verify tsh logout specifies the user to include --user flag

@kshi36 kshi36 marked this pull request as ready for review October 31, 2025 00:04
@kshi36 kshi36 requested review from bernardjkim and r0mant October 31, 2025 00:04
@github-actions github-actions bot added size/md tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Oct 31, 2025
@github-actions github-actions bot requested a review from okraport October 31, 2025 00:05
@kshi36 kshi36 removed the request for review from okraport October 31, 2025 01:26
Comment thread api/utils/keypaths/keypaths.go Outdated
Comment thread lib/client/keystore.go Outdated
Comment thread tool/tsh/common/tsh.go Outdated
Comment thread tool/tsh/common/tsh.go Outdated
Comment thread tool/tsh/common/tsh.go Outdated
Comment thread tool/tsh/common/tsh_test.go Outdated
@kshi36
Copy link
Copy Markdown
Contributor Author

kshi36 commented Nov 11, 2025

Friendly ping @r0mant

Copy link
Copy Markdown
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions that I think will make the PR a bit cleaner.

Comment thread tool/tsh/common/tsh.go
Comment thread tool/tsh/common/tsh.go Outdated
@kshi36 kshi36 requested a review from r0mant November 14, 2025 21:52
@kshi36 kshi36 added this pull request to the merge queue Nov 14, 2025
Merged via the queue into master with commit d1d4654 Nov 15, 2025
44 checks passed
@kshi36 kshi36 deleted the kevin/tsh-logout-one-identity branch November 15, 2025 00:05
kshi36 added a commit that referenced this pull request Nov 15, 2025
…en only one identity exists (#60851)

* Added support for `tsh logout --proxy` to work without `--user` when one identity exists

* Fix lint

* Refactor

* Refactor

* Refactor and update log messages
github-merge-queue bot pushed a commit that referenced this pull request Nov 17, 2025
…en only one identity exists (#60851) (#61404)

* Added support for `tsh logout --proxy` to work without `--user` when one identity exists

* Fix lint

* Refactor

* Refactor

* Refactor and update log messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/md 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.

Allow tsh logout --proxy to work without --user when only one identity exists

4 participants