Conversation
Adding CRTProfileCredentialsProvider for CRT-based profile credential
…ofile-credentials-provider
…ofile-credentials-provider
…le provider to the default chain
merge branch 'main' of https://github.com/aws/aws-sdk-cpp into crt-profile-credentials-provider
…ofile-credentials-provider
… to ProfileCredentialsProvider
…ofile-credentials-provider
…ider from the default chain, also enabling the ProcessCredentials on ProfileCredentialsProvider
| * refreshRateMs as the frequency at which the file is reparsed in milliseconds. Defaults to 5 minutes. | ||
| */ | ||
| ProfileCredentialsProvider(const char* profile, long refreshRateMs = REFRESH_THRESHOLD); | ||
| ProfileCredentialsProvider(const char* profile); |
There was a problem hiding this comment.
cant remove this from the public facing interface -- thats a breakign change, it just wont be passed down the impl
| */ | ||
| static Aws::String GetProfileDirectory(); | ||
|
|
||
| protected: |
There was a problem hiding this comment.
cant remove this from the interface thats a breaking change, you can have it but it must do nothing
| ReaderLockGuard guard(m_reloadLock); | ||
| if (!IsTimeToRefresh(m_loadFrequencyMs)) { | ||
| return; | ||
| class ProfileCredentialsProvider::ProfileCredentialsProviderImp : public CrtCredentialsProvider { |
There was a problem hiding this comment.
public CrtCredentialsProvider
chefs kiss
| :CrtCredentialsProvider( | ||
| [profile]()-> std::shared_ptr<ICredentialsProvider> { | ||
| CredentialsProviderProfileConfig config; | ||
| if (profile && profile[0] !='\0') { |
There was a problem hiding this comment.
do we need this validation?
| CredentialsProviderProfileConfig config; | ||
| return CredentialsProvider::CreateCredentialsProviderProfile(config); | ||
| }, | ||
| std::chrono::milliseconds(5000), |
44b26f3 to
1be720c
Compare
…/aws/aws-sdk-cpp into crt-profile-credentials-provider
1be720c to
a85bead
Compare
sbiscigl
left a comment
There was a problem hiding this comment.
2 nit comments and one rant, looks really good!
| #pragma once | ||
|
|
||
| #include <aws/core/Core_EXPORTS.h> | ||
| #include <aws/core/utils/memory/stl/AWSString.h> |
There was a problem hiding this comment.
nit: no actual change in file so lets from it from the PR
| ProfileCredentialsProvider::ProfileCredentialsProvider(long refreshRateMs) | ||
| : m_impl(std::make_shared<ProfileCredentialsProviderImp>(refreshRateMs)) {} | ||
| ProfileCredentialsProvider::ProfileCredentialsProvider(long refreshRateMs) : m_impl(std::make_shared<ProfileCredentialsProviderImp>()) { | ||
| (void)refreshRateMs; |
There was a problem hiding this comment.
nit use the macro AWS_UNREFERENCED_PARAM instead of void cast because its more accurate
| protected: | ||
| DefaultCredentialsProviderChainIntegrationTest() | ||
| { | ||
| m_options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Debug; |
There was a problem hiding this comment.
we really aught to make this a official construct, i write this code at least times a week. not here for this PR, but something we should about. might help people use the SDK correctly better
202cd92 to
6e326d4
Compare
6e326d4 to
10024fa
Compare
…ofile-credentials-provider
…/aws/aws-sdk-cpp into crt-profile-credentials-provider
Implementing the CRT's profile provider and removing the process provider from the default chain, also enabling the ProcessCredentials on ProfileCredentialsProvider
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.