Classes | Functions | Variables
Aws::Auth Namespace Reference

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 > &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. 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...
 

Function Documentation

static bool Aws::Auth::AppendHeader ( struct curl_slist **  headers,
const char *  name,
const char *  value 
)
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.

Parameters
headersPointer to curl list containing the current headers
nameThe name of the header to append
valueThe value of the header to append
Returns
True if the header was appended and headers was updated, otherwise false

Definition at line 104 of file service_credentials_provider.cpp.

template<typename T >
static bool Aws::Auth::GetConfigValue ( std::map< std::string, std::string > &  data,
const char *  name,
T &  result,
bool  optional 
)
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.

Parameters
dataThe std::map to search for a value
nameThe name of the field to find
resultInstance of Aws::String to store the result, if found
Returns
True if the value was successfully retrieved

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.

Returns
True if configuration was read and the struct was populated with information, otherwise false

Retrieves all available auth parameters from the ParameterReaderInterface and populates the ServiceAuthConfig struct with the data.

Parameters
configThe ServiceAuthConfig struct to store the config parameters
parametersThe ParamReaderInterface to retrieve the param values
Returns
True if a valid configuration was loaded into the ServiceAuthConfig object
See also
ServiceAuthConfig
ParameterReaderInterface

Definition at line 196 of file service_credentials_provider.cpp.

static bool Aws::Auth::IsIotConfigValid ( const IotRoleConfig config)
static

Validates an instance of an IotRoleConfig struct.

Parameters
configThe struct to validate
Returns
True if the struct is valid, meaning all the config needed to connect is there

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 bool Aws::Auth::ParseConfigVale ( std::string &  value,
Aws::String &  result 
)
static
static bool Aws::Auth::ParseConfigValue ( std::string &  value,
int32_t &  result 
)
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)

Parameters
valueThe configuration value to parse
resultThe variable to place the value into
Returns
True if the value was successfully parsed

Definition at line 151 of file service_credentials_provider.cpp.

static bool Aws::Auth::ParseConfigValue ( std::string &  value,
Aws::String &  result 
)
static

Helper to parse a configuration value into an Aws::String variable.

Parameters
valueThe configuration value to parse
resultThe variable to place the value into
Returns
True if the value was successfully parsed

Definition at line 137 of file service_credentials_provider.cpp.

template<typename T >
static bool Aws::Auth::SetCurlOpt ( CURL *  curl,
CURLoption  opt,
lvalue 
)
static

Helper to set a libcurl option or log an error if a problem occurred.

Parameters
curlHandle to the curl object to update
optThe curl option to set, see https://curl.haxx.se/libcurl/c/curl_easy_setopt.html for more information.
lvaluethe value of the option
Returns
True if the option was set successfully, otherwise false

Definition at line 82 of file service_credentials_provider.cpp.

Variable Documentation

const char Aws::Auth::CFG_CAFILE[] = "cafile"
static

Definition at line 37 of file service_credentials_provider.h.

const char Aws::Auth::CFG_CERTFILE[] = "certfile"
static

Definition at line 38 of file service_credentials_provider.h.

const char Aws::Auth::CFG_CONNECT_TIMEOUT_MS[] = "connect_timeout_ms"
static

Definition at line 43 of file service_credentials_provider.h.

const char Aws::Auth::CFG_ENDPOINT[] = "endpoint"
static

Definition at line 40 of file service_credentials_provider.h.

const char Aws::Auth::CFG_KEYFILE[] = "keyfile"
static

Definition at line 39 of file service_credentials_provider.h.

const char Aws::Auth::CFG_ROLE[] = "role"
static

Definition at line 41 of file service_credentials_provider.h.

const char Aws::Auth::CFG_THING_NAME[] = "thing_name"
static

Definition at line 42 of file service_credentials_provider.h.

const char Aws::Auth::CFG_TOTAL_TIMEOUT_MS[] = "total_timeout_ms"
static

Definition at line 44 of file service_credentials_provider.h.

const long Aws::Auth::DEFAULT_AUTH_CONNECT_TIMEOUT_MS = 5000
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.

const long Aws::Auth::DEFAULT_AUTH_TOTAL_TIMEOUT_MS = 10000
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.



aws_common
Author(s): AWS RoboMaker
autogenerated on Sat Mar 6 2021 03:11:38