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

core: Fix sensitive value variable validation #27412

Merged
merged 1 commit into from
Jan 6, 2021

Conversation

alisdair
Copy link
Contributor

@alisdair alisdair commented Jan 5, 2021

Binding a sensitive value to a variable with custom validation rules would cause a panic, as the validation expression carries the sensitive mark when it is evaluated for truthiness. This commit drops the marks before testing, which fixes the issue.

Fixes #27375

Binding a sensitive value to a variable with custom validation rules
would cause a panic, as the validation expression carries the sensitive
mark when it is evaluated for truthiness. This commit drops the marks
before testing, which fixes the issue.
@alisdair alisdair added core 0.14-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Jan 5, 2021
@alisdair alisdair requested a review from a team January 5, 2021 18:53
@alisdair alisdair self-assigned this Jan 5, 2021
@codecov
Copy link

codecov bot commented Jan 5, 2021

Codecov Report

Merging #27412 (1fa65bd) into master (5ceb8b2) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
terraform/eval_variable.go 50.84% <100.00%> (+0.84%) ⬆️
internal/providercache/dir.go 67.34% <0.00%> (-6.13%) ⬇️
states/statefile/version4.go 58.19% <0.00%> (+0.23%) ⬆️
terraform/node_resource_plan.go 98.05% <0.00%> (+1.94%) ⬆️

@alisdair alisdair merged commit f96c193 into master Jan 6, 2021
@alisdair alisdair deleted the alisdair/fix-variable-validation-sensitive-value branch January 6, 2021 14:57
@ghost
Copy link

ghost commented Feb 6, 2021

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.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2021
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 core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: value is marked, so must be unmarked first - for loop in output
2 participants