Commit Graph

6 Commits

Author SHA1 Message Date
Radek Simko 98a796c3a3
Merge pull request #22272 from hashicorp/f-httpclient-ua
httpclient: Introduce composable UserAgent()
2019-08-12 20:20:03 +01:00
Radek Simko 34d90d4be0
httpclient: Introduce composable UserAgent()
This interface is meant to replace the following ones (in use by some providers):

 - httpclient.UserAgentString() (e.g. AzureRM, Google)
 - terraform.UserAgentString (e.g. OpenStack, ProfitBricks)
 - terraform.VersionString (e.g. AWS, AzureStack, DigitalOcean, Kubernetes)

This also proposes the initial UA string to be set to

    HashiCorp Terraform/X.Y.Z (+https://www.terraform.io)
2019-08-05 11:07:21 +01:00
Martin Atkins 0f2c4b3b68 httpclient: Create trace logging for outgoing HTTP requests
Sometimes HTTP requests are buried inside third-party libraries where we
can't otherwise access their request method/URL, so this ensures we'll
always have at least a record of the fact that a request happened, even if
there's no other logging for why it did.

We only include the method and URL here under the assumption that
secret keys and other particularly sensitive information will not appear
there, in line with usual best-practices.
2019-08-01 10:57:22 -07:00
Paul Tyng 6284f99708
Allow callers to append to user agent 2018-03-15 10:53:44 -04:00
Paul Tyng fb9531b3d9
Rename http client test 2018-03-15 09:48:37 -04:00
Paul Tyng c868092d2d
Standardize http.Client creation with User-Agent 2018-02-28 12:09:50 -05:00