-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utility Providers Upgrade #136
Conversation
d32f857
to
4b7b20e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very exciting!
}, | ||
Config: fmt.Sprintf(testDataSourceConfigBasic, testHttpMock.server.URL, 200), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccDataSourceBasic("data.http.http_test"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could be written as the below using the acceptance testing helper functions, rather than introducing indirection with a separate function:
resource.TestCheckResourceAttr("data.http.http_test", "body", "1.0.0"),
resource.TestCheckResourceAttr("data.http.http_test", "response_headers.X-Single", "foobar"),
resource.TestCheckResourceAttr("data.http.http_test", "response_headers.X-Double", "1, 2"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Fixed
}, | ||
Config: fmt.Sprintf(testDataSourceConfigWithHeaders, testHttpMock.server.URL, 200), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccDataSourceHeaders("data.http.http_test"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could be written as the below using the acceptance testing helper functions, rather than introducing indirection with a separate function:
resource.TestCheckResourceAttr("data.http.http_test", "body", "1.0.0"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
}, | ||
Config: fmt.Sprintf(testDataSourceConfigUTF8, testHttpMock.server.URL, 200), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccDataSourceUTF8("data.http.http_test"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this could be written as the below using the acceptance testing helper functions, rather than introducing indirection with a separate function:
resource.TestCheckResourceAttr("data.http.http_test", "body", "1.0.0"),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
output "body" { | ||
value = data.http.http_test.body | ||
} | ||
|
||
output "response_headers" { | ||
value = data.http.http_test.response_headers | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing outputs is generally extraneous as compared to just directly checking the data source in question. 👍
output "body" { | |
value = data.http.http_test.body | |
} | |
output "response_headers" { | |
value = data.http.http_test.response_headers | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
|
||
output "body" { | ||
value = data.http.http_test.body | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing outputs is generally extraneous as compared to just directly checking the data source in question. 👍
output "body" { | |
value = data.http.http_test.body | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
|
||
output "body" { | ||
value = "${data.http.http_test.body}" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing outputs is generally extraneous as compared to just directly checking the data source in question. 👍
output "body" { | |
value = "${data.http.http_test.body}" | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
* `response_headers` - A map of strings representing the response HTTP headers. | ||
Duplicate headers are contatenated with `, ` according to | ||
[RFC2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we still be capturing this additional RFC detail in the attribute description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error on my part. Have reinstated.
DESIGN.md
Outdated
## Goals | ||
|
||
* [_Stability over features_](.github/CONTRIBUTING.md) | ||
* Provide managed data source to issue HTTP GET request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there IETF and/pr W3 RFCs to link to for this design choice? Which HTTP versions are supported? Are non-standard HTTP implementations supported (e.g. SPDY, QUIC)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good points.
Given the influx of requests, and the fact that once you start merging things here new requests for features are going to come, it's important to pin point which specific HTTP we support here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated DESIGN.md
.
DESIGN.md
Outdated
|
||
* [_Stability over features_](.github/CONTRIBUTING.md) | ||
* Provide managed data source to issue HTTP GET request. | ||
* Support usage of requests to URLs directed to either `http` or `https`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What implementation details of HTTPS are supported? TLS 1.0 or 1.1 (😬 )? 1.3? Are there relevant IETF/W3 RFCs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely this can be also done by looking at the godoc for the HTTP client we use. And probably they link to these information there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated DESIGN.md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from a few comments on the DESING.md
, I essentially echo what @bflad spotted, especially for testing (and we already touched upon this in our daily chat).
But overall this is already looking great: very glad we are able to bring more and more consistency across those providers.
DESIGN.md
Outdated
## Goals | ||
|
||
* [_Stability over features_](.github/CONTRIBUTING.md) | ||
* Provide managed data source to issue HTTP GET request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good points.
Given the influx of requests, and the fact that once you start merging things here new requests for features are going to come, it's important to pin point which specific HTTP we support here.
DESIGN.md
Outdated
|
||
* [_Stability over features_](.github/CONTRIBUTING.md) | ||
* Provide managed data source to issue HTTP GET request. | ||
* Support usage of requests to URLs directed to either `http` or `https`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely this can be also done by looking at the godoc for the HTTP client we use. And probably they link to these information there.
* Only idempotent GET requests are supported. | ||
* Only 200 status codes are considered successful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I assume this will be updated once your RFC is finalised and work begin to expand this bit?
…ed HTTP and TLS protocol versions (#135)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 🚀 Just some minor additional considerations for the design documentation.
HTTP URLs and either [HTTP/1.1](https://datatracker.ietf.org/doc/html/rfc2616) or | ||
[HTTP/2.0](https://datatracker.ietf.org/doc/html/rfc7540) for HTTPS URLs depending on whether the server supports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe just me but the usage of "URLs" tripped me up slightly here, as I thought it was somehow relating to the actual URL (scheme, host, port, etc.) Maybe clearer to say some thing like HTTP (plaintext) requests and HTTPS (secure) requests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. Have amended.
DESIGN.md
Outdated
* Support usage of requests to URLs directed to either `http` or `https`. The current version of this provider is built | ||
with [Go 1.17](https://go.dev/doc/go1.17) which [supports](https://go.dev/doc/go1.17#minor_library_changes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent! I wonder if it is worth calling out that Go updates may change this support over time based on the fluid security landscape? For example, I believe Go 1.18 removes TLS/1.0 and TLS/1.1 support. I don't think we need to call out the Go 1.18 thing explicitly here, but I think it is worth ensuring we are free to track Go upgrades according to the design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added a statement reflecting that TLS support will track the underlying Go version the provider is built with and will likely change over time.
DESIGN.md
Outdated
[TLS/1.0](https://www.ietf.org/rfc/rfc2246.txt) ([deprecated](https://datatracker.ietf.org/doc/rfc8996/)), | ||
[TLS/1.1](https://datatracker.ietf.org/doc/html/rfc4346) ([deprecated](https://datatracker.ietf.org/doc/rfc8996/)), | ||
[TLS/1.2](https://datatracker.ietf.org/doc/html/rfc5246) and | ||
[TLS/1.3](https://datatracker.ietf.org/doc/html/rfc8446) (supported since [Go 1.13](https://go.dev/doc/go1.13#tls_1_3)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can omit the final parenthesis statement here since as saying Go 1.13 won't mean much for practitioners (as they'd have to determine which provider versions were built and released on that Go version) 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, have removed.
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
#135