Skip to content

Conversation

mdb
Copy link

@mdb mdb commented Apr 16, 2025

This seeks to address issue #34 via sensitive_request_headers, which serves the same function as request_headers, but sensitive_request_headers are denoted as sensitive and their values are obscured as ***** in Terraform state.

@mdb mdb requested a review from a team as a code owner April 16, 2025 00:56
Copy link

hashicorp-cla-app bot commented Apr 16, 2025

CLA assistant check
All committers have signed the CLA.

This seeks to address issue hashicorp#34 via `sensitive_request_headers`,
which serves the same function as `request_headers`, but are denoted as
sensitive and their values are obscured as `*****` in Terraform state.

Signed-off-by: Mike Ball <mikedball@gmail.com>
@mdb mdb force-pushed the mdb/sensitive-request-headers branch from e1b4a01 to 0d4aa69 Compare April 16, 2025 00:57
if strings.ToLower(name) == "host" {
request.Host = header
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️ This and the line 348 loop could probably be DRY'd up :)

@ansgarm
Copy link
Member

ansgarm commented Apr 16, 2025

Hi @mdb 👋

but sensitive_request_headers are denoted as sensitive and their values are obscured as ***** in Terraform state

Does wrapping your secret value in sensitive() do the same job?

@mdb
Copy link
Author

mdb commented Apr 16, 2025

Hi @ansgarm - Thanks for the response!

Does wrapping your secret value in sensitive() do the same job?

I don't believe so; sensitive() is a step in the right direction, though the sensitive()-wrapped values still appear in plain text in TF state. Incidentally, @apparentlymart teases some other ideas that might work:

  • Make the provider support .netrc files, and allow you to specify one or more files in the provider configuration itself, to be used across all http resources where the hostname matches.
  • Support a new host block inside the provider block to allow credentials to be provided inline, allowing the same sort of interpolation patterns you can do directly in the resource:

@mdb
Copy link
Author

mdb commented Apr 21, 2025

@ansgarm I'm curious hear your thoughts on PR #524. Would that be preferable over this PR?

@ansgarm
Copy link
Member

ansgarm commented May 2, 2025

Hi @mdb – yes, that PR looks like something we'd rather accept to solve this problem. I'm going to share your new PR with the team to discuss it the next time we meet to discuss the utility providers. So bear with us for another ~week until we get back to you on this. Thank you for all your work on this so far!

In the meantime I'm going to close this PR in favor of your other one.

@ansgarm ansgarm closed this May 2, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants