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

Unmark values before showing in JSON #26739

Merged
merged 1 commit into from Oct 28, 2020
Merged

Unmark values before showing in JSON #26739

merged 1 commit into from Oct 28, 2020

Conversation

pselle
Copy link
Contributor

@pselle pselle commented Oct 28, 2020

This prevents "sensitive" values from unintentionally showing as nil when running terraform show -json. Also adjusts the signature of a function to remove an unused argument.

Closes #26737

@pselle pselle force-pushed the pselle/show-json branch 2 times, most recently from c31c6c7 to b3f669a Compare October 28, 2020 19:22
@codecov
Copy link

codecov bot commented Oct 28, 2020

Codecov Report

Merging #26739 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
command/jsonstate/state.go 49.25% <100.00%> (+0.38%) ⬆️
dag/walk.go 91.54% <0.00%> (-0.71%) ⬇️
states/statefile/version4.go 58.19% <0.00%> (+0.23%) ⬆️
terraform/evaluate.go 53.11% <0.00%> (+0.41%) ⬆️
terraform/node_resource_plan.go 97.19% <0.00%> (+1.86%) ⬆️

@pselle pselle added the 0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Oct 28, 2020
@pselle pselle requested a review from a team October 28, 2020 19:27
This prevents "sensitive" values from unintentionally
showing as nil when running terraform show -json
Copy link
Member

@alisdair alisdair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@@ -100,7 +99,10 @@ type resource struct {
// resource, whose structure depends on the resource type schema.
type attributeValues map[string]interface{}

func marshalAttributeValues(value cty.Value, schema *configschema.Block) attributeValues {
func marshalAttributeValues(value cty.Value) attributeValues {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate this incidental clean-up! 🙏

@pselle pselle merged commit 92a8d20 into master Oct 28, 2020
@pselle pselle deleted the pselle/show-json branch October 28, 2020 21:55
@ghost
Copy link

ghost commented Nov 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@hashicorp hashicorp locked as resolved and limited conversation to collaborators Nov 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform show -json not displaying sensitive values
2 participants