mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-20 10:19:27 -05:00
* prep for processing the structured run output * undo unwanted change to a json key * Add skeleton functions and API for refactored renderer * goimports * Fix documentation of the RenderOpts struct * Add rendering functionality for primitives to the structured renderer * add test case for override * Add support for parsing and rendering sensitive values in the renderer
29 lines
673 B
Go
29 lines
673 B
Go
package differ
|
|
|
|
import "github.com/hashicorp/terraform/internal/command/jsonformat/change"
|
|
|
|
func (v Value) CheckForSensitive() (change.Change, bool) {
|
|
beforeSensitive := v.isBeforeSensitive()
|
|
afterSensitive := v.isAfterSensitive()
|
|
|
|
if !beforeSensitive && !afterSensitive {
|
|
return change.Change{}, false
|
|
}
|
|
|
|
return v.AsChange(change.Sensitive(v.Before, v.After, beforeSensitive, afterSensitive)), true
|
|
}
|
|
|
|
func (v Value) isBeforeSensitive() bool {
|
|
if sensitive, ok := v.BeforeSensitive.(bool); ok {
|
|
return sensitive
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (v Value) isAfterSensitive() bool {
|
|
if sensitive, ok := v.AfterSensitive.(bool); ok {
|
|
return sensitive
|
|
}
|
|
return false
|
|
}
|