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

Fix internal marshal error of sensitive value #40

Merged
merged 1 commit into from
Apr 9, 2023
Merged

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Apr 9, 2023

See https://github.com/terraform-linters/tflint-ruleset-opa/actions/runs/4651361434/jobs/8230916678
See terraform-linters/tflint-plugin-sdk#239

TFLint v0.46 now allows marked values (sensitive values) to be transferred to plugins. In that case, evaluating a sensitive value will not return tflint.ErrSensitive, but rather the marked cty.Value.

exprToJSON tries to marshal cty.Value to JSON format, but it returns an error like the below when marshaling a marked value:

value has marks, so it cannot be serialized as JSON

This PR converts marked values to JSON in a different way to prevent this error.

@wata727 wata727 merged commit 5fcaa10 into main Apr 9, 2023
@wata727 wata727 deleted the check_marked_value branch April 9, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant