-
Notifications
You must be signed in to change notification settings - Fork 4.1k
GH-39262: [C++][Azure][FS] Add default credential auth configuration #39263
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
Changes from 3 commits
927ff6d
56d796f
4dbe947
5e36f90
0d9ccab
c2a8625
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,9 +43,6 @@ | |
| #include <gmock/gmock-matchers.h> | ||
| #include <gmock/gmock-more-matchers.h> | ||
| #include <gtest/gtest.h> | ||
| #include <azure/identity/client_secret_credential.hpp> | ||
| #include <azure/identity/default_azure_credential.hpp> | ||
| #include <azure/identity/managed_identity_credential.hpp> | ||
| #include <azure/storage/blobs.hpp> | ||
| #include <azure/storage/common/storage_credential.hpp> | ||
| #include <azure/storage/files/datalake.hpp> | ||
|
|
@@ -266,15 +263,12 @@ class AzureHierarchicalNSEnv : public AzureEnvImpl<AzureHierarchicalNSEnv> { | |
| bool WithHierarchicalNamespace() const final { return true; } | ||
| }; | ||
|
|
||
| // Placeholder tests | ||
| // TODO: GH-18014 Remove once a proper test is added | ||
| TEST(AzureFileSystem, InitializeCredentials) { | ||
| auto default_credential = std::make_shared<Azure::Identity::DefaultAzureCredential>(); | ||
| auto managed_identity_credential = | ||
| std::make_shared<Azure::Identity::ManagedIdentityCredential>(); | ||
| auto service_principal_credential = | ||
| std::make_shared<Azure::Identity::ClientSecretCredential>("tenant_id", "client_id", | ||
| "client_secret"); | ||
| TEST(AzureFileSystem, InitialiseFilesystemWithDefaultCredential) { | ||
Tom-Newton marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| AzureOptions options; | ||
| options.backend = AzureBackend::kAzurite; // Irrelevant for this test because it | ||
| // doesn't connect to the server. | ||
| ARROW_EXPECT_OK(options.ConfigureDefaultCredential("dummy-account-name")); | ||
| EXPECT_OK_AND_ASSIGN(auto default_credential_fs, AzureFileSystem::Make(options)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that we can use Azurite with the Can we do an operation (
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had a bit of a try but I couldn't get the SSL setup working. I'll give it another go but I don't have great hope for making it work in CI even if I get it working locally.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I'll also try it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried and understand why you said SSL. I looked at how to set it to Azure SDK for C++. It seems that we need to
If we set How about using
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would definitely be possible to test against real blob storage but there will be a significant amount of manual configuration for all the identities to test all the different authentications. Then we need to provide details of these identities to Also there are some Auth methods that are not feasible to test. For example managed identity can only work on Azure VMs and workload identity can only work in kubernetes. Personally I don't think this is worthwhile to make a more comprehensive test because of how little complexity there is outside the Azure SDK.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this test is enough, because as @pitrou said the other day: "we are not re-implementing the Azure SDK".
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Oh... OK. I see. |
||
| } | ||
|
|
||
| TEST(AzureFileSystem, OptionsCompare) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.