Skip to content

stop echoing credential contents in GetCredentials error - #18575

Open
naruto-lgtm wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
naruto-lgtm:credentials-error-redact
Open

stop echoing credential contents in GetCredentials error#18575
naruto-lgtm wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
naruto-lgtm:credentials-error-redact

Conversation

@naruto-lgtm

Copy link
Copy Markdown
Contributor

GetCredentials resolves the provider credentials argument (a service account key, private key included) and, when the google auth library cannot load it, returns unable to parse credentials from '<contents>': <err> in transport/config.go. Any credentials value that is valid JSON but not loadable reaches that branch, so a mistyped or truncated key file has its full contents surfaced in a provider error that Terraform prints to the terminal and to CI logs, none of which is redacted.

Drop the credential contents from both error strings so only the underlying parse error is shown, which is what every other error path in this function already does. Keeping the redaction in the callee means no caller has to remember to scrub credentials before surfacing the failure.

provider: fixed an issue where an invalid `credentials` value could be echoed back in the error message when it failed to parse

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@github-actions
github-actions Bot requested a review from c2thorn August 9, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-approval Pull requests that need reviewer's approval to run presubmit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants