Skip to content
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

[azure] update authorization header with refreshed token during retry #1531

Closed
wants to merge 1 commit into from

Conversation

kristapratico
Copy link
Contributor

@kristapratico kristapratico commented Jul 8, 2024

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Upon a series of retry attempts, if the the token expires in the middle of it, the existing code is not updating the Authorization header with the refreshed token value.

Additional context & links

Related issue: #1526

@@ -287,8 +287,7 @@ def _prepare_options(self, options: FinalRequestOptions) -> None:

azure_ad_token = self._get_azure_ad_token()
if azure_ad_token is not None:
if headers.get("Authorization") is None:
headers["Authorization"] = f"Bearer {azure_ad_token}"
headers["Authorization"] = f"Bearer {azure_ad_token}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly nervous that this means we'll override any Authorization header that a user set which wouldn't be what they wanted.

I think we could restructure how this _prepare_options() method is called slightly to avoid this instead, I'll look into it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put up a PR here: #1533

@kristapratico
Copy link
Contributor Author

superceded by #1533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants