-
Notifications
You must be signed in to change notification settings - Fork 184
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
made custom headers be available to async aws signer #863
Conversation
Signed-off-by: Bruno Murino <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #863 +/- ##
==========================================
- Coverage 71.95% 70.45% -1.50%
==========================================
Files 91 125 +34
Lines 8001 9311 +1310
==========================================
+ Hits 5757 6560 +803
- Misses 2244 2751 +507 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Bruno Murino <[email protected]>
…ync and async clients Signed-off-by: Bruno Murino <[email protected]>
@dblock Indeed the Async transport wasn't leveraging the custom headers passed, so I added that following how it was done in the sync version. Also added a couple of tests. I couldn't find where to add public documentation. I'm happy to add some bits if you point me to the right place. Also, the coverage test is failing but I'm not sure it's due to my changes? |
Signed-off-by: Bruno Murino <[email protected]>
Added some docs in the existing |
Likely not. Would be nice if someone got to the bottom of it. |
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.
Thanks for adding this!
Two nice to have things for a future PR if you want to improve it.
_fetch_url
is common for 2 signers, refactor either into a base class or a utility- The test "knows" that there's an internal
_fetch_url
which is an antipattern, it should be doing the signing and ensuring the signer is called with a different URL - I think we have other tests that use a mock signer already if you want to copy from
Great! Thanks for approving! I agree with the suggested improvements.I did try other test approaches but ended up with using the internal function. I’ll look into the mock signer!On 1 Dec 2024, at 13:32, Daniel (dB.) Doubrovkine ***@***.***> wrote:
@dblock approved this pull request.
Thanks for adding this!
Two nice to have things for a future PR if you want to improve it.
_fetch_url is common for 2 signers, refactor either into a base class or a utility
The test "knows" that there's an internal _fetch_url which is an antipattern, it should be doing the signing and ensuring the signer is called with a different URL - I think we have other tests that use a mock signer already if you want to copy from
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
@dblock Regarding the test, would you be opposed to using something like: with patch("botocore.awsrequest.AWSRequest", side_effect=AWSRequest) as mock_AWSRequest: to see if the right argument was passed? would that still be an antipattern? |
I think that makes things a lot simpler! |
Made changes here #866 |
Description
When creating an Async client, you can now pass a custom 'host' header that will be used for signing the AWS request, if using AWS authentication. This allows accessing OpenSearch via SSH/SSM tunnel, since when doing so the local port of OS would be, most of the time, 443 which is protected.
Issues Resolved
Closes #184
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.