From 93a5dbcf863c478a51db7fc99813217d94315a13 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Mon, 12 Feb 2024 12:04:25 +0200 Subject: [PATCH 1/3] Support passing ClientConfiguration to SSOCredentialsProvider. --- .../aws/core/auth/SSOCredentialsProvider.h | 3 ++ .../SSOBearerTokenProvider.h | 2 ++ .../aws/core/internal/AWSHttpResourceClient.h | 4 ++- .../source/auth/SSOCredentialsProvider.cpp | 35 ++++++++++++------- .../SSOBearerTokenProvider.cpp | 22 +++++++++--- .../source/internal/AWSHttpResourceClient.cpp | 20 +++++++---- 6 files changed, 61 insertions(+), 25 deletions(-) diff --git a/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h b/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h index 3b476177b9a..7e3436d0dc6 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h +++ b/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h @@ -21,6 +21,7 @@ namespace Aws { public: SSOCredentialsProvider(); explicit SSOCredentialsProvider(const Aws::String& profile); + explicit SSOCredentialsProvider(const Aws::String& profile, std::shared_ptr config); /** * Retrieves the credentials if found, otherwise returns empty credential set. */ @@ -42,6 +43,8 @@ namespace Aws { Aws::Utils::DateTime m_expiresAt; // The SSO Token Provider Aws::Auth::SSOBearerTokenProvider m_bearerTokenProvider; + // The client configuration to use + std::shared_ptr m_config; void Reload() override; void RefreshIfExpired(); diff --git a/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h b/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h index b0656caa8e4..9f98f797450 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h +++ b/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h @@ -24,6 +24,7 @@ namespace Aws public: SSOBearerTokenProvider(); explicit SSOBearerTokenProvider(const Aws::String& awsProfile); + explicit SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config); /** * Retrieves the bearerToken if found, otherwise returns empty credential set. */ @@ -48,6 +49,7 @@ namespace Aws // Profile description variables Aws::UniquePtr m_client; Aws::String m_profileToUse; + std::shared_ptr m_config; mutable Aws::Auth::AWSBearerToken m_token; mutable Aws::Utils::DateTime m_lastUpdateAttempt; diff --git a/src/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h b/src/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h index ec3557fd8a2..e30204ef1ce 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h +++ b/src/aws-cpp-sdk-core/include/aws/core/internal/AWSHttpResourceClient.h @@ -250,6 +250,7 @@ namespace Aws { public: SSOCredentialsClient(const Client::ClientConfiguration& clientConfiguration); + SSOCredentialsClient(const Client::ClientConfiguration& clientConfiguration, Aws::Http::Scheme scheme, const Aws::String& region); SSOCredentialsClient& operator =(SSOCredentialsClient& rhs) = delete; SSOCredentialsClient(const SSOCredentialsClient& rhs) = delete; @@ -290,7 +291,8 @@ namespace Aws SSOCreateTokenResult CreateToken(const SSOCreateTokenRequest& request); private: - Aws::String buildEndpoint(const Aws::Client::ClientConfiguration& clientConfiguration, + Aws::String buildEndpoint(Aws::Http::Scheme scheme, + const Aws::String& region, const Aws::String& domain, const Aws::String& endpoint); Aws::String m_endpoint; diff --git a/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp b/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp index 9576e9d9999..68c20ff87af 100644 --- a/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp +++ b/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp @@ -28,15 +28,20 @@ using Aws::Utils::Threading::ReaderLockGuard; static const char SSO_CREDENTIALS_PROVIDER_LOG_TAG[] = "SSOCredentialsProvider"; -SSOCredentialsProvider::SSOCredentialsProvider() : m_profileToUse(GetConfigProfileName()) +SSOCredentialsProvider::SSOCredentialsProvider() : SSOCredentialsProvider(GetConfigProfileName(), nullptr) { - AWS_LOGSTREAM_INFO(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Setting sso credentials provider to read config from " << m_profileToUse); } -SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile) : m_profileToUse(profile), - m_bearerTokenProvider(profile) +SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile) : SSOCredentialsProvider(profile, nullptr) { - AWS_LOGSTREAM_INFO(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Setting sso credentials provider to read config from " << m_profileToUse); +} + +SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile, const std::shared_ptr config) : + m_profileToUse(profile), + m_bearerTokenProvider(profile), + m_config(config) +{ + AWS_LOGSTREAM_INFO(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Setting sso credentials provider to read config from " << m_profileToUse); } AWSCredentials SSOCredentialsProvider::GetAWSCredentials() @@ -80,16 +85,20 @@ void SSOCredentialsProvider::Reload() request.m_ssoRoleName = profile.GetSsoRoleName(); request.m_accessToken = accessToken; - Aws::Client::ClientConfiguration config; - config.scheme = Aws::Http::Scheme::HTTPS; - config.region = m_ssoRegion; - AWS_LOGSTREAM_DEBUG(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Passing config to client for region: " << m_ssoRegion); + Aws::Client::ClientConfiguration defaultConfig; + if (!m_config) + { + defaultConfig.scheme = Aws::Http::Scheme::HTTPS; + defaultConfig.region = m_ssoRegion; + AWS_LOGSTREAM_DEBUG(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Passing config to client for region: " << m_ssoRegion); - Aws::Vector retryableErrors; - retryableErrors.push_back("TooManyRequestsException"); + Aws::Vector retryableErrors; + retryableErrors.push_back("TooManyRequestsException"); - config.retryStrategy = Aws::MakeShared(SSO_CREDENTIALS_PROVIDER_LOG_TAG, retryableErrors, 3/*maxRetries*/); - m_client = Aws::MakeUnique(SSO_CREDENTIALS_PROVIDER_LOG_TAG, config); + defaultConfig.retryStrategy = Aws::MakeShared(SSO_CREDENTIALS_PROVIDER_LOG_TAG, retryableErrors, 3/*maxRetries*/); + } + const Aws::Client::ClientConfiguration& config = m_config ? *m_config : defaultConfig; + m_client = Aws::MakeUnique(SSO_CREDENTIALS_PROVIDER_LOG_TAG, config, Aws::Http::Scheme::HTTPS, m_ssoRegion); AWS_LOGSTREAM_TRACE(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Requesting credentials with AWS_ACCESS_KEY: " << m_ssoAccountId); auto result = m_client->GetSSOCredentials(request); diff --git a/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp b/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp index b55131e340d..8c7c8b9c944 100644 --- a/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp +++ b/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp @@ -41,6 +41,14 @@ SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile) AWS_LOGSTREAM_INFO(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, "Setting sso bearerToken provider to read config from " << m_profileToUse); } +SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config) + : m_profileToUse(awsProfile), + m_lastUpdateAttempt((int64_t)0), + m_config(config) +{ + AWS_LOGSTREAM_INFO(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, "Setting sso bearerToken provider to read config from " << m_profileToUse); +} + AWSBearerToken SSOBearerTokenProvider::GetAWSBearerToken() { Aws::Utils::Threading::ReaderLockGuard guard(m_reloadLock); @@ -93,14 +101,20 @@ void SSOBearerTokenProvider::RefreshFromSso() if(!m_client) { - Aws::Client::ClientConfiguration config; - config.scheme = Aws::Http::Scheme::HTTPS; + auto scheme = Aws::Http::Scheme::HTTPS; /* The SSO token provider must not resolve if any SSO configuration values are present directly on the profile * instead of an `sso-session` section. The SSO token provider must ignore these configuration values if these * values are present directly on the profile instead of an `sso-session` section. */ // config.region = m_profile.GetSsoRegion(); // <- intentionally not used per comment above - config.region = cachedSsoToken.region; - m_client = Aws::MakeUnique(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, config); + auto& region = cachedSsoToken.region; + Aws::Client::ClientConfiguration defaultConfig; + if (!m_config) + { + defaultConfig.scheme = scheme; + defaultConfig.region = region; + } + const Aws::Client::ClientConfiguration& config = m_config ? *m_config : defaultConfig; + m_client = Aws::MakeUnique(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, config, scheme, cachedSsoToken.region); } Aws::Internal::SSOCredentialsClient::SSOCreateTokenRequest ssoCreateTokenRequest; diff --git a/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp b/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp index a559090e7a3..86e0c8687fc 100644 --- a/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp +++ b/src/aws-cpp-sdk-core/source/internal/AWSHttpResourceClient.cpp @@ -591,23 +591,29 @@ namespace Aws static const char SSO_RESOURCE_CLIENT_LOG_TAG[] = "SSOResourceClient"; SSOCredentialsClient::SSOCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration) + : SSOCredentialsClient(clientConfiguration, clientConfiguration.scheme, clientConfiguration.region) + { + } + + SSOCredentialsClient::SSOCredentialsClient(const Aws::Client::ClientConfiguration& clientConfiguration, Aws::Http::Scheme scheme, const Aws::String& region) : AWSHttpResourceClient(clientConfiguration, SSO_RESOURCE_CLIENT_LOG_TAG) { SetErrorMarshaller(Aws::MakeUnique(SSO_RESOURCE_CLIENT_LOG_TAG)); - m_endpoint = buildEndpoint(clientConfiguration, "portal.sso.", "federation/credentials"); - m_oidcEndpoint = buildEndpoint(clientConfiguration, "oidc.", "token"); + m_endpoint = buildEndpoint(scheme, region, "portal.sso.", "federation/credentials"); + m_oidcEndpoint = buildEndpoint(scheme, region, "oidc.", "token"); AWS_LOGSTREAM_INFO(SSO_RESOURCE_CLIENT_LOG_TAG, "Creating SSO ResourceClient with endpoint: " << m_endpoint); } Aws::String SSOCredentialsClient::buildEndpoint( - const Aws::Client::ClientConfiguration& clientConfiguration, + Aws::Http::Scheme scheme, + const Aws::String& region, const Aws::String& domain, const Aws::String& endpoint) { Aws::StringStream ss; - if (clientConfiguration.scheme == Aws::Http::Scheme::HTTP) + if (scheme == Aws::Http::Scheme::HTTP) { ss << "http://"; } @@ -618,10 +624,10 @@ namespace Aws static const int CN_NORTH_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTH_1); static const int CN_NORTHWEST_1_HASH = Aws::Utils::HashingUtils::HashString(Aws::Region::CN_NORTHWEST_1); - auto hash = Aws::Utils::HashingUtils::HashString(clientConfiguration.region.c_str()); + auto hash = Aws::Utils::HashingUtils::HashString(region.c_str()); - AWS_LOGSTREAM_DEBUG(SSO_RESOURCE_CLIENT_LOG_TAG, "Preparing SSO client for region: " << clientConfiguration.region); - ss << domain << clientConfiguration.region << ".amazonaws.com/" << endpoint; + AWS_LOGSTREAM_DEBUG(SSO_RESOURCE_CLIENT_LOG_TAG, "Preparing SSO client for region: " << region); + ss << domain << region << ".amazonaws.com/" << endpoint; if (hash == CN_NORTH_1_HASH || hash == CN_NORTHWEST_1_HASH) { ss << ".cn"; From 153fdffa03fb96c2dd55a440a8a22368081d3ea6 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 18 Sep 2024 00:12:11 +0300 Subject: [PATCH 2/3] Address PR feedback and clean-up. --- .../source/auth/SSOCredentialsProvider.cpp | 28 ++++++++----------- .../SSOBearerTokenProvider.cpp | 26 +++++------------ 2 files changed, 19 insertions(+), 35 deletions(-) diff --git a/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp b/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp index 68c20ff87af..052083e64bd 100644 --- a/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp +++ b/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp @@ -36,12 +36,21 @@ SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile) : SSO { } -SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile, const std::shared_ptr config) : +SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile, std::shared_ptr config) : m_profileToUse(profile), m_bearerTokenProvider(profile), - m_config(config) + m_config(std::move(config)) { AWS_LOGSTREAM_INFO(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Setting sso credentials provider to read config from " << m_profileToUse); + if (!m_config) + { + auto defaultConfig = Aws::MakeShared(SSO_CREDENTIALS_PROVIDER_LOG_TAG); + defaultConfig->scheme = Aws::Http::Scheme::HTTPS; + // We cannot set region to m_ssoRegion because it is not yet known at this point. But it's not obtained from the client config either way. + Aws::Vector retryableErrors{ "TooManyRequestsException" }; + defaultConfig->retryStrategy = Aws::MakeShared(SSO_CREDENTIALS_PROVIDER_LOG_TAG, std::move(retryableErrors), 3/*maxRetries*/); + m_config = std::move(defaultConfig); + } } AWSCredentials SSOCredentialsProvider::GetAWSCredentials() @@ -85,20 +94,7 @@ void SSOCredentialsProvider::Reload() request.m_ssoRoleName = profile.GetSsoRoleName(); request.m_accessToken = accessToken; - Aws::Client::ClientConfiguration defaultConfig; - if (!m_config) - { - defaultConfig.scheme = Aws::Http::Scheme::HTTPS; - defaultConfig.region = m_ssoRegion; - AWS_LOGSTREAM_DEBUG(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Passing config to client for region: " << m_ssoRegion); - - Aws::Vector retryableErrors; - retryableErrors.push_back("TooManyRequestsException"); - - defaultConfig.retryStrategy = Aws::MakeShared(SSO_CREDENTIALS_PROVIDER_LOG_TAG, retryableErrors, 3/*maxRetries*/); - } - const Aws::Client::ClientConfiguration& config = m_config ? *m_config : defaultConfig; - m_client = Aws::MakeUnique(SSO_CREDENTIALS_PROVIDER_LOG_TAG, config, Aws::Http::Scheme::HTTPS, m_ssoRegion); + m_client = Aws::MakeUnique(SSO_CREDENTIALS_PROVIDER_LOG_TAG, *m_config, Aws::Http::Scheme::HTTPS, m_ssoRegion); AWS_LOGSTREAM_TRACE(SSO_CREDENTIALS_PROVIDER_LOG_TAG, "Requesting credentials with AWS_ACCESS_KEY: " << m_ssoAccountId); auto result = m_client->GetSSOCredentials(request); diff --git a/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp b/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp index 0a628f28687..0050d3c92de 100644 --- a/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp +++ b/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp @@ -27,24 +27,18 @@ static const char SSO_GRANT_TYPE[] = "refresh_token"; const size_t SSOBearerTokenProvider::REFRESH_WINDOW_BEFORE_EXPIRATION_S = 600; const size_t SSOBearerTokenProvider::REFRESH_ATTEMPT_INTERVAL_S = 30; -SSOBearerTokenProvider::SSOBearerTokenProvider() - : m_profileToUse(Aws::Auth::GetConfigProfileName()), - m_lastUpdateAttempt((int64_t) 0) +SSOBearerTokenProvider::SSOBearerTokenProvider() : SSOBearerTokenProvider(Aws::Auth::GetConfigProfileName(), nullptr) { - AWS_LOGSTREAM_INFO(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, "Setting sso bearerToken provider to read config from " << m_profileToUse); } -SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile) - : m_profileToUse(awsProfile), - m_lastUpdateAttempt((int64_t) 0) +SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile) : SSOBearerTokenProvider(awsProfile, nullptr) { - AWS_LOGSTREAM_INFO(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, "Setting sso bearerToken provider to read config from " << m_profileToUse); } SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config) : m_profileToUse(awsProfile), - m_lastUpdateAttempt((int64_t)0), - m_config(config) + m_config(config ? std::move(config) : Aws::MakeShared(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG)), + m_lastUpdateAttempt((int64_t)0) { AWS_LOGSTREAM_INFO(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, "Setting sso bearerToken provider to read config from " << m_profileToUse); } @@ -105,16 +99,10 @@ void SSOBearerTokenProvider::RefreshFromSso() /* The SSO token provider must not resolve if any SSO configuration values are present directly on the profile * instead of an `sso-session` section. The SSO token provider must ignore these configuration values if these * values are present directly on the profile instead of an `sso-session` section. */ - // config.region = m_profile.GetSsoRegion(); // <- intentionally not used per comment above + // auto& region = m_profile.GetSsoRegion(); // <- intentionally not used per comment above auto& region = cachedSsoToken.region; - Aws::Client::ClientConfiguration defaultConfig; - if (!m_config) - { - defaultConfig.scheme = scheme; - defaultConfig.region = region; - } - const Aws::Client::ClientConfiguration& config = m_config ? *m_config : defaultConfig; - m_client = Aws::MakeUnique(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, config, scheme, cachedSsoToken.region); + // m_config->region might not be the same as the SSO region, but the former is not used by the SSO client. + m_client = Aws::MakeUnique(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG, *m_config, scheme, region); } Aws::Internal::SSOCredentialsClient::SSOCreateTokenRequest ssoCreateTokenRequest; From 27f6d0ec68eb90402356bb5aeef0444008b20e8e Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Wed, 18 Sep 2024 22:45:48 +0300 Subject: [PATCH 3/3] Fix MSVC CI. --- .../include/aws/core/auth/SSOCredentialsProvider.h | 4 ++-- .../core/auth/bearer-token-provider/SSOBearerTokenProvider.h | 4 ++-- src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp | 2 +- .../auth/bearer-token-provider/SSOBearerTokenProvider.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h b/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h index 7e3436d0dc6..2fb5eec70b6 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h +++ b/src/aws-cpp-sdk-core/include/aws/core/auth/SSOCredentialsProvider.h @@ -21,7 +21,7 @@ namespace Aws { public: SSOCredentialsProvider(); explicit SSOCredentialsProvider(const Aws::String& profile); - explicit SSOCredentialsProvider(const Aws::String& profile, std::shared_ptr config); + explicit SSOCredentialsProvider(const Aws::String& profile, std::shared_ptr config); /** * Retrieves the credentials if found, otherwise returns empty credential set. */ @@ -44,7 +44,7 @@ namespace Aws { // The SSO Token Provider Aws::Auth::SSOBearerTokenProvider m_bearerTokenProvider; // The client configuration to use - std::shared_ptr m_config; + std::shared_ptr m_config; void Reload() override; void RefreshIfExpired(); diff --git a/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h b/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h index 9f98f797450..e3cad6dee78 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h +++ b/src/aws-cpp-sdk-core/include/aws/core/auth/bearer-token-provider/SSOBearerTokenProvider.h @@ -24,7 +24,7 @@ namespace Aws public: SSOBearerTokenProvider(); explicit SSOBearerTokenProvider(const Aws::String& awsProfile); - explicit SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config); + explicit SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config); /** * Retrieves the bearerToken if found, otherwise returns empty credential set. */ @@ -49,7 +49,7 @@ namespace Aws // Profile description variables Aws::UniquePtr m_client; Aws::String m_profileToUse; - std::shared_ptr m_config; + std::shared_ptr m_config; mutable Aws::Auth::AWSBearerToken m_token; mutable Aws::Utils::DateTime m_lastUpdateAttempt; diff --git a/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp b/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp index 052083e64bd..60b4134c4c1 100644 --- a/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp +++ b/src/aws-cpp-sdk-core/source/auth/SSOCredentialsProvider.cpp @@ -36,7 +36,7 @@ SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile) : SSO { } -SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile, std::shared_ptr config) : +SSOCredentialsProvider::SSOCredentialsProvider(const Aws::String& profile, std::shared_ptr config) : m_profileToUse(profile), m_bearerTokenProvider(profile), m_config(std::move(config)) diff --git a/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp b/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp index 0050d3c92de..05c90dac566 100644 --- a/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp +++ b/src/aws-cpp-sdk-core/source/auth/bearer-token-provider/SSOBearerTokenProvider.cpp @@ -35,7 +35,7 @@ SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile) : { } -SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config) +SSOBearerTokenProvider::SSOBearerTokenProvider(const Aws::String& awsProfile, std::shared_ptr config) : m_profileToUse(awsProfile), m_config(config ? std::move(config) : Aws::MakeShared(SSO_BEARER_TOKEN_PROVIDER_LOG_TAG)), m_lastUpdateAttempt((int64_t)0)