AWS Hook - allow IDP HTTP retry (#12639)#12712
AWS Hook - allow IDP HTTP retry (#12639)#12712baolsen wants to merge 2 commits intoapache:masterfrom baolsen:aws_hook_idp_retries
Conversation
You can use mock.mock to check if all methods are properly called. airflow/tests/providers/amazon/aws/hooks/test_base_aws.py Lines 179 to 253 in a697c58 |
|
Didn't think of that, thanks for the suggestion @mik-laj . Will add something when I can :) |
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
Hey @mik-laj , I think this one is ready for review. |
|
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
|
Hey @mik-laj this one is good to merge |
| @unittest.skipIf(mock_sts is None, 'mock_sts package not present') | ||
| @mock.patch.object(AwsBaseHook, 'get_connection') | ||
| @mock_sts | ||
| def test_assume_role_with_saml(self, mock_get_connection): |
There was a problem hiding this comment.
The title of this PR uses the word "Retry", but I don't see this word appearing in this code. Does this code test the same functionality?
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
Hey @mik-laj , trust all is well that side. |
|
I reopened this PR. |
|
Thank you @mik-laj. |
|
Yes. It is good idea. You can do it. |
|
Will do, thank you |
When doing AssumeRoleWithSAML there is an HTTP request made to an IDP endpoint to obtain the SAML Assertion. This PR allows the IDP request to have a configurable Retry, which makes this authentication mechanism a bit more robust.
I'm not sure how to write tests for this.... suggestions welcome.
Tested with my own Airflow environment which uses this auth method, and it is working as intended.
It's working with and without the new configuration.
closes: 12639