Skip to content

[v16] tctl: add a --with-secrets flag to tctl tokens ls#47545

Merged
zmb3 merged 2 commits intobranch/v16from
auto-backport/47356-to-branch/v16
Oct 14, 2024
Merged

[v16] tctl: add a --with-secrets flag to tctl tokens ls#47545
zmb3 merged 2 commits intobranch/v16from
auto-backport/47356-to-branch/v16

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Oct 13, 2024

Show the "safe name" for tokens by default, which is the name of the token for non-sensitive join tokens, and a redacted version of the name for shared secret tokens.

Note: for --format=json or --format=yaml we currently maintain the original behavior (always show the raw token contents). The tctl get tokens command has also not been touched - it continues to return the raw token resource from the backend.

This also fixes a bug where we used to show Unix time zero as the expiry, because we were only checking for time.IsZero (Go's zero time is not the same as Unix zero time).

Updates #47254

Screenshot 2024-10-08 at 12 18 24 PM

Changelog: The tctl tokens ls command redacts secret join tokens by default. To include the token values, provide the new --with-secrets flag.

Backports #47356

Show the "safe name" for tokens by default, which is the name of
the token for non-sensitive join tokens, and a redacted version
of the name for shared secret tokens.

Note: for --format=json or --format=yaml we currently maintain
the original behavior (always show the raw token contents).
The tctl get tokens command has also not been touched - it
continues to return the raw token resource from the backend.

Updates #47254
@github-actions github-actions Bot added backport size/sm tctl tctl - Teleport admin tool labels Oct 13, 2024
@zmb3 zmb3 added this pull request to the merge queue Oct 14, 2024
Merged via the queue into branch/v16 with commit 5d1304b Oct 14, 2024
@zmb3 zmb3 deleted the auto-backport/47356-to-branch/v16 branch October 14, 2024 23:46
@camscale camscale mentioned this pull request Oct 16, 2024
@fheinecke fheinecke mentioned this pull request Apr 9, 2025
@fheinecke fheinecke mentioned this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport size/sm tctl tctl - Teleport admin tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants