Amazon Kinesis Producer C SDK
Include.h
Go to the documentation of this file.
1 
4 #ifndef __KINESIS_VIDEO_COMMON_INCLUDE__
5 #define __KINESIS_VIDEO_COMMON_INCLUDE__
6 
7 #pragma once
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
14 // Public headers
16 #include <com/amazonaws/kinesis/video/client/Include.h>
17 #ifndef JSMN_HEADER
18 #define JSMN_HEADER
19 #endif
20 #include <com/amazonaws/kinesis/video/common/jsmn.h>
21 
25 
33 #define STATUS_COMMON_PRODUCER_BASE 0x15000000
34 #define STATUS_INVALID_AWS_CREDENTIALS_VERSION STATUS_COMMON_PRODUCER_BASE + 0x00000008
35 #define STATUS_MAX_REQUEST_HEADER_COUNT STATUS_COMMON_PRODUCER_BASE + 0x00000009
36 #define STATUS_MAX_REQUEST_HEADER_NAME_LEN STATUS_COMMON_PRODUCER_BASE + 0x0000000a
37 #define STATUS_MAX_REQUEST_HEADER_VALUE_LEN STATUS_COMMON_PRODUCER_BASE + 0x0000000b
38 #define STATUS_INVALID_API_CALL_RETURN_JSON STATUS_COMMON_PRODUCER_BASE + 0x0000000c
39 #define STATUS_CURL_INIT_FAILED STATUS_COMMON_PRODUCER_BASE + 0x0000000d
40 #define STATUS_CURL_LIBRARY_INIT_FAILED STATUS_COMMON_PRODUCER_BASE + 0x0000000e
41 #define STATUS_HMAC_GENERATION_ERROR STATUS_COMMON_PRODUCER_BASE + 0x00000010
42 #define STATUS_IOT_FAILED STATUS_COMMON_PRODUCER_BASE + 0x00000011
43 #define STATUS_MAX_ROLE_ALIAS_LEN_EXCEEDED STATUS_COMMON_PRODUCER_BASE + 0x00000012
44 #define STATUS_INVALID_USER_AGENT_LENGTH STATUS_COMMON_PRODUCER_BASE + 0x00000015
45 #define STATUS_IOT_EXPIRATION_OCCURS_IN_PAST STATUS_COMMON_PRODUCER_BASE + 0x00000017
46 #define STATUS_IOT_EXPIRATION_PARSING_FAILED STATUS_COMMON_PRODUCER_BASE + 0x00000018
47 #define STATUS_MAX_IOT_THING_NAME_LENGTH STATUS_COMMON_PRODUCER_BASE + 0x0000001e
48 #define STATUS_IOT_CREATE_LWS_CONTEXT_FAILED STATUS_COMMON_PRODUCER_BASE + 0x0000001f
49 #define STATUS_INVALID_CA_CERT_PATH STATUS_COMMON_PRODUCER_BASE + 0x00000020
50 #define STATUS_FILE_CREDENTIAL_PROVIDER_OPEN_FILE_FAILED STATUS_COMMON_PRODUCER_BASE + 0x00000022
51 #define STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_LENGTH STATUS_COMMON_PRODUCER_BASE + 0x00000023
52 #define STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_FORMAT STATUS_COMMON_PRODUCER_BASE + 0x00000024
60 
68 #define STATUS_COMMON_BASE 0x16000000
69 #define STATUS_CURL_PERFORM_FAILED STATUS_COMMON_BASE + 0x00000001
70 #define STATUS_IOT_INVALID_RESPONSE_LENGTH STATUS_COMMON_BASE + 0x00000002
71 #define STATUS_IOT_NULL_AWS_CREDS STATUS_COMMON_BASE + 0x00000003
72 #define STATUS_IOT_INVALID_URI_LEN STATUS_COMMON_BASE + 0x00000004
73 #define STATUS_TIMESTAMP_STRING_UNRECOGNIZED_FORMAT STATUS_COMMON_BASE + 0x00000005
79 #define IS_RETRIABLE_COMMON_LIB_ERROR(error) \
80  ((error) == STATUS_INVALID_API_CALL_RETURN_JSON || (error) == STATUS_CURL_INIT_FAILED || (error) == STATUS_CURL_LIBRARY_INIT_FAILED || \
81  (error) == STATUS_HMAC_GENERATION_ERROR || (error) == STATUS_CURL_PERFORM_FAILED || (error) == STATUS_IOT_INVALID_RESPONSE_LENGTH || \
82  (error) == STATUS_IOT_NULL_AWS_CREDS || (error) == STATUS_IOT_INVALID_URI_LEN || (error) == STATUS_IOT_EXPIRATION_OCCURS_IN_PAST || \
83  (error) == STATUS_IOT_EXPIRATION_PARSING_FAILED || (error) == STATUS_IOT_CREATE_LWS_CONTEXT_FAILED || \
84  (error) == STATUS_FILE_CREDENTIAL_PROVIDER_OPEN_FILE_FAILED || (error) == STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_LENGTH || \
85  (error) == STATUS_FILE_CREDENTIAL_PROVIDER_INVALID_FILE_FORMAT)
86 
90 
99 #define MAX_REGION_NAME_LEN 128
100 
104 #define MAX_USER_AGENT_LEN 256
105 
109 #define MAX_CUSTOM_USER_AGENT_LEN 128
110 
114 #define MAX_CUSTOM_USER_AGENT_NAME_POSTFIX_LEN 32
115 
119 #define MAX_ACCESS_KEY_LEN 128
120 
124 #define MAX_SECRET_KEY_LEN 128
125 
129 #define MAX_SESSION_TOKEN_LEN 2048
130 
134 #define MAX_EXPIRATION_LEN 128
135 
139 #define MAX_ROLE_ALIAS_LEN 128
140 
144 #define MAX_IOT_THING_NAME_LEN 128
145 
149 #define MAX_REQUEST_HEADER_NAME_LEN 128
150 
154 #define MAX_REQUEST_HEADER_VALUE_LEN 2048
155 
159 #define MAX_REQUEST_HEADER_STRING_LEN (MAX_REQUEST_HEADER_NAME_LEN + MAX_REQUEST_HEADER_VALUE_LEN + 3)
160 
164 #define MAX_CREDENTIAL_FILE_LEN MAX_AUTH_LEN
165 
169 #define CALL_INFO_ERROR_BUFFER_LEN 256
170 
174 #define MAX_JSON_PARAMETER_STRING_LEN (10 * 1024)
180 #define DEFAULT_VIDEO_TRACK_ID 1
181 
185 #define DEFAULT_AUDIO_TRACK_ID 2
186 
190 #define DEFAULT_AUDIO_ONLY_TRACK_ID 1
191 
195 #define DEFAULT_ENDPOINT_CACHE_UPDATE_PERIOD (40 * HUNDREDS_OF_NANOS_IN_A_MINUTE)
196 
200 #define ENDPOINT_UPDATE_PERIOD_SENTINEL_VALUE 0
201 
205 #define MAX_ENDPOINT_CACHE_UPDATE_PERIOD (24 * HUNDREDS_OF_NANOS_IN_AN_HOUR)
206 
210 
219 #define ACCESS_KEY_ENV_VAR ((PCHAR) "AWS_ACCESS_KEY_ID")
220 
224 #define SECRET_KEY_ENV_VAR ((PCHAR) "AWS_SECRET_ACCESS_KEY")
225 
229 #define SESSION_TOKEN_ENV_VAR ((PCHAR) "AWS_SESSION_TOKEN")
230 
234 #define DEFAULT_REGION_ENV_VAR ((PCHAR) "AWS_DEFAULT_REGION")
235 
240 #define CACERT_PATH_ENV_VAR ((PCHAR) "AWS_KVS_CACERT_PATH")
241 
245 #define DEBUG_LOG_LEVEL_ENV_VAR ((PCHAR) "AWS_KVS_LOG_LEVEL")
246 
251 #define ENABLE_FILE_LOGGING ((PCHAR) "AWS_ENABLE_FILE_LOGGING")
254 #ifdef CMAKE_DETECTED_CACERT_PATH
255 #define DEFAULT_KVS_CACERT_PATH KVS_CA_CERT_PATH
256 #else
257 #define DEFAULT_KVS_CACERT_PATH EMPTY_STRING
258 #endif
259 
263 
272 #define HTTPS_SCHEME_NAME "https"
273 
277 #define WSS_SCHEME_NAME "wss"
278 
282 #define HTTP_REQUEST_VERB_GET_STRING (PCHAR) "GET"
286 #define HTTP_REQUEST_VERB_PUT_STRING (PCHAR) "PUT"
290 #define HTTP_REQUEST_VERB_POST_STRING (PCHAR) "POST"
291 
295 #define SCHEMA_DELIMITER_STRING (PCHAR) "://"
296 
300 #define DEFAULT_CANONICAL_URI_STRING (PCHAR) "/"
301 
305 #define DEFAULT_AWS_REGION "us-west-2"
306 
310 #define CONTROL_PLANE_URI_PREFIX "https://"
311 
315 #define KINESIS_VIDEO_SERVICE_NAME "kinesisvideo"
316 
317 #define AWS_KVS_FIPS_ENDPOINT_POSTFIX "-fips"
318 
322 #define CONTROL_PLANE_URI_POSTFIX ".amazonaws.com"
323 
324 #define CONTROL_PLANE_URI_POSTFIX_CN ".amazonaws.com.cn"
325 
326 #define CONTROL_PLANE_URI_POSTFIX_ISO ".c2s.ic.gov"
327 
328 #define CONTROL_PLANE_URI_POSTFIX_ISO_B ".sc2s.sgov.gov"
329 
330 #define AWS_ISO_B_REGION_PREFIX "us-isob-"
331 
332 #define AWS_ISO_REGION_PREFIX "us-iso-"
333 
334 #define AWS_GOV_CLOUD_REGION_PREFIX "us-gov-"
335 
336 #define AWS_CN_REGION_PREFIX "cn-"
337 
341 #define DEFAULT_USER_AGENT_NAME "AWS-SDK-KVS"
342 
346 #define TAG_PARAM_JSON_TEMPLATE "\n\t\t\"%s\": \"%s\","
347 
351 #define REQUEST_HEADER_DELIMITER ((PCHAR) ": ")
352 
356 #define KVS_REQUEST_ID_HEADER_NAME "x-amzn-RequestId"
362 
368 // Max header count
369 #define MAX_REQUEST_HEADER_COUNT 200
370 
371 // Max delimiter characters when packing headers into a string for printout
372 #define MAX_REQUEST_HEADER_OUTPUT_DELIMITER 5
373 
374 // HTTP status OK
375 #define HTTP_STATUS_CODE_OK 200
376 
377 // HTTP status Request timed out
378 #define HTTP_STATUS_CODE_REQUEST_TIMEOUT 408
379 
383 #define MAX_JSON_TOKEN_COUNT 100
384 
388 #define DEFAULT_LOW_SPEED_LIMIT 30
389 
393 #define DEFAULT_LOW_SPEED_TIME_LIMIT (30 * HUNDREDS_OF_NANOS_IN_A_SECOND)
394 
395 #define REQUEST_HEADER_DELIMITER_SIZE (2 * SIZEOF(CHAR))
401 
410 #define AWS_CREDENTIALS_CURRENT_VERSION 0
411 
415 #define DEFAULT_SSL_PORT_NUMBER 443
416 
420 #define DEFAULT_NON_SSL_PORT_NUMBER 8080
426 
434 typedef enum {
439 
443 typedef enum {
454 
463 typedef struct __AwsCredentials AwsCredentials;
465  UINT32 version;
466  UINT32 size;
467  PCHAR accessKeyId;
468  UINT32 accessKeyIdLen;
469  PCHAR secretKey;
470  UINT32 secretKeyLen;
471  PCHAR sessionToken;
473  UINT64 expiration;
475 };
477 
481 typedef struct __RequestHeader RequestHeader;
483  PCHAR pName;
484  UINT32 nameLen;
485  PCHAR pValue;
486  UINT32 valueLen;
487 };
489 
493 typedef struct __RequestInfo RequestInfo;
495  volatile ATOMIC_BOOL terminating;
497  PCHAR body;
500  UINT32 bodySize;
501  CHAR url[MAX_URI_CHAR_LEN + 1];
502  CHAR certPath[MAX_PATH_LEN + 1];
503  CHAR sslCertPath[MAX_PATH_LEN + 1];
504  CHAR sslPrivateKeyPath[MAX_PATH_LEN + 1];
507  UINT64 currentTime;
510  UINT64 callAfter;
511  UINT64 lowSpeedLimit;
514  PSingleList pRequestHeaders;
515 };
516 typedef struct __RequestInfo* PRequestInfo;
517 
521 typedef struct __CallInfo CallInfo;
522 struct __CallInfo {
524  UINT32 httpStatus;
525  SERVICE_CALL_RESULT callResult;
527  PStackQueue pResponseHeaders;
529  PCHAR responseData;
531 };
532 typedef struct __CallInfo* PCallInfo;
533 
538 
553 };
559 
578 PUBLIC_API STATUS createAwsCredentials(PCHAR, UINT32, PCHAR, UINT32, PCHAR, UINT32, UINT64, PAwsCredentials*);
579 
587 PUBLIC_API STATUS freeAwsCredentials(PAwsCredentials*);
588 
597 PUBLIC_API STATUS deserializeAwsCredentials(PBYTE);
598 
613 PUBLIC_API STATUS createStaticCredentialProvider(PCHAR, UINT32, PCHAR, UINT32, PCHAR, UINT32, UINT64, PAwsCredentialProvider*);
614 
623 
637 PUBLIC_API STATUS createCurlIotCredentialProvider(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PAwsCredentialProvider*);
638 
652 PUBLIC_API STATUS createLwsIotCredentialProvider(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PAwsCredentialProvider*);
653 
671 PUBLIC_API STATUS createCurlIotCredentialProviderWithTimeAndTimeout(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, UINT64, UINT64, GetCurrentTimeFunc,
672  UINT64, PAwsCredentialProvider*);
673 
689 PUBLIC_API STATUS createCurlIotCredentialProviderWithTime(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, GetCurrentTimeFunc, UINT64,
691 
707 PUBLIC_API STATUS createLwsIotCredentialProviderWithTime(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, GetCurrentTimeFunc, UINT64,
709 
718 
727 PUBLIC_API STATUS createFileCredentialProvider(PCHAR, PAwsCredentialProvider*);
728 
739 PUBLIC_API STATUS createFileCredentialProviderWithTime(PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider*);
740 
749 
770 PUBLIC_API STATUS createRequestInfo(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, SSL_CERTIFICATE_TYPE, PCHAR, UINT64, UINT64, UINT64, UINT64,
772 
780 PUBLIC_API STATUS freeRequestInfo(PRequestInfo*);
781 
789 PUBLIC_API STATUS signAwsRequestInfo(PRequestInfo);
790 
798 PUBLIC_API STATUS signAwsRequestInfoQueryParam(PRequestInfo);
799 
809 PUBLIC_API STATUS getRequestHost(PCHAR, PCHAR*, PCHAR*);
810 
821 PUBLIC_API BOOL compareJsonString(PCHAR, jsmntok_t*, jsmntype_t, PCHAR);
822 
832 PUBLIC_API STATUS convertTimestampToEpoch(PCHAR, UINT64, PUINT64);
833 
844 PUBLIC_API STATUS getUserAgentString(PCHAR, PCHAR, UINT32, PCHAR);
845 
854 PUBLIC_API STATUS requestRequiresSecureConnection(PCHAR, PBOOL);
855 
867 PUBLIC_API STATUS setRequestHeader(PRequestInfo, PCHAR, UINT32, PCHAR, UINT32);
868 
877 PUBLIC_API STATUS removeRequestHeader(PRequestInfo, PCHAR);
878 
886 PUBLIC_API STATUS removeRequestHeaders(PRequestInfo);
887 
899 PUBLIC_API STATUS createRequestHeader(PCHAR, UINT32, PCHAR, UINT32, PRequestHeader*);
900 
908 PUBLIC_API SERVICE_CALL_RESULT getServiceCallResultFromHttpStatus(UINT32);
909 
917 PUBLIC_API STATUS releaseCallInfo(PCallInfo);
918 
931 PUBLIC_API STATUS createFileLogger(UINT64, UINT64, PCHAR, BOOL, BOOL, logPrintFunc*);
932 
939 PUBLIC_API STATUS freeFileLogger();
945 #define SET_FILE_LOGGER() \
946  createFileLogger(FILE_LOGGER_STRING_BUFFER_SIZE, FILE_LOGGER_LOG_FILE_COUNT, (PCHAR) FILE_LOGGER_LOG_FILE_DIRECTORY_PATH, TRUE, TRUE, NULL)
947 #define RESET_FILE_LOGGER() freeFileLogger()
948 
954 PUBLIC_API STATUS initializeSslCallbacks();
955 
961 PUBLIC_API STATUS releaseSslCallbacks();
962 
963 #ifdef __cplusplus
964 }
965 #endif
966 #endif /* __KINESIS_VIDEO_COMMON_INCLUDE__ */
PUBLIC_API STATUS releaseSslCallbacks()
Definition: SslInit.c:148
PUBLIC_API STATUS initializeSslCallbacks()
Definition: SslInit.c:143
STATUS(* GetCredentialsFunc)(PAwsCredentialProvider, PAwsCredentials *)
Function returning AWS credentials.
Definition: Include.h:547
#define CALL_INFO_ERROR_BUFFER_LEN
Definition: Include.h:169
#define MAX_REGION_NAME_LEN
Definition: Include.h:99
SSL_CERTIFICATE_TYPE
Request SSL certificate type Not specified, "DER", "PEM", "ENG".
Definition: Include.h:443
HTTP_REQUEST_VERB
Types of verbs.
Definition: Include.h:434
@ SSL_CERTIFICATE_TYPE_NOT_SPECIFIED
Default enum when type of certificate is not specified.
Definition: Include.h:444
@ SSL_CERTIFICATE_TYPE_PEM
Use PEM type of SSL certificate if certificate to use is *.pem.
Definition: Include.h:446
@ SSL_CERTIFICATE_TYPE_DER
Use DER type of SSL certificate if certificate to use is *.der.
Definition: Include.h:445
@ SSL_CERTIFICATE_TYPE_ENG
Use ENG type of SSL certificate if certificate to use is *.eng.
Definition: Include.h:447
@ HTTP_REQUEST_VERB_GET
Indicates GET type of HTTP request.
Definition: Include.h:435
@ HTTP_REQUEST_VERB_POST
Indicates POST type of HTTP request.
Definition: Include.h:436
@ HTTP_REQUEST_VERB_PUT
Indicates PUT type of HTTP request.
Definition: Include.h:437
PUBLIC_API SERVICE_CALL_RESULT getServiceCallResultFromHttpStatus(UINT32)
Convenience method to convert HTTP statuses to SERVICE_CALL_RESULT status.
Definition: RequestInfo.c:288
PUBLIC_API STATUS createFileCredentialProvider(PCHAR, PAwsCredentialProvider *)
Creates a File based AWS credential provider object.
Definition: FileCredentialProvider.c:7
PUBLIC_API STATUS signAwsRequestInfoQueryParam(PRequestInfo)
Signs a request by appending SigV4 query param.
Definition: AwsV4Signer.c:159
PUBLIC_API STATUS getUserAgentString(PCHAR, PCHAR, UINT32, PCHAR)
Creates a user agent string.
Definition: Version.c:7
PUBLIC_API STATUS freeIotCredentialProvider(PAwsCredentialProvider *)
Frees an IoT based Aws credential provider object.
Definition: IotCredentialProvider.c:83
PUBLIC_API STATUS requestRequiresSecureConnection(PCHAR, PBOOL)
Checks whether the request URL requires a secure connection.
Definition: RequestInfo.c:111
PUBLIC_API STATUS createRequestHeader(PCHAR, UINT32, PCHAR, UINT32, PRequestHeader *)
Creates a request header.
Definition: RequestInfo.c:124
PUBLIC_API STATUS freeAwsCredentials(PAwsCredentials *)
Frees an Aws credentials object.
Definition: Auth.c:131
PUBLIC_API STATUS createLwsIotCredentialProvider(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PAwsCredentialProvider *)
Creates an IoT based AWS credential provider object using libWebSockets.
Definition: LwsIotCredentialProvider.c:7
PUBLIC_API STATUS createCurlIotCredentialProviderWithTime(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
Creates an IoT based AWS credential provider object with time function which is based on libCurl.
Definition: CurlIotCredentialProvider.c:14
PUBLIC_API STATUS createFileLogger(UINT64, UINT64, PCHAR, BOOL, BOOL, logPrintFunc *)
Creates a file based logger object and installs the global logger callback function.
PUBLIC_API STATUS setRequestHeader(PRequestInfo, PCHAR, UINT32, PCHAR, UINT32)
Sets a header in the request info.
Definition: RequestInfo.c:180
PUBLIC_API STATUS freeRequestInfo(PRequestInfo *)
Frees a Request Info object.
Definition: RequestInfo.c:80
PUBLIC_API STATUS createRequestInfo(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, SSL_CERTIFICATE_TYPE, PCHAR, UINT64, UINT64, UINT64, UINT64, PAwsCredentials, PRequestInfo *)
Creates a Request Info object.
Definition: RequestInfo.c:4
PUBLIC_API STATUS createStaticCredentialProvider(PCHAR, UINT32, PCHAR, UINT32, PCHAR, UINT32, UINT64, PAwsCredentialProvider *)
Creates a Static AWS credential provider object.
Definition: StaticCredentialProvider.c:7
PUBLIC_API STATUS removeRequestHeaders(PRequestInfo)
Removes and deletes all headers.
Definition: RequestInfo.c:263
PUBLIC_API STATUS getRequestHost(PCHAR, PCHAR *, PCHAR *)
Gets a request host string.
Definition: AwsV4Signer.c:731
PUBLIC_API STATUS createFileCredentialProviderWithTime(PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
Creates a File based AWS credential provider object.
Definition: FileCredentialProvider.c:12
PUBLIC_API STATUS createAwsCredentials(PCHAR, UINT32, PCHAR, UINT32, PCHAR, UINT32, UINT64, PAwsCredentials *)
Creates an AWS credentials object.
Definition: Auth.c:10
PUBLIC_API STATUS freeStaticCredentialProvider(PAwsCredentialProvider *)
Frees a Static Aws credential provider object.
Definition: StaticCredentialProvider.c:43
PUBLIC_API STATUS releaseCallInfo(PCallInfo)
Releases the CallInfo allocations.
Definition: RequestInfo.c:309
PUBLIC_API STATUS createCurlIotCredentialProvider(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PAwsCredentialProvider *)
Creates an IoT based AWS credential provider object using libCurl.
Definition: CurlIotCredentialProvider.c:7
PUBLIC_API STATUS signAwsRequestInfo(PRequestInfo)
Signs a request by appending SigV4 headers.
Definition: AwsV4Signer.c:109
PUBLIC_API STATUS removeRequestHeader(PRequestInfo, PCHAR)
Removes a header from the headers list if exists.
Definition: RequestInfo.c:231
PUBLIC_API STATUS freeFileLogger()
Frees the static file logger object and resets the global logging function if it was previously set b...
PUBLIC_API STATUS createCurlIotCredentialProviderWithTimeAndTimeout(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, UINT64, UINT64, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
Creates an IoT based AWS credential provider object with time function which is based on libCurl.
Definition: CurlIotCredentialProvider.c:23
PUBLIC_API STATUS convertTimestampToEpoch(PCHAR, UINT64, PUINT64)
Converts the timestamp string to time.
Definition: Util.c:8
PUBLIC_API STATUS freeFileCredentialProvider(PAwsCredentialProvider *)
Frees a File based Aws credential provider object.
Definition: FileCredentialProvider.c:54
PUBLIC_API STATUS createLwsIotCredentialProviderWithTime(PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, PCHAR, GetCurrentTimeFunc, UINT64, PAwsCredentialProvider *)
Creates an IoT based AWS credential provider object with time function which is based on libWebSocket...
Definition: LwsIotCredentialProvider.c:14
PUBLIC_API BOOL compareJsonString(PCHAR, jsmntok_t *, jsmntype_t, PCHAR)
Compares JSON strings taking into account the type.
Definition: Util.c:65
PUBLIC_API STATUS deserializeAwsCredentials(PBYTE)
Definition: Auth.c:109
struct __RequestInfo * PRequestInfo
Definition: Include.h:516
struct __RequestHeader * PRequestHeader
Definition: Include.h:488
struct __AwsCredentials * PAwsCredentials
Definition: Include.h:476
struct __AwsCredentialProvider * PAwsCredentialProvider
Abstract base for the credential provider.
Definition: Include.h:537
struct __CallInfo * PCallInfo
Definition: Include.h:532
Definition: Include.h:551
GetCredentialsFunc getCredentialsFn
Get credentials function which will be overwritten by different implementations.
Definition: Include.h:552
Definition: Include.h:464
UINT32 version
Version of structure.
Definition: Include.h:465
UINT32 size
Size of the entire structure in bytes including the struct itself.
Definition: Include.h:466
UINT64 expiration
The rest of the data might follow the structure.
Definition: Include.h:473
UINT32 sessionTokenLen
Length of the session token - not including NULL terminator.
Definition: Include.h:472
PCHAR sessionToken
Session token - NULL terminated.
Definition: Include.h:471
PCHAR secretKey
Secret Key - NULL terminated.
Definition: Include.h:469
UINT32 accessKeyIdLen
Length of the access key id - not including NULL terminator.
Definition: Include.h:468
PCHAR accessKeyId
Access Key ID - NULL terminated.
Definition: Include.h:467
UINT32 secretKeyLen
Length of the secret key - not including NULL terminator.
Definition: Include.h:470
Definition: Include.h:522
PStackQueue pResponseHeaders
Response Headers list.
Definition: Include.h:527
SERVICE_CALL_RESULT callResult
Execution result.
Definition: Include.h:525
UINT32 responseDataLen
Response data size.
Definition: Include.h:530
PRequestHeader pRequestId
Request ID if specified.
Definition: Include.h:528
PCHAR responseData
Buffer to write the data to - will be allocated. Buffer is freed by a caller.
Definition: Include.h:529
PRequestInfo pRequestInfo
Original request info.
Definition: Include.h:523
CHAR errorBuffer[256+1]
Error buffer for curl calls.
Definition: Include.h:526
UINT32 httpStatus
HTTP status code of the execution.
Definition: Include.h:524
Definition: Include.h:482
PCHAR pValue
Request header value.
Definition: Include.h:485
PCHAR pName
Request header name.
Definition: Include.h:483
UINT32 nameLen
Header name length.
Definition: Include.h:484
UINT32 valueLen
Header value length.
Definition: Include.h:486
Definition: Include.h:494
UINT64 callAfter
Call after time.
Definition: Include.h:510
PSingleList pRequestHeaders
Request headers.
Definition: Include.h:514
UINT32 bodySize
Size of the body in bytes.
Definition: Include.h:500
volatile ATOMIC_BOOL terminating
Indicating whether the request is being terminated.
Definition: Include.h:495
UINT64 currentTime
Current time when request was created.
Definition: Include.h:507
CHAR sslCertPath[MAX_PATH_LEN+1]
SSL Certificate file path to use - optional.
Definition: Include.h:503
HTTP_REQUEST_VERB verb
HTTP verb.
Definition: Include.h:496
UINT64 connectionTimeout
Connection completion timeout.
Definition: Include.h:509
PAwsCredentials pAwsCredentials
AWS Credentials.
Definition: Include.h:513
CHAR region[128+1]
Region.
Definition: Include.h:506
UINT64 lowSpeedLimit
Low-speed limit.
Definition: Include.h:511
SSL_CERTIFICATE_TYPE certType
One of the following types "DER", "PEM", "ENG".
Definition: Include.h:505
UINT64 lowSpeedTimeLimit
Low-time limit.
Definition: Include.h:512
UINT64 completionTimeout
Call completion timeout.
Definition: Include.h:508
CHAR url[MAX_URI_CHAR_LEN+1]
The URL for the request.
Definition: Include.h:501
CHAR sslPrivateKeyPath[MAX_PATH_LEN+1]
SSL Certificate private key file path to use - optional.
Definition: Include.h:504
CHAR certPath[MAX_PATH_LEN+1]
CA Certificate path to use - optional.
Definition: Include.h:502
PCHAR body
Definition: Include.h:497