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

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

Merged
merged 2 commits into from
Oct 14, 2024

Conversation

zmb3
Copy link
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
39 checks passed
@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
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