-
Notifications
You must be signed in to change notification settings - Fork 526
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
Add the aws-sigv4 option to generate AWS SigV4 signed requests #1844
Conversation
c838466
to
2950a00
Compare
Regarding docs, I wasn't sure if I should commit the generated docs files too, because they showed several unrelated changes, e.g. replacing |
We usually update the doc later on. |
I'm not sure how to proceed here – apparently the libcurl on those debian, ubuntu and "generic" package tests does not support aws-sigv4 yet. I could probably check beforehand if curl supports that option, but could we even make those integration tests behave differently for those platforms? |
Detecting early on that the option is not supported, and printing a warning would be ideal. |
I wasn't sure how to deal with that – the libcurl error seems kinda appropriate. But I figured it might be good for the future to have a generic way to handle this case and added an HttpError entry for that, so we can return exactly which option failed and what the minimum libcurl version is to support that. Was that what you had in mind?
That was kinda hacky to do :-) Let me know if you have a better idea how to handle that. But this seems to work now on my ubuntu 20.04 VM. |
For the integration test, we could maybe check the request header value in the server. it would avoid using a possible "fake" output file. |
/accept |
🕗 /accept is running, please wait for completion. |
❌ You have to rebase |
This change allows option names to contain digits, like in `aws-sigv4`.
AWS SigV4 support is available in curl since 7.75.0 (December 2020). Add the necessary bits for Hurl to understand this option and pass it on to libcurl, both as a command line option `--aws-sigv4` and as a per-request option `aws-sigv4` in Hurlfiles. Do not emit `Authorization: Basic` when aws-sigv4 is used, as this would take priority over the `Authorization` header generated by libcurl. Instead, explicitly set `username` and `password` options. Suppress removal of the `Expect:` header when using aws-sigv4, as a workaround for curl/curl#11664. Add a corresponding integration test.
9213beb
to
1b7ae46
Compare
I've seen that in other checks, but my intention was to see the actual/expected values in the test output, to easily see what went wrong. I can change it if you prefer. As for the failing "run curl command" test – I have now simply removed the Maybe having an option to disable some tests on some platforms might be more elegant in the long run. |
/accept |
🕗 /accept is running, please wait for completion. |
❌ Some checks are still failing, please fix them before trying to merge this pull request. |
Ok, the ubuntu test fails because that libcurl seems to behave differently than on other OS. The test explicitly sets This happens on ubuntu-latest – it adds two headers, one with the current time:
I guess I'll drop the idea of checking the exact signature and will have the test just check for a correctly-formatted |
Heh, i knew someone would slip in another updated package. Updated. |
/accept |
🕗 /accept is running, please wait for completion. |
✅ Pull request merged and closed by
|
@apparentorder |
AWS SigV4 support is available in curl since 7.75.0 (December 2020).
Add the necessary bits for Hurl to understand this option and pass
it on to libcurl, both as a command line option
--aws-sigv4
andas a per-request option
aws-sigv4
in Hurlfiles.Do not emit
Authorization: Basic
when aws-sigv4 is used, as thiswould take priority over the
Authorization
header generated by libcurl.Instead, explicitly set
username
andpassword
options.Suppress removal of the
Expect:
header when using aws-sigv4, as aworkaround for curl/curl#11664.
Add a corresponding integration test and documentation.