AWSCredentialsProvider that obtains credentials using the AWS IoT Core service.
More...
#include <service_credentials_provider.h>
AWSCredentialsProvider that obtains credentials using the AWS IoT Core service.
Implements the Aws::Auth::AWSCredentialsProvider interface to retrieve credentials from the AWS IoT Core service. In order to be able to retrieve credentials, the provider makes an HTTP request to the iot:CredentialProvider endpoint. Please refer to https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html for more information.
Definition at line 129 of file service_credentials_provider.h.
Aws::Auth::IotRoleCredentialsProvider::IotRoleCredentialsProvider |
( |
const IotRoleConfig & |
config | ) |
|
Aws::Auth::IotRoleCredentialsProvider::~IotRoleCredentialsProvider |
( |
| ) |
|
|
overridedefault |
AWSCredentials Aws::Auth::IotRoleCredentialsProvider::GetAWSCredentials |
( |
| ) |
|
|
override |
bool Aws::Auth::IotRoleCredentialsProvider::IsTimeExpired |
( |
| ) |
|
|
protected |
Returns true if the credentials have expired.
Simple helper to check against the system clock if the epoch time has past.
- Returns
- True if the expiration time has passed
Definition at line 340 of file service_credentials_provider.cpp.
void Aws::Auth::IotRoleCredentialsProvider::Refresh |
( |
| ) |
|
|
protected |
Refreshes the cached AWS credentials.
Refreshes the cached credentials for the provider. The function uses curl to make an HTTP request from the IoT credentials provider endpoint, using client authentication via the cert/key pair. This function acquires the mutex in order to make sure only a single request is outstanding at any given time.
If the timer has not expired, this function will not update the cached creds.
Definition at line 412 of file service_credentials_provider.cpp.
void Aws::Auth::IotRoleCredentialsProvider::SetCredentials |
( |
AWSCredentials & |
creds_obj | ) |
|
|
protected |
bool Aws::Auth::IotRoleCredentialsProvider::ValidateResponse |
( |
Aws::Utils::Json::JsonValue & |
value | ) |
|
|
protected |
Validates the json response from the AWS IoT service.
Validates a JsonValue response from an IoT credentials endpoint. Ensuring that it contains a full set of credentials and logs any problems encountered.
- Returns
- True if the credentials are ok, otherwise false
Definition at line 356 of file service_credentials_provider.cpp.
Aws::Auth::AWSCredentials Aws::Auth::IotRoleCredentialsProvider::cached_ |
|
protected |
std::mutex Aws::Auth::IotRoleCredentialsProvider::creds_mutex_ |
|
private |
std::atomic<double> Aws::Auth::IotRoleCredentialsProvider::expiry_ |
|
private |
The documentation for this class was generated from the following files: