-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-39320: [C++][FS][Azure] Add managed identity auth configuration #39321
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
felipecrv
merged 8 commits into
apache:main
from
Tom-Newton:tomnewton/azure_managed_identity/GH-39320
Dec 23, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4bfacdd
Add managed identity
Tom-Newton f6e40aa
Ensure filesystem initialisation fails without account name
Tom-Newton d4af840
Fix broken auths
Tom-Newton 3a9b89f
style fix
Tom-Newton 414f582
another code style fix
Tom-Newton de0a869
Move account_name to AzureOptions constructor
Tom-Newton 8cdcf4b
Revert AzureOptions constructor. Just make account_name a public member.
Tom-Newton bfa2cc5
Add a test asserting initialisation fails without an account name
Tom-Newton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another simplification we can make:
kAnonymoustokDefaultCredentialkDefaultCredentialcase here, initializetoken_credential_tostd::make_shared<Azure::Identity::DefaultAzureCredential>()if it's not initialized already.In the
kTokenCredentialcase you can add aDCHECK(token_credential_)as documentation that whencredential_kind_is set tokTokenCredentialwe expect it to be set already (something that is guaranteed bycredential_kind_being private and set only by functions that also initializetoken_credential_.What you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its useful to support both anonymous and default credential as distinct things. Admittedly, its a niche use-case but storage accounts can be public, which is when anonymous is useful https://learn.microsoft.com/en-us/azure/storage/blobs/anonymous-read-access-configure?tabs=portal.
Its a good question though which should be the default. I know
adlfsdeafults to anonomous rather than default credential. In some respects it might be good to be consistent but also this choice of default has caused issues for me in the past e.g. flyteorg/flyte#3962Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Makes sense to keep
kAnonymousthen. But what would you return inAzureOptions::MakeBlobServiceClient()whencredential_kind_is anonymous?Lazy-initcan you create the client without any credentials?token_credential_withDefaultAzureCredentialand create the client with it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked and there is a constructor that doesn't take any credentials. I guess that's what we should call :-)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Do you mind if we do that in a separate PR to fix up anonymous and change the default to default credential. This was supposed to be a super simple PR until kou realised all the auths were broken 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem.