diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 475a5bd48..13727f275 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -41,6 +41,8 @@ - Moved types in the `Azure::IO` namespace like `BodyStream` to `Azure::Core::IO`. - Moved `Azure::Core::ETag` to `Azure::ETag`. - Moved `Azure::Core::DateTime` to `Azure::DateTime`. +- Renamed `Azure::Core::Http::TokenRequestOptions` to `Azure::Core::Credentials::TokenRequestContext`. +- Moved `AccessToken`, `TokenCredential`, and `AuthenticationException` from `Azure::Core` to `Azure::Core::Credentials` namespace. ### Bug Fixes diff --git a/sdk/core/azure-core/inc/azure/core/credentials.hpp b/sdk/core/azure-core/inc/azure/core/credentials.hpp index f8c48e2ce..5f46015a5 100644 --- a/sdk/core/azure-core/inc/azure/core/credentials.hpp +++ b/sdk/core/azure-core/inc/azure/core/credentials.hpp @@ -16,8 +16,9 @@ #include #include #include +#include -namespace Azure { namespace Core { +namespace Azure { namespace Core { namespace Credentials { /** * @brief Represents an access token. @@ -35,9 +36,16 @@ namespace Azure { namespace Core { DateTime ExpiresOn; }; - namespace Http { - struct TokenRequestOptions; - } // namespace Http + /** + * @brief Defines context for getting token. + */ + struct TokenRequestContext + { + /** + * @brief Authentication scopes. + */ + std::vector Scopes; + }; /** * @brief Token credential. @@ -47,12 +55,12 @@ namespace Azure { namespace Core { /** * @brief Get an authentication token. * - * @param tokenRequestOptions Options to get the token. + * @param tokenRequestContext Context to get the token in. * @param context #Azure::Core::Context so that operation can be cancelled. * */ virtual AccessToken GetToken( - Http::TokenRequestOptions const& tokenRequestOptions, + TokenRequestContext const& tokenRequestContext, Context const& context) const = 0; /// Destructor. @@ -87,4 +95,4 @@ namespace Azure { namespace Core { */ char const* what() const noexcept override { return m_message.c_str(); } }; -}} // namespace Azure::Core +}}} // namespace Azure::Core::Credentials diff --git a/sdk/core/azure-core/inc/azure/core/http/policy.hpp b/sdk/core/azure-core/inc/azure/core/http/policy.hpp index e01eb528f..004d39c7f 100644 --- a/sdk/core/azure-core/inc/azure/core/http/policy.hpp +++ b/sdk/core/azure-core/inc/azure/core/http/policy.hpp @@ -342,26 +342,15 @@ namespace Azure { namespace Core { namespace Http { Context const& ctx) const override; }; - /** - * @brief Defines options for getting token. - */ - struct TokenRequestOptions - { - /** - * @brief Authentication scopes. - */ - std::vector Scopes; - }; - /** * @brief Bearer Token authentication policy. */ class BearerTokenAuthenticationPolicy : public HttpPolicy { private: - std::shared_ptr const m_credential; - TokenRequestOptions m_tokenRequestOptions; + std::shared_ptr const m_credential; + Credentials::TokenRequestContext m_tokenRequestContext; - mutable AccessToken m_accessToken; + mutable Credentials::AccessToken m_accessToken; mutable std::mutex m_accessTokenMutex; BearerTokenAuthenticationPolicy(BearerTokenAuthenticationPolicy const&) = delete; @@ -371,19 +360,19 @@ namespace Azure { namespace Core { namespace Http { /** * @brief Construct a Bearer Token authentication policy. * - * @param credential A #Azure::Core::TokenCredential to use with this policy. - * @param tokenRequestOptions #Azure::Core::Http::TokenRequestOptions. + * @param credential An #Azure::Core::TokenCredential to use with this policy. + * @param tokenRequestContext #Azure::Core::Credentials::TokenRequestContext. */ explicit BearerTokenAuthenticationPolicy( - std::shared_ptr credential, - TokenRequestOptions tokenRequestOptions) - : m_credential(std::move(credential)), m_tokenRequestOptions(std::move(tokenRequestOptions)) + std::shared_ptr credential, + Credentials::TokenRequestContext tokenRequestContext) + : m_credential(std::move(credential)), m_tokenRequestContext(std::move(tokenRequestContext)) { } std::unique_ptr Clone() const override { - return std::make_unique(m_credential, m_tokenRequestOptions); + return std::make_unique(m_credential, m_tokenRequestContext); } std::unique_ptr Send( diff --git a/sdk/core/azure-core/src/http/bearer_token_authentication_policy.cpp b/sdk/core/azure-core/src/http/bearer_token_authentication_policy.cpp index c17232000..faa7d7afd 100644 --- a/sdk/core/azure-core/src/http/bearer_token_authentication_policy.cpp +++ b/sdk/core/azure-core/src/http/bearer_token_authentication_policy.cpp @@ -19,7 +19,7 @@ std::unique_ptr BearerTokenAuthenticationPolicy::Send( // Refresh the token in 2 or less minutes before the actual expiration. if (std::chrono::system_clock::now() > (m_accessToken.ExpiresOn - std::chrono::minutes(2))) { - m_accessToken = m_credential->GetToken(m_tokenRequestOptions, context); + m_accessToken = m_credential->GetToken(m_tokenRequestContext, context); } request.SetHeader("authorization", "Bearer " + m_accessToken.Token); diff --git a/sdk/identity/azure-identity/inc/azure/identity/client_secret_credential.hpp b/sdk/identity/azure-identity/inc/azure/identity/client_secret_credential.hpp index 712743645..090ed5d0c 100644 --- a/sdk/identity/azure-identity/inc/azure/identity/client_secret_credential.hpp +++ b/sdk/identity/azure-identity/inc/azure/identity/client_secret_credential.hpp @@ -44,7 +44,7 @@ namespace Azure { namespace Identity { * @brief This class is used by Azure SDK clients to authenticate with the Azure service using a * tenant ID, client ID and client secret. */ - class ClientSecretCredential : public Core::TokenCredential { + class ClientSecretCredential : public Core::Credentials::TokenCredential { private: std::string m_tenantId; std::string m_clientId; @@ -70,8 +70,8 @@ namespace Azure { namespace Identity { { } - Core::AccessToken GetToken( - Core::Http::TokenRequestOptions const& tokenRequestOptions, + Core::Credentials::AccessToken GetToken( + Core::Credentials::TokenRequestContext const& tokenRequestContext, Core::Context const& context) const override; }; diff --git a/sdk/identity/azure-identity/inc/azure/identity/environment_credential.hpp b/sdk/identity/azure-identity/inc/azure/identity/environment_credential.hpp index c2a838473..e51739b93 100644 --- a/sdk/identity/azure-identity/inc/azure/identity/environment_credential.hpp +++ b/sdk/identity/azure-identity/inc/azure/identity/environment_credential.hpp @@ -17,7 +17,7 @@ namespace Azure { namespace Identity { /** * @brief An environment credential. */ - class EnvironmentCredential : public Core::TokenCredential { + class EnvironmentCredential : public Core::Credentials::TokenCredential { std::unique_ptr m_credentialImpl; public: @@ -34,8 +34,8 @@ namespace Azure { namespace Identity { */ explicit EnvironmentCredential(); - Core::AccessToken GetToken( - Core::Http::TokenRequestOptions const& tokenRequestOptions, + Core::Credentials::AccessToken GetToken( + Core::Credentials::TokenRequestContext const& tokenRequestContext, Core::Context const& context) const override; }; diff --git a/sdk/identity/azure-identity/src/client_secret_credential.cpp b/sdk/identity/azure-identity/src/client_secret_credential.cpp index 37b639231..b5a300c00 100644 --- a/sdk/identity/azure-identity/src/client_secret_credential.cpp +++ b/sdk/identity/azure-identity/src/client_secret_credential.cpp @@ -10,16 +10,17 @@ #include using namespace Azure::Identity; -using namespace Azure::Core::IO; std::string const Azure::Identity::_detail::g_aadGlobalAuthority = "https://login.microsoftonline.com/"; -Azure::Core::AccessToken ClientSecretCredential::GetToken( - Azure::Core::Http::TokenRequestOptions const& tokenRequestOptions, +Azure::Core::Credentials::AccessToken ClientSecretCredential::GetToken( + Azure::Core::Credentials::TokenRequestContext const& tokenRequestContext, Azure::Core::Context const& context) const { using namespace Azure::Core; + using namespace Azure::Core::Credentials; + using namespace Azure::Core::IO; using namespace Azure::Core::Http; using namespace Azure::Core::Http::_internal; @@ -34,7 +35,7 @@ Azure::Core::AccessToken ClientSecretCredential::GetToken( body << "grant_type=client_credentials&client_id=" << Url::Encode(m_clientId) << "&client_secret=" << Url::Encode(m_clientSecret); - auto const& scopes = tokenRequestOptions.Scopes; + auto const& scopes = tokenRequestContext.Scopes; if (!scopes.empty()) { auto scopesIter = scopes.begin(); diff --git a/sdk/identity/azure-identity/src/environment_credential.cpp b/sdk/identity/azure-identity/src/environment_credential.cpp index 27c58bb7a..da37c6804 100644 --- a/sdk/identity/azure-identity/src/environment_credential.cpp +++ b/sdk/identity/azure-identity/src/environment_credential.cpp @@ -79,11 +79,11 @@ EnvironmentCredential::EnvironmentCredential() #endif } -Azure::Core::AccessToken EnvironmentCredential::GetToken( - Azure::Core::Http::TokenRequestOptions const& tokenRequestOptions, +Azure::Core::Credentials::AccessToken EnvironmentCredential::GetToken( + Azure::Core::Credentials::TokenRequestContext const& tokenRequestContext, Azure::Core::Context const& context) const { - using namespace Azure::Core; + using namespace Azure::Core::Credentials; if (!m_credentialImpl) { @@ -91,5 +91,5 @@ Azure::Core::AccessToken EnvironmentCredential::GetToken( "Environment variables are not fully configured."); } - return m_credentialImpl->GetToken(tokenRequestOptions, context); + return m_credentialImpl->GetToken(tokenRequestContext, context); } diff --git a/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential.hpp b/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential.hpp index 6d2990a7b..b50aa6a5d 100644 --- a/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential.hpp +++ b/sdk/identity/azure-identity/test/perf/inc/azure/identity/test/secret_credential.hpp @@ -28,8 +28,8 @@ namespace Azure { namespace Identity { namespace Test { std::string m_tenantId; std::string m_clientId; std::string m_secret; - Azure::Core::Http::TokenRequestOptions m_scopes; - std::unique_ptr m_credentail; + Core::Credentials::TokenRequestContext m_tokenRequestContext; + std::unique_ptr m_credential; public: /** @@ -41,8 +41,8 @@ namespace Azure { namespace Identity { namespace Test { m_tenantId = m_options.GetMandatoryOption("TenantId"); m_clientId = m_options.GetMandatoryOption("ClientId"); m_secret = m_options.GetMandatoryOption("Secret"); - m_scopes.Scopes.push_back(m_options.GetMandatoryOption("Scope")); - m_credentail = std::make_unique( + m_tokenRequestContext.Scopes.push_back(m_options.GetMandatoryOption("Scope")); + m_credential = std::make_unique( m_tenantId, m_clientId, m_secret); } @@ -60,7 +60,7 @@ namespace Azure { namespace Identity { namespace Test { */ void Run(Azure::Core::Context const& context) override { - auto t = m_credentail->GetToken(m_scopes, context); + auto t = m_credential->GetToken(m_tokenRequestContext, context); } /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client.hpp b/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client.hpp index 3fa89fb97..e2a721392 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/inc/azure/keyvault/keys/key_client.hpp @@ -42,7 +42,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { */ explicit KeyClient( std::string const& vaultUrl, - std::shared_ptr credential, + std::shared_ptr credential, KeyClientOptions options = KeyClientOptions()); /** diff --git a/sdk/keyvault/azure-security-keyvault-keys/sample/get-key/main.cpp b/sdk/keyvault/azure-security-keyvault-keys/sample/get-key/main.cpp index fdca1b074..d50e897cb 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/sample/get-key/main.cpp +++ b/sdk/keyvault/azure-security-keyvault-keys/sample/get-key/main.cpp @@ -57,7 +57,7 @@ int main() std::cout << " - " << operation.ToString() << std::endl; } } - catch (Azure::Core::AuthenticationException const& e) + catch (Azure::Core::Credentials::AuthenticationException const& e) { std::cout << "Authentication Exception happened:" << std::endl << e.what() << std::endl; } diff --git a/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp b/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp index 3ec22488a..1495e2958 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp +++ b/sdk/keyvault/azure-security-keyvault-keys/src/key_client.cpp @@ -18,18 +18,18 @@ using namespace Azure::Core::Http; KeyClient::KeyClient( std::string const& vaultUrl, - std::shared_ptr credential, + std::shared_ptr credential, KeyClientOptions options) { auto apiVersion = options.GetVersionString(); std::vector> perRetrypolicies; { - Azure::Core::Http::TokenRequestOptions const tokenOptions + Azure::Core::Credentials::TokenRequestContext const tokenContext = {{"https://vault.azure.net/.default"}}; perRetrypolicies.emplace_back( - std::make_unique(credential, tokenOptions)); + std::make_unique(credential, tokenContext)); } m_pipeline = std::make_shared( diff --git a/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key.hpp b/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key.hpp index 1c9b8969d..c95aea111 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key.hpp +++ b/sdk/keyvault/azure-security-keyvault-keys/test/perf/inc/azure/keyvault/keys/test/get_key.hpp @@ -31,7 +31,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam std::string m_tenantId; std::string m_clientId; std::string m_secret; - std::shared_ptr m_credentail; + std::shared_ptr m_credential; std::unique_ptr m_client; public: @@ -46,10 +46,10 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam m_tenantId = m_options.GetMandatoryOption("TenantId"); m_clientId = m_options.GetMandatoryOption("ClientId"); m_secret = m_options.GetMandatoryOption("Secret"); - m_credentail = std::make_shared( + m_credential = std::make_shared( m_tenantId, m_clientId, m_secret); m_client - = std::make_unique(m_vaultUrl, m_credentail); + = std::make_unique(m_vaultUrl, m_credential); } /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/append_blob_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/append_blob_client.hpp index 54b8bb09e..c0ce08a96 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/append_blob_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/append_blob_client.hpp @@ -65,7 +65,7 @@ namespace Azure { namespace Storage { namespace Blobs { */ explicit AppendBlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options = BlobClientOptions()); /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_client.hpp index 765868de6..d5069dac9 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_client.hpp @@ -74,7 +74,7 @@ namespace Azure { namespace Storage { namespace Blobs { */ explicit BlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options = BlobClientOptions()); /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp index 6fd893f67..50a26cb4e 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_container_client.hpp @@ -62,7 +62,7 @@ namespace Azure { namespace Storage { namespace Blobs { */ explicit BlobContainerClient( const std::string& blobContainerUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options = BlobClientOptions()); /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_service_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_service_client.hpp index 5df4adb00..4995249d4 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_service_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_service_client.hpp @@ -55,7 +55,7 @@ namespace Azure { namespace Storage { namespace Blobs { */ explicit BlobServiceClient( const std::string& serviceUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options = BlobClientOptions()); /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/block_blob_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/block_blob_client.hpp index f9b028950..7add522cc 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/block_blob_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/block_blob_client.hpp @@ -75,7 +75,7 @@ namespace Azure { namespace Storage { namespace Blobs { */ explicit BlockBlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options = BlobClientOptions()); /** diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/page_blob_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/page_blob_client.hpp index a2c7db4de..4a61ef648 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/page_blob_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/page_blob_client.hpp @@ -67,7 +67,7 @@ namespace Azure { namespace Storage { namespace Blobs { */ explicit PageBlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options = BlobClientOptions()); /** diff --git a/sdk/storage/azure-storage-blobs/src/append_blob_client.cpp b/sdk/storage/azure-storage-blobs/src/append_blob_client.cpp index dcceec19c..d96003fd9 100644 --- a/sdk/storage/azure-storage-blobs/src/append_blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/append_blob_client.cpp @@ -29,7 +29,7 @@ namespace Azure { namespace Storage { namespace Blobs { AppendBlobClient::AppendBlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options) : BlobClient(blobUrl, std::move(credential), options) { diff --git a/sdk/storage/azure-storage-blobs/src/blob_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_client.cpp index 5eae834b0..fe115d4a6 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_client.cpp @@ -73,7 +73,7 @@ namespace Azure { namespace Storage { namespace Blobs { BlobClient::BlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options) : BlobClient(blobUrl, options) { @@ -84,11 +84,11 @@ namespace Azure { namespace Storage { namespace Blobs { m_blobUrl.GetHost(), options.SecondaryHostForRetryReads)); perRetryPolicies.emplace_back(std::make_unique()); { - Azure::Core::Http::TokenRequestOptions tokenOptions; - tokenOptions.Scopes.emplace_back(Storage::_detail::StorageScope); + Azure::Core::Credentials::TokenRequestContext tokenContext; + tokenContext.Scopes.emplace_back(Storage::_detail::StorageScope); perRetryPolicies.emplace_back( std::make_unique( - credential, tokenOptions)); + credential, tokenContext)); } { Azure::Core::Http::_internal::ValueOptions valueOptions; diff --git a/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp index a90f90edf..eacb51450 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_container_client.cpp @@ -69,7 +69,7 @@ namespace Azure { namespace Storage { namespace Blobs { BlobContainerClient::BlobContainerClient( const std::string& blobContainerUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options) : BlobContainerClient(blobContainerUrl, options) { @@ -80,11 +80,11 @@ namespace Azure { namespace Storage { namespace Blobs { m_blobContainerUrl.GetHost(), options.SecondaryHostForRetryReads)); perRetryPolicies.emplace_back(std::make_unique()); { - Azure::Core::Http::TokenRequestOptions tokenOptions; - tokenOptions.Scopes.emplace_back(Storage::_detail::StorageScope); + Azure::Core::Credentials::TokenRequestContext tokenContext; + tokenContext.Scopes.emplace_back(Storage::_detail::StorageScope); perRetryPolicies.emplace_back( std::make_unique( - credential, tokenOptions)); + credential, tokenContext)); } { Azure::Core::Http::_internal::ValueOptions valueOptions; diff --git a/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp b/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp index c8d333458..d84b7d465 100644 --- a/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/blob_service_client.cpp @@ -64,7 +64,7 @@ namespace Azure { namespace Storage { namespace Blobs { BlobServiceClient::BlobServiceClient( const std::string& serviceUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options) : BlobServiceClient(serviceUrl, options) { @@ -75,11 +75,11 @@ namespace Azure { namespace Storage { namespace Blobs { m_serviceUrl.GetHost(), options.SecondaryHostForRetryReads)); perRetryPolicies.emplace_back(std::make_unique()); { - Azure::Core::Http::TokenRequestOptions tokenOptions; - tokenOptions.Scopes.emplace_back(Storage::_detail::StorageScope); + Azure::Core::Credentials::TokenRequestContext tokenContext; + tokenContext.Scopes.emplace_back(Storage::_detail::StorageScope); perRetryPolicies.emplace_back( std::make_unique( - credential, tokenOptions)); + credential, tokenContext)); } { Azure::Core::Http::_internal::ValueOptions valueOptions; diff --git a/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp b/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp index f2b18ac60..98a46444f 100644 --- a/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/block_blob_client.cpp @@ -33,7 +33,7 @@ namespace Azure { namespace Storage { namespace Blobs { BlockBlobClient::BlockBlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options) : BlobClient(blobUrl, std::move(credential), options) { diff --git a/sdk/storage/azure-storage-blobs/src/page_blob_client.cpp b/sdk/storage/azure-storage-blobs/src/page_blob_client.cpp index 537ab36a2..6f08225f1 100644 --- a/sdk/storage/azure-storage-blobs/src/page_blob_client.cpp +++ b/sdk/storage/azure-storage-blobs/src/page_blob_client.cpp @@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Blobs { PageBlobClient::PageBlobClient( const std::string& blobUrl, - std::shared_ptr credential, + std::shared_ptr credential, const BlobClientOptions& options) : BlobClient(blobUrl, std::move(credential), options) { diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp index 94ace4006..1642ba957 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp @@ -54,7 +54,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { */ explicit DataLakeDirectoryClient( const std::string& directoryUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options = DataLakeClientOptions()); /** diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp index 8f19cebf0..54c80590c 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_client.hpp @@ -55,7 +55,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { */ explicit DataLakeFileClient( const std::string& fileUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options = DataLakeClientOptions()); /** diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp index 5fbbabf37..861bad2ff 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp @@ -56,7 +56,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { */ explicit DataLakeFileSystemClient( const std::string& fileSystemUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options = DataLakeClientOptions()); /** diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_path_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_path_client.hpp index 2ae7f10c1..27ff0b2d1 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_path_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_path_client.hpp @@ -56,7 +56,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { */ explicit DataLakePathClient( const std::string& pathUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options = DataLakeClientOptions()); /** diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp index f5d6e7a1a..019ad735d 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp @@ -51,7 +51,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { */ explicit DataLakeServiceClient( const std::string& serviceUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options = DataLakeClientOptions()); /** diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp index 02b476cb7..7c9fbb2fe 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp @@ -48,7 +48,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { DataLakeDirectoryClient::DataLakeDirectoryClient( const std::string& directoryUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options) : DataLakePathClient(directoryUrl, credential, options) { diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp index d0d378dd3..bf236d1a6 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp @@ -110,7 +110,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { DataLakeFileClient::DataLakeFileClient( const std::string& fileUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options) : DataLakePathClient(fileUrl, credential, options) { diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp index a01736fdc..41babc8e6 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_system_client.cpp @@ -76,7 +76,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { DataLakeFileSystemClient::DataLakeFileSystemClient( const std::string& fileSystemUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options) : m_fileSystemUrl(fileSystemUrl), m_blobContainerClient( _detail::GetBlobUrlFromUrl(fileSystemUrl), @@ -90,11 +90,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_fileSystemUrl.GetHost(), options.SecondaryHostForRetryReads)); perRetryPolicies.emplace_back(std::make_unique()); { - Azure::Core::Http::TokenRequestOptions tokenOptions; - tokenOptions.Scopes.emplace_back(Storage::_detail::StorageScope); + Azure::Core::Credentials::TokenRequestContext tokenContext; + tokenContext.Scopes.emplace_back(Storage::_detail::StorageScope); perRetryPolicies.emplace_back( std::make_unique( - credential, tokenOptions)); + credential, tokenContext)); } { Azure::Core::Http::_internal::ValueOptions valueOptions; diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp index 900ab448c..cdda370f3 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp @@ -114,7 +114,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { DataLakePathClient::DataLakePathClient( const std::string& pathUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options) : m_pathUrl(pathUrl), m_blobClient( _detail::GetBlobUrlFromUrl(pathUrl), @@ -128,11 +128,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_pathUrl.GetHost(), options.SecondaryHostForRetryReads)); perRetryPolicies.emplace_back(std::make_unique()); { - Azure::Core::Http::TokenRequestOptions tokenOptions; - tokenOptions.Scopes.emplace_back(Storage::_detail::StorageScope); + Azure::Core::Credentials::TokenRequestContext tokenContext; + tokenContext.Scopes.emplace_back(Storage::_detail::StorageScope); perRetryPolicies.emplace_back( std::make_unique( - credential, tokenOptions)); + credential, tokenContext)); } { Azure::Core::Http::_internal::ValueOptions valueOptions; diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp index 49c9465b7..8d7ff923b 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp @@ -117,7 +117,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { DataLakeServiceClient::DataLakeServiceClient( const std::string& serviceUrl, - std::shared_ptr credential, + std::shared_ptr credential, const DataLakeClientOptions& options) : m_serviceUrl(serviceUrl), m_blobServiceClient( _detail::GetBlobUrlFromUrl(serviceUrl), @@ -131,11 +131,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_serviceUrl.GetHost(), options.SecondaryHostForRetryReads)); perRetryPolicies.emplace_back(std::make_unique()); { - Azure::Core::Http::TokenRequestOptions tokenOptions; - tokenOptions.Scopes.emplace_back(Storage::_detail::StorageScope); + Azure::Core::Credentials::TokenRequestContext tokenContext; + tokenContext.Scopes.emplace_back(Storage::_detail::StorageScope); perRetryPolicies.emplace_back( std::make_unique( - credential, tokenOptions)); + credential, tokenContext)); } { Azure::Core::Http::_internal::ValueOptions valueOptions;