Skip to content

use HttpClient in azure_identity #785

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

Merged
merged 7 commits into from
Jun 13, 2022
Merged

Conversation

ctaggart
Copy link
Contributor

@ctaggart ctaggart commented Jun 8, 2022

The main goal of this PR is to move reqwest out of dependencies to dev-dependencies in azure_identity.

@cataggar cataggar marked this pull request as draft June 8, 2022 13:50
cataggar
cataggar previously approved these changes Jun 8, 2022
Copy link
Member

@cataggar cataggar left a comment

Choose a reason for hiding this comment

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

The flows probably need some manual testing.

@@ -89,43 +107,54 @@ impl TokenCredential for ImdsManagedIdentityCredential {
_ => (),
}

let msi_endpoint_url = Url::parse_with_params(&msi_endpoint, &query_items).context(
let url = Url::parse_with_params(&msi_endpoint, &query_items).context(
Copy link
Member

Choose a reason for hiding this comment

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

We may wish to switch to Url instead of http::Uri for its query parameters support.

@cataggar cataggar self-requested a review June 8, 2022 18:33
@cataggar cataggar marked this pull request as ready for review June 8, 2022 18:34
@cataggar cataggar dismissed their stale review June 8, 2022 18:35

I just meant to comment.

@cataggar cataggar requested review from bmc-msft and rylev June 8, 2022 18:53
@cataggar
Copy link
Member

I would appreciate a review of this.

@cataggar cataggar removed their request for review June 10, 2022 13:51
Comment on lines -48 to +53
client: reqwest::Client,
http_client: &dyn HttpClient,
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels weird from the consumer side, given the client we get from new_http_client is a Arc<dyn HttpClient>. In other areas in the API, we use .clone() instead of .as_ref(), which feels slightly more natural.

Copy link
Contributor

Choose a reason for hiding this comment

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

Other than that, this LGTM and works in all of my use cases.

@cataggar cataggar merged commit 490d34b into Azure:main Jun 13, 2022
@cataggar cataggar added this to the identity 0.4.0 milestone Jun 13, 2022
@cataggar cataggar added the Azure.Identity The azure_identity crate label Jun 13, 2022
@ctaggart ctaggart deleted the identity_HttpClient2 branch June 16, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity The azure_identity crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants