hashicorp / terraform-provider-http

Utility provider for interacting with generic HTTP servers as part of a Terraform configuration.
https://registry.terraform.io/providers/hashicorp/http/latest
Mozilla Public License 2.0
206 stars 116 forks source link

Add option to specify data result as sensitive #383

Open asheynkmantyler opened 8 months ago

asheynkmantyler commented 8 months ago

Terraform CLI and Provider Versions

all TF versions, http provider 3.4.1

Use Cases or Problem Statement

I have a case where i would like to use http provider to get access token to the system. Basically you supply client id and client password and get token in return. i would like to be able to mark that token as sensitive to give it minimum protection.

Proposal

I propose a bool argument to the provider: response_is_sensitive. It can default to false to maintain backwards compatibility. Butif it is set, I propose two additional output parameters response_body_sensitive and response_body_base64_sensitive that would contain sensitive data. So code would look like this:


#normal nonsensitive flow
data "http" "non_sensitive" {
<nothing changes here or `response_is_sensitive` is set to false>
}

<data is stored in same variables as before>

sensitive flow:

data "http" "sensitive" {
response_is_sensitive = true
<other stuff>
}

<return data is stored in `response_body_sensitive` and `response_body_base64_sensitive` fields not normal fields

How much impact is this issue causing?

Medium

Additional Information

No response

Code of Conduct