From 03951d9436e24b86d6b278bb31817029c1dd0d9d Mon Sep 17 00:00:00 2001 From: Nikolai Ovchinnikov Date: Wed, 21 Oct 2026 16:52:04 +0200 Subject: [PATCH] refactor: allow custom locking in `GeneralHTTPCredentialsProvider` Make `ExpiresSoon`, `m_loadFrequencyMs` and `m_credentials` protected so that derived providers can replace the synchronization while reusing the SDK refresh implementation and cache. The order of data members is unchanged. Validation: ClickHouse builds against it, and the gtests of its derived provider pass. --- .../include/aws/core/auth/GeneralHTTPCredentialsProvider.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aws-cpp-sdk-core/include/aws/core/auth/GeneralHTTPCredentialsProvider.h b/src/aws-cpp-sdk-core/include/aws/core/auth/GeneralHTTPCredentialsProvider.h index 7744f5d9f185..d11095e7e29e 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/auth/GeneralHTTPCredentialsProvider.h +++ b/src/aws-cpp-sdk-core/include/aws/core/auth/GeneralHTTPCredentialsProvider.h @@ -100,9 +100,9 @@ namespace Aws protected: void Reload() override; + bool ExpiresSoon() const; private: - bool ExpiresSoon() const; void RefreshIfExpired(); Aws::String LoadTokenFromFile() const; @@ -110,6 +110,7 @@ namespace Aws std::shared_ptr m_ecsCredentialsClient; Aws::String m_authTokenFilePath; + protected: long m_loadFrequencyMs = REFRESH_THRESHOLD; Aws::Auth::AWSCredentials m_credentials; };