Classes | |
struct | IotRoleConfig |
Auth configuration needed to retrieve AWS credentials via the IoT service. More... | |
class | IotRoleCredentialsProvider |
AWSCredentialsProvider that obtains credentials using the AWS IoT Core service. More... | |
class | RequestContext |
Encapsulates the response from a curl request Curl uses a callback when performing a request for chunks of data. This class serves as a the request data, using an Aws::StringStream to accumulate data in memory. At any time, the GetValue() method can be used to return a Json::JsonValue respresentation of the currently buffered data. More... | |
struct | ServiceAuthConfig |
Auth configuration for ROS AWS service integration. More... | |
class | ServiceCredentialsProviderChain |
Credentials provider chain for ROS AWS service integrations. More... | |
Functions | |
static bool | AppendHeader (struct curl_slist **headers, const char *name, const char *value) |
Appends a name/value pair to a list of curl headers The libcurl API potentially returns new list pointer when a value is appended but also returns NULL as an error. This function tries to append the header value, and returns false if an error occurs and leaves the headers pointer untouched. More... | |
template<typename T > | |
static bool | GetConfigValue (std::map< std::string, std::string > &data, const char *name, T &result, bool optional) |
Helper to retrieve a specific config value from a map Simple helper to try to retrieve data from a map and log a message if it was not available. If no value is found, result is unchanged. More... | |
bool | GetServiceAuthConfig (ServiceAuthConfig &config, const std::shared_ptr< Aws::Client::ParameterReaderInterface > ¶meters) |
Retrieves service authorization data from a ParameterReaderInterface and populates the ServiceAuthConfig structure from the available parameters. If it was able to load configuration data and successfully populate the structure, the function will return true, otherwise false. More... | |
static bool | IsIotConfigValid (const IotRoleConfig &config) |
Validates an instance of an IotRoleConfig struct. More... | |
bool | operator== (const AWSCredentials &left, const AWSCredentials &right) |
static bool | ParseConfigVale (std::string &value, Aws::String &result) |
static bool | ParseConfigValue (std::string &value, int32_t &result) |
Helper to parse a configuration value into an Aws::String variable This function assumes that the value will be greater than zero, otherwise it will assume an error (since it's used for timeouts) More... | |
static bool | ParseConfigValue (std::string &value, Aws::String &result) |
Helper to parse a configuration value into an Aws::String variable. More... | |
template<typename T > | |
static bool | SetCurlOpt (CURL *curl, CURLoption opt, T lvalue) |
Helper to set a libcurl option or log an error if a problem occurred. More... | |
Variables | |
static const char | CFG_CAFILE [] = "cafile" |
static const char | CFG_CERTFILE [] = "certfile" |
static const char | CFG_CONNECT_TIMEOUT_MS [] = "connect_timeout_ms" |
static const char | CFG_ENDPOINT [] = "endpoint" |
static const char | CFG_KEYFILE [] = "keyfile" |
static const char | CFG_ROLE [] = "role" |
static const char | CFG_THING_NAME [] = "thing_name" |
static const char | CFG_TOTAL_TIMEOUT_MS [] = "total_timeout_ms" |
static const long | DEFAULT_AUTH_CONNECT_TIMEOUT_MS = 5000 |
Default number of milliseconds to wait before timing out when connecting to retrieve credentials from IoT. More... | |
static const long | DEFAULT_AUTH_TOTAL_TIMEOUT_MS = 10000 |
Default number of milliseconds to wait before timing out when retrieving credentials from IoT. More... | |
|
static |
Appends a name/value pair to a list of curl headers The libcurl API potentially returns new list pointer when a value is appended but also returns NULL as an error. This function tries to append the header value, and returns false if an error occurs and leaves the headers pointer untouched.
headers | Pointer to curl list containing the current headers |
name | The name of the header to append |
value | The value of the header to append |
Definition at line 104 of file service_credentials_provider.cpp.
|
static |
Helper to retrieve a specific config value from a map Simple helper to try to retrieve data from a map and log a message if it was not available. If no value is found, result is unchanged.
data | The std::map to search for a value |
name | The name of the field to find |
result | Instance of Aws::String to store the result, if found |
Definition at line 171 of file service_credentials_provider.cpp.
bool Aws::Auth::GetServiceAuthConfig | ( | ServiceAuthConfig & | config, |
const std::shared_ptr< Aws::Client::ParameterReaderInterface > & | parameters | ||
) |
Retrieves service authorization data from a ParameterReaderInterface and populates the ServiceAuthConfig structure from the available parameters. If it was able to load configuration data and successfully populate the structure, the function will return true, otherwise false.
Retrieves all available auth parameters from the ParameterReaderInterface and populates the ServiceAuthConfig struct with the data.
config | The ServiceAuthConfig struct to store the config parameters |
parameters | The ParamReaderInterface to retrieve the param values |
Definition at line 196 of file service_credentials_provider.cpp.
|
static |
Validates an instance of an IotRoleConfig struct.
config | The struct to validate |
Definition at line 124 of file service_credentials_provider.cpp.
bool Aws::Auth::operator== | ( | const AWSCredentials & | left, |
const AWSCredentials & | right | ||
) |
Definition at line 37 of file service_credentials_provider_test.cpp.
|
static |
|
static |
Helper to parse a configuration value into an Aws::String variable This function assumes that the value will be greater than zero, otherwise it will assume an error (since it's used for timeouts)
value | The configuration value to parse |
result | The variable to place the value into |
Definition at line 151 of file service_credentials_provider.cpp.
|
static |
Helper to parse a configuration value into an Aws::String variable.
value | The configuration value to parse |
result | The variable to place the value into |
Definition at line 137 of file service_credentials_provider.cpp.
|
static |
Helper to set a libcurl option or log an error if a problem occurred.
curl | Handle to the curl object to update |
opt | The curl option to set, see https://curl.haxx.se/libcurl/c/curl_easy_setopt.html for more information. |
lvalue | the value of the option |
Definition at line 82 of file service_credentials_provider.cpp.
|
static |
Definition at line 37 of file service_credentials_provider.h.
|
static |
Definition at line 38 of file service_credentials_provider.h.
|
static |
Definition at line 43 of file service_credentials_provider.h.
|
static |
Definition at line 40 of file service_credentials_provider.h.
|
static |
Definition at line 39 of file service_credentials_provider.h.
|
static |
Definition at line 41 of file service_credentials_provider.h.
|
static |
Definition at line 42 of file service_credentials_provider.h.
|
static |
Definition at line 44 of file service_credentials_provider.h.
|
static |
Default number of milliseconds to wait before timing out when connecting to retrieve credentials from IoT.
Definition at line 32 of file service_credentials_provider.h.
|
static |
Default number of milliseconds to wait before timing out when retrieving credentials from IoT.
Definition at line 35 of file service_credentials_provider.h.