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

Fix ImdsManagedIdentityProvider (#4096) #4193

Merged
merged 1 commit into from
May 10, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented May 10, 2023

Which issue does this PR close?

Closes #4096

Rationale for this change

Originally added by @roeap in #3581 I don't think this has ever worked correctly. Crucially the metadata communication is not an OAuth2 flow, and consequently does not deal with scopes, only resource IDs.

I have confirmed this now works correctly

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the object-store Object Store Interface label May 10, 2023
@@ -383,16 +392,16 @@ struct MsiTokenResponse {
/// This authentication type works in Azure VMs, App Service and Azure Functions applications, as well as the Azure Cloud Shell
/// <https://learn.microsoft.com/en-gb/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token#get-a-token-using-http>
#[derive(Debug)]
pub struct ImdsManagedIdentityOAuthProvider {
pub struct ImdsManagedIdentityProvider {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the OAuth part from the name to highlight that this isn't an OAuth flow

@@ -424,7 +433,7 @@ impl TokenCredential for ImdsManagedIdentityOAuthProvider {
) -> Result<TemporaryToken<String>> {
let mut query_items = vec![
("api-version", MSI_API_VERSION),
("resource", AZURE_STORAGE_SCOPE),
("resource", AZURE_STORAGE_RESOURCE),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the entirety of the change

Copy link
Contributor

@roeap roeap left a comment

Choose a reason for hiding this comment

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

Indeed it did not .- thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImdsManagedIdentityOAuthProvider should send resource ID instead of OIDC scope
2 participants