Skip to content

tctl: add a --with-secrets flag to tctl tokens ls#47356

Merged
zmb3 merged 1 commit intomasterfrom
zmb3/tctl-token-secrets
Oct 8, 2024
Merged

tctl: add a --with-secrets flag to tctl tokens ls#47356
zmb3 merged 1 commit intomasterfrom
zmb3/tctl-token-secrets

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Oct 8, 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.

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 size/sm tctl tctl - Teleport admin tool labels Oct 8, 2024
@github-actions github-actions Bot requested review from avatus and eriktate October 8, 2024 18:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 8, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 8, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/sm tctl tctl - Teleport admin tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants