From f0b4b948cb404890b513e9b518ef364078bd9031 Mon Sep 17 00:00:00 2001 From: microzchang <110015819+microzchang@users.noreply.github.com> Date: Tue, 10 Oct 2023 12:23:33 +0800 Subject: [PATCH] Storage/STG91 Renamed PublicAudience to DefaultAudience (#5022) * Change Audience * change PublicAudience to DefaultAudience --- .../inc/azure/storage/blobs/blob_options.hpp | 4 ++-- sdk/storage/azure-storage-blobs/src/blob_options.cpp | 2 +- .../azure-storage-blobs/test/ut/block_blob_client_test.cpp | 6 +++--- .../inc/azure/storage/common/internal/constants.hpp | 2 +- .../inc/azure/storage/files/datalake/datalake_options.hpp | 6 +++--- .../azure-storage-files-datalake/src/datalake_options.cpp | 2 +- .../test/ut/datalake_path_client_test.cpp | 6 +++--- .../inc/azure/storage/files/shares/share_options.hpp | 4 ++-- .../azure-storage-files-shares/src/share_options.cpp | 2 +- .../test/ut/share_file_client_test.cpp | 6 +++--- .../inc/azure/storage/queues/queue_options.hpp | 4 ++-- sdk/storage/azure-storage-queues/src/queue_options.cpp | 2 +- .../azure-storage-queues/test/ut/queue_client_test.cpp | 6 +++--- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp index d016ed076..0e6af175a 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp @@ -46,7 +46,7 @@ namespace Azure { namespace Storage { namespace Blobs { * @brief Default Audience. Use to acquire a token for authorizing requests to any Azure * Storage account. */ - AZ_STORAGE_BLOBS_DLLEXPORT const static BlobAudience PublicAudience; + AZ_STORAGE_BLOBS_DLLEXPORT const static BlobAudience DefaultAudience; }; } // namespace Models @@ -198,7 +198,7 @@ namespace Azure { namespace Storage { namespace Blobs { /** * The Audience to use for authentication with Azure Active Directory (AAD). - * #Azure::Storage::Blobs::Models::BlobAudience::PublicAudience will be assumed if Audience is + * #Azure::Storage::Blobs::Models::BlobAudience::DefaultAudience will be assumed if Audience is * not set. */ Azure::Nullable Audience; diff --git a/sdk/storage/azure-storage-blobs/src/blob_options.cpp b/sdk/storage/azure-storage-blobs/src/blob_options.cpp index 420ae10a1..f6c27d689 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_options.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_options.cpp @@ -6,7 +6,7 @@ namespace Azure { namespace Storage { namespace Blobs { namespace Models { - const BlobAudience BlobAudience::PublicAudience(_internal::StoragePublicAudience); + const BlobAudience BlobAudience::DefaultAudience(_internal::StorageDefaultAudience); } // namespace Models BlobQueryInputTextOptions BlobQueryInputTextOptions::CreateCsvTextOptions( diff --git a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp index e01b080bf..a3f53c5d8 100644 --- a/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/ut/block_blob_client_test.cpp @@ -2035,13 +2035,13 @@ namespace Azure { namespace Storage { namespace Test { InitStorageClientOptions()); auto clientOptions = InitStorageClientOptions(); - // default audience + // audience by default auto blockBlobClient = Blobs::BlockBlobClient(m_blockBlobClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(blockBlobClient.GetProperties()); - // public audience - clientOptions.Audience = Blobs::Models::BlobAudience::PublicAudience; + // default audience + clientOptions.Audience = Blobs::Models::BlobAudience::DefaultAudience; blockBlobClient = Blobs::BlockBlobClient(m_blockBlobClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(blockBlobClient.GetProperties()); diff --git a/sdk/storage/azure-storage-common/inc/azure/storage/common/internal/constants.hpp b/sdk/storage/azure-storage-common/inc/azure/storage/common/internal/constants.hpp index 46306c857..1b7db941e 100644 --- a/sdk/storage/azure-storage-common/inc/azure/storage/common/internal/constants.hpp +++ b/sdk/storage/azure-storage-common/inc/azure/storage/common/internal/constants.hpp @@ -11,7 +11,7 @@ namespace Azure { namespace Storage { namespace _internal { constexpr static const char* HttpQuerySnapshot = "snapshot"; constexpr static const char* HttpQueryVersionId = "versionid"; constexpr static const char* StorageScope = "https://storage.azure.com/.default"; - constexpr static const char* StoragePublicAudience = "https://storage.azure.com"; + constexpr static const char* StorageDefaultAudience = "https://storage.azure.com"; constexpr static const char* HttpHeaderDate = "date"; constexpr static const char* HttpHeaderXMsVersion = "x-ms-version"; constexpr static const char* HttpHeaderRequestId = "x-ms-request-id"; diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp index 125d2ebe9..1a9444c48 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp @@ -103,7 +103,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * @brief Default Audience. Use to acquire a token for authorizing requests to any Azure * Storage account. */ - AZ_STORAGE_FILES_DATALAKE_DLLEXPORT const static DataLakeAudience PublicAudience; + AZ_STORAGE_FILES_DATALAKE_DLLEXPORT const static DataLakeAudience DefaultAudience; }; } // namespace Models @@ -173,8 +173,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * The Audience to use for authentication with Azure Active Directory (AAD). - * #Azure::Storage::Files::DataLake::Models::DataLakeAudience::PublicAudience will be assumed if - * Audience is not set. + * #Azure::Storage::Files::DataLake::Models::DataLakeAudience::DefaultAudience will be assumed + * if Audience is not set. */ Azure::Nullable Audience; }; diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_options.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_options.cpp index 5e9641664..09a794549 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_options.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_options.cpp @@ -5,6 +5,6 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace Models { - const DataLakeAudience DataLakeAudience::PublicAudience(_internal::StoragePublicAudience); + const DataLakeAudience DataLakeAudience::DefaultAudience(_internal::StorageDefaultAudience); }}}}} // namespace Azure::Storage::Files::DataLake::Models diff --git a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_path_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_path_client_test.cpp index 42cf82e10..13b2923c0 100644 --- a/sdk/storage/azure-storage-files-datalake/test/ut/datalake_path_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/ut/datalake_path_client_test.cpp @@ -489,13 +489,13 @@ namespace Azure { namespace Storage { namespace Test { InitStorageClientOptions()); auto clientOptions = InitStorageClientOptions(); - // default audience + // audience by default auto pathClient = Files::DataLake::DataLakePathClient(m_pathClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(pathClient.GetProperties()); - // public audience - clientOptions.Audience = Files::DataLake::Models::DataLakeAudience::PublicAudience; + // default audience + clientOptions.Audience = Files::DataLake::Models::DataLakeAudience::DefaultAudience; pathClient = Files::DataLake::DataLakePathClient(m_pathClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(pathClient.GetProperties()); diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp index 86684096b..f8839c895 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp @@ -44,7 +44,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * @brief Default Audience. Use to acquire a token for authorizing requests to any Azure * Storage account. */ - AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareAudience PublicAudience; + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareAudience DefaultAudience; }; } // namespace Models @@ -80,7 +80,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * The Audience to use for authentication with Azure Active Directory (AAD). - * #Azure::Storage::Files::Shares::Models::ShareAudience::PublicAudience will be assumed if + * #Azure::Storage::Files::Shares::Models::ShareAudience::DefaultAudience will be assumed if * Audience is not set. */ Azure::Nullable Audience; diff --git a/sdk/storage/azure-storage-files-shares/src/share_options.cpp b/sdk/storage/azure-storage-files-shares/src/share_options.cpp index 392c3f321..1dfb5515f 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_options.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_options.cpp @@ -5,6 +5,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { namespace Models { - const ShareAudience ShareAudience::PublicAudience(_internal::StoragePublicAudience); + const ShareAudience ShareAudience::DefaultAudience(_internal::StorageDefaultAudience); }}}}} // namespace Azure::Storage::Files::Shares::Models diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp index 967738c5a..18baf0a15 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp @@ -1702,13 +1702,13 @@ namespace Azure { namespace Storage { namespace Test { auto clientOptions = InitStorageClientOptions(); clientOptions.ShareTokenIntent = Files::Shares::Models::ShareTokenIntent::Backup; - // default audience + // audience by default auto fileClient = Files::Shares::ShareFileClient(m_fileClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(fileClient.GetProperties()); - // public audience - clientOptions.Audience = Files::Shares::Models::ShareAudience::PublicAudience; + // default audience + clientOptions.Audience = Files::Shares::Models::ShareAudience::DefaultAudience; fileClient = Files::Shares::ShareFileClient(m_fileClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(fileClient.GetProperties()); diff --git a/sdk/storage/azure-storage-queues/inc/azure/storage/queues/queue_options.hpp b/sdk/storage/azure-storage-queues/inc/azure/storage/queues/queue_options.hpp index f96f05b85..3dccc69a3 100644 --- a/sdk/storage/azure-storage-queues/inc/azure/storage/queues/queue_options.hpp +++ b/sdk/storage/azure-storage-queues/inc/azure/storage/queues/queue_options.hpp @@ -44,7 +44,7 @@ namespace Azure { namespace Storage { namespace Queues { * @brief Default Audience. Use to acquire a token for authorizing requests to any Azure * Storage account. */ - AZ_STORAGE_QUEUES_DLLEXPORT const static QueueAudience PublicAudience; + AZ_STORAGE_QUEUES_DLLEXPORT const static QueueAudience DefaultAudience; }; } // namespace Models @@ -124,7 +124,7 @@ namespace Azure { namespace Storage { namespace Queues { /** * The Audience to use for authentication with Azure Active Directory (AAD). - * #Azure::Storage::Queues::Models::QueueAudience::PublicAudience will be assumed if + * #Azure::Storage::Queues::Models::QueueAudience::DefaultAudience will be assumed if * Audience is not set. */ Azure::Nullable Audience; diff --git a/sdk/storage/azure-storage-queues/src/queue_options.cpp b/sdk/storage/azure-storage-queues/src/queue_options.cpp index 7f1e6333c..49d4df26d 100644 --- a/sdk/storage/azure-storage-queues/src/queue_options.cpp +++ b/sdk/storage/azure-storage-queues/src/queue_options.cpp @@ -7,7 +7,7 @@ namespace Azure { namespace Storage { namespace Queues { namespace Models { - const QueueAudience QueueAudience::PublicAudience(_internal::StoragePublicAudience); + const QueueAudience QueueAudience::DefaultAudience(_internal::StorageDefaultAudience); } // namespace Models const ServiceVersion ServiceVersion::V2018_03_28(std::string("2018-03-28")); diff --git a/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp b/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp index c92f0a473..b307dcda3 100644 --- a/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp +++ b/sdk/storage/azure-storage-queues/test/ut/queue_client_test.cpp @@ -242,12 +242,12 @@ namespace Azure { namespace Storage { namespace Test { InitStorageClientOptions()); auto clientOptions = InitStorageClientOptions(); - // default audience + // audience by default auto queueClient = Queues::QueueClient(m_queueClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(queueClient.GetProperties()); - // public audience - clientOptions.Audience = Queues::Models::QueueAudience::PublicAudience; + // default audience + clientOptions.Audience = Queues::Models::QueueAudience::DefaultAudience; queueClient = Queues::QueueClient(m_queueClient->GetUrl(), credential, clientOptions); EXPECT_NO_THROW(queueClient.GetProperties());