forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-43197: [C++][AzureFS] Ignore password field in URI (apache#4…
…4220) ### Rationale for this change Other Azure Blob Storage based filesystem API implementations don't use password field in URI. We don't use it too for compatibility. ### What changes are included in this PR? Ignore password field. ### Are these changes tested? Yes. ### Are there any user-facing changes? Yes. **This PR includes breaking changes to public APIs.** * GitHub Issue: apache#43197 Authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
- Loading branch information
Showing
3 changed files
with
38 additions
and
74 deletions.
There are no files selected for viewing
This file contains 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -562,60 +562,58 @@ class TestAzureOptions : public ::testing::Test { | |
|
||
void TestFromUriAbfs() { | ||
std::string path; | ||
ASSERT_OK_AND_ASSIGN( | ||
auto options, | ||
AzureOptions::FromUri( | ||
"abfs://account:[email protected]:10000/container/dir/blob", &path)); | ||
ASSERT_OK_AND_ASSIGN(auto options, | ||
AzureOptions::FromUri( | ||
"abfs://[email protected]:10000/container/dir/blob", &path)); | ||
ASSERT_EQ(options.account_name, "account"); | ||
ASSERT_EQ(options.blob_storage_authority, "127.0.0.1:10000"); | ||
ASSERT_EQ(options.dfs_storage_authority, "127.0.0.1:10000"); | ||
ASSERT_EQ(options.blob_storage_scheme, "https"); | ||
ASSERT_EQ(options.dfs_storage_scheme, "https"); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kStorageSharedKey); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kDefault); | ||
ASSERT_EQ(path, "container/dir/blob"); | ||
ASSERT_EQ(options.background_writes, true); | ||
} | ||
|
||
void TestFromUriAbfss() { | ||
std::string path; | ||
ASSERT_OK_AND_ASSIGN( | ||
auto options, | ||
AzureOptions::FromUri( | ||
"abfss://account:[email protected]:10000/container/dir/blob", &path)); | ||
auto options, AzureOptions::FromUri( | ||
"abfss://[email protected]:10000/container/dir/blob", &path)); | ||
ASSERT_EQ(options.account_name, "account"); | ||
ASSERT_EQ(options.blob_storage_authority, "127.0.0.1:10000"); | ||
ASSERT_EQ(options.dfs_storage_authority, "127.0.0.1:10000"); | ||
ASSERT_EQ(options.blob_storage_scheme, "https"); | ||
ASSERT_EQ(options.dfs_storage_scheme, "https"); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kStorageSharedKey); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kDefault); | ||
ASSERT_EQ(path, "container/dir/blob"); | ||
ASSERT_EQ(options.background_writes, true); | ||
} | ||
|
||
void TestFromUriEnableTls() { | ||
std::string path; | ||
ASSERT_OK_AND_ASSIGN(auto options, | ||
AzureOptions::FromUri( | ||
"abfs://account:password@127.0.0.1:10000/container/dir/blob?" | ||
"enable_tls=false", | ||
&path)); | ||
ASSERT_OK_AND_ASSIGN( | ||
auto options, | ||
AzureOptions::FromUri("abfs://[email protected]:10000/container/dir/blob?" | ||
"enable_tls=false", | ||
&path)); | ||
ASSERT_EQ(options.account_name, "account"); | ||
ASSERT_EQ(options.blob_storage_authority, "127.0.0.1:10000"); | ||
ASSERT_EQ(options.dfs_storage_authority, "127.0.0.1:10000"); | ||
ASSERT_EQ(options.blob_storage_scheme, "http"); | ||
ASSERT_EQ(options.dfs_storage_scheme, "http"); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kStorageSharedKey); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kDefault); | ||
ASSERT_EQ(path, "container/dir/blob"); | ||
ASSERT_EQ(options.background_writes, true); | ||
} | ||
|
||
void TestFromUriDisableBackgroundWrites() { | ||
std::string path; | ||
ASSERT_OK_AND_ASSIGN(auto options, | ||
AzureOptions::FromUri( | ||
"abfs://account:password@127.0.0.1:10000/container/dir/blob?" | ||
"background_writes=false", | ||
&path)); | ||
ASSERT_OK_AND_ASSIGN( | ||
auto options, | ||
AzureOptions::FromUri("abfs://[email protected]:10000/container/dir/blob?" | ||
"background_writes=false", | ||
&path)); | ||
ASSERT_EQ(options.background_writes, false); | ||
} | ||
|
||
|
@@ -637,15 +635,6 @@ class TestAzureOptions : public ::testing::Test { | |
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kAnonymous); | ||
} | ||
|
||
void TestFromUriCredentialStorageSharedKey() { | ||
ASSERT_OK_AND_ASSIGN( | ||
auto options, | ||
AzureOptions::FromUri( | ||
"abfs://:[email protected]/container/dir/blob", | ||
nullptr)); | ||
ASSERT_EQ(options.credential_kind_, AzureOptions::CredentialKind::kStorageSharedKey); | ||
} | ||
|
||
void TestFromUriCredentialClientSecret() { | ||
ASSERT_OK_AND_ASSIGN( | ||
auto options, | ||
|
@@ -767,9 +756,6 @@ TEST_F(TestAzureOptions, FromUriDisableBackgroundWrites) { | |
} | ||
TEST_F(TestAzureOptions, FromUriCredentialDefault) { TestFromUriCredentialDefault(); } | ||
TEST_F(TestAzureOptions, FromUriCredentialAnonymous) { TestFromUriCredentialAnonymous(); } | ||
TEST_F(TestAzureOptions, FromUriCredentialStorageSharedKey) { | ||
TestFromUriCredentialStorageSharedKey(); | ||
} | ||
TEST_F(TestAzureOptions, FromUriCredentialClientSecret) { | ||
TestFromUriCredentialClientSecret(); | ||
} | ||
|