You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
resp.Diagnostics.AddAttributeWarning(
req.Path,
"Usage of GPG can't be validated.",
"Due to limitations of go libraries, your GPG key can't be validated client side.",
)
Terraform Configuration Files
N/A
Debug Output
│ Warning: Usage of GPG can't be validated.│ │ with artifactory_keypair.some-keypair-6543461672124900137,│ on cdk.tf.json line 2802, in resource.artifactory_keypair.some-keypair-6543461672124900137:│ 2802: "private_key": "-----BEGIN PGP PRIVATE KEY BLOCK----- <redacted> -----END PGP PRIVATE KEY BLOCK-----",│ │ Due to limitations of go libraries, your GPG key can't be validated client│ side.
Expected Behavior
The value of the sensitive attribute should either be redacted or hidden completely.
Setting an attribute Sensitive flag should signal to Terraform across the plugin protocol that it should treat any values of that attribute as sensitive data and not directly display them in output. The configuration context shown in warning and error diagnostics is handled by Terraform and if Terraform is not honoring the attribute sensitive behavior, this issue should be raised in the Terraform issue tracker instead as there is nothing else that the provider side of the protocol can do to change or further influence this display of the value in that context.
As a temporary workaround, you should be able to remove the attribute path information from the diagnostic (e.g. use (diag.Diagnostics).AddWarning() instead) to prevent the direct display of the value. The configuration context shown by Terraform should then only show the configuration line of the resource block instead.
The warning message for an attribute that has been marked as "Sensitive" shows the value in the console.
I suspect similar misbehavior for error message?
Module version
Relevant provider source code
Terraform Configuration Files
N/A
Debug Output
Expected Behavior
The value of the sensitive attribute should either be redacted or hidden completely.
Actual Behavior
The value is output verbatim to the console.
Steps to Reproduce
N/A
References
Issue from practitioner: jfrog/terraform-provider-artifactory#977
Source code: https://github.com/jfrog/terraform-provider-artifactory/blob/master/pkg/artifactory/resource/security/resource_artifactory_keypair.go#L114 and https://github.com/jfrog/terraform-provider-artifactory/blob/master/pkg/artifactory/resource/security/resource_artifactory_keypair.go#L284
The text was updated successfully, but these errors were encountered: