Skip to content

add AutoRefreshingTokenCredential support to StorageAccountClient #757

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 2 commits into from
May 19, 2022
Merged

add AutoRefreshingTokenCredential support to StorageAccountClient #757

merged 2 commits into from
May 19, 2022

Conversation

yvespp
Copy link
Contributor

@yvespp yvespp commented May 19, 2022

For vectordotdev/vector#8667 a way to refresh the managed identity token is needed. Vector is a log agent that can forward logs to azure blob storage. See also #739.

I add a way to pass TokenCredential to the StorageAccountClient so AutoRefreshingTokenCredential can be passed to it and the client can refresh the token automatically. I tested it locally using the added example.

I don't what's preferred here and can easily drop the second commit:

  • In the first commit I used arc for TokenCredential and implemented Debug, PartialEq and Eq manually.
  • In the second commit I just used box for TokenCredential and removed currently unused traits Clone, PartialEq and Eq.

@ghost
Copy link

ghost commented May 19, 2022

CLA assistant check
All CLA requirements met.

@rylev rylev requested a review from bmc-msft May 19, 2022 13:14
Copy link
Contributor

@bmc-msft bmc-msft left a comment

Choose a reason for hiding this comment

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

LGTM.

Thanks for the contribution!

With this adding support for the azure-identity crate, we can probably remove the bearer token methods, as azure-identity is a significantly better mechanism for managing bearer tokens.

@bmc-msft bmc-msft merged commit 462954f into Azure:main May 19, 2022
@yvespp yvespp deleted the sa_auto_refresh branch May 19, 2022 14:29
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