AWS SDK for C++  1.9.1
AWS SDK for C++
STSProfileCredentialsProvider.h
Go to the documentation of this file.
1 
7 #pragma once
8 
11 
12 #include <functional>
13 #include <chrono>
14 
15 namespace Aws
16 {
17  namespace STS
18  {
19  class STSClient;
20  }
21 
22  namespace Auth
23  {
31  {
32  public:
38 
53  STSProfileCredentialsProvider(const Aws::String& profileName, std::chrono::minutes duration = std::chrono::minutes(60));
54 
55  STSProfileCredentialsProvider(const Aws::String& profileName, std::chrono::minutes duration, const std::function<Aws::STS::STSClient*(const AWSCredentials&)> &stsClientFactory);
56 
61 
62  protected:
64  void Reload() override;
69  AWSCredentials GetCredentialsFromSTS(const AWSCredentials& credentials, const Aws::String& roleARN);
70  private:
71  AWSCredentials GetCredentialsFromSTSInternal(const Aws::String& roleArn, Aws::STS::STSClient* client);
72 
73  Aws::String m_profileName;
74  AWSCredentials m_credentials;
75  const std::chrono::minutes m_duration;
76  const std::chrono::milliseconds m_reloadFrequency;
77  std::function<Aws::STS::STSClient*(const AWSCredentials&)> m_stsClientFactory;
78  };
79  }
80 }
AWS_IDENTITY_MANAGEMENT_API
#define AWS_IDENTITY_MANAGEMENT_API
Definition: IdentityManagment_EXPORTS.h:23
Aws::Auth::STSProfileCredentialsProvider::RefreshIfExpired
void RefreshIfExpired()
Aws::Auth::STSProfileCredentialsProvider::STSProfileCredentialsProvider
STSProfileCredentialsProvider(const Aws::String &profileName, std::chrono::minutes duration=std::chrono::minutes(60))
Aws::Auth::STSProfileCredentialsProvider::Reload
void Reload() override
Aws::Auth::STSProfileCredentialsProvider::STSProfileCredentialsProvider
STSProfileCredentialsProvider()
Aws::Auth::AWSCredentialsProvider
Definition: AWSCredentialsProvider.h:51
Aws::Auth::STSProfileCredentialsProvider
Definition: STSProfileCredentialsProvider.h:31
Aws::Auth::STSProfileCredentialsProvider::GetAWSCredentials
AWSCredentials GetAWSCredentials() override
Aws::Auth::AWSCredentials
Definition: AWSCredentials.h:19
Aws::Auth::STSProfileCredentialsProvider::GetCredentialsFromSTS
AWSCredentials GetCredentialsFromSTS(const AWSCredentials &credentials, const Aws::String &roleARN)
AWSCredentialsProvider.h
Aws
Definition: AccessManagementClient.h:15
Aws::String
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
Aws::STS::STSClient
Definition: STSClient.h:117
Aws::Auth::STSProfileCredentialsProvider::STSProfileCredentialsProvider
STSProfileCredentialsProvider(const Aws::String &profileName, std::chrono::minutes duration, const std::function< Aws::STS::STSClient *(const AWSCredentials &)> &stsClientFactory)
IdentityManagment_EXPORTS.h