Skip to content

Feature/redact sensitive output - #102

Closed
brandonc wants to merge 3 commits into
mainfrom
feature/redact-sensitive-output
Closed

Feature/redact sensitive output#102
brandonc wants to merge 3 commits into
mainfrom
feature/redact-sensitive-output

Conversation

@brandonc

Copy link
Copy Markdown
Collaborator

Description

#101 plus a skill update

jordanenglish and others added 3 commits August 6, 2026 20:16
Some API responses carry credentials and tfctl prints them. A created
token is returned once in full, and a state version carries download URLs
that grant the state itself without a token.

AGENTS.md already requires that a displayer payload never include
credentials, noting that JSON output serializes the full payload rather
than the displayed fields. JSONAPIDisplayer cannot honor that, because it
carries whatever the server returned, and ExcludeColumns does not help:
it feeds FieldTemplates for table and pretty output while outputJSON
marshals the raw envelope.

Add internal/pkg/redact and apply it in format.Outputter.Display, before
the format is selected, so every format agrees and a --jq filter cannot
reach a value that --json would have hidden. Cover Outputter.CopyRaw for
bodies no displayer handles, such as plan JSON, and the --dry-run request
preview, which otherwise echoes the value being set.

Masking is controlled by the redact profile property, TFCTL_REDACT, or
--no-redact, with modes strict (default), known, and off. Copying is on
write, so a response with nothing to mask costs no allocation.
@brandonc brandonc closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants