http_processor.c File Reference

HTTP processor module implementation file. More...

#include "http_processor.h"
#include "log_util.h"
#include "memory.h"
#include "http_definitions.h"
#include "json.h"
#include "json_util.h"
#include "list.h"
#include "data_types.h"
#include "time_series.h"
#include "event_list.h"
#include "file.h"
#include "custom_data.h"
#include "stream_data.h"
#include "data_source_configuration.h"
#include "definitions.h"
#include "jwt.h"
#include "storage.h"
#include "security.h"
#include "http_request.h"
#include "random.h"
#include "file_util.h"
#include "mcl/mcl_common.h"
#include "time_util.h"
Include dependency graph for http_processor.c:

Go to the source code of this file.

Macros

#define SERVER_NONCE   "server_nonce"
 
#define SERVER_PROOF   "server_proof"
 
#define JSON_NAME_CLIENT_ID   "client_id"
 
#define JSON_NAME_TOKEN_ENDPOINT_AUTH_METHOD   "token_endpoint_auth_method"
 
#define JSON_NAME_GRANT_TYPES   "grant_types"
 
#define JSON_NAME_CLIENT_SECRET   "client_secret"
 
#define JSON_NAME_CLIENT_SECRET_EXPIRES_AT   "client_secret_expires_at"
 
#define JSON_NAME_REGISTRATION_ACCESS_TOKEN   "registration_access_token"
 
#define JSON_NAME_REGISTRATION_CLIENT_URI   "registration_client_uri"
 
#define JSON_NAME_JWKS   "jwks"
 
#define JSON_NAME_KEYS   "keys"
 
#define JSON_NAME_E   "e"
 
#define JSON_NAME_N   "n"
 
#define JSON_NAME_KTY   "kty"
 
#define JSON_NAME_KID   "kid"
 
#define JSON_NAME_ACCESS_TOKEN   "access_token"
 
#define REGISTER_URI_PATH   "/register"
 
#define ACCESS_TOKEN_URI_PATH   "/token"
 
#define MAX_STREAM_CALLBACK_CALL_COUNT   10
 
#define MAX_RANGE_HEADER_LENGTH   (100)
 
#define MAX_TOP_EVENT_PARAMETER_LENGTH   (50)
 
#define EVENT_REQUEST_LIMIT   (100)
 According to specification. More...
 
#define CORRELATION_ID_BYTE_LENGTH   16
 

Enumerations

enum  E_ENDPOINT_TYPE { ENDPOINT_ONBOARDING, ENDPOINT_KEY_ROTATION, ENDPOINT_EXCHANGE }
 Enumeration for the Mindsphere endpoints. More...
 
enum  E_ENDPOINT_URI {
  ENDPOINT_URI_EXCHANGE, ENDPOINT_URI_DOWNLOAD, ENDPOINT_URI_EVENT, ENDPOINT_URI_ACK_EVENT,
  ENDPOINT_URI_ACCESS_TOKEN, ENDPOINT_URI_REGISTER, ENDPOINT_URI_END
}
 Enumeration for URIs for different endpoints. More...
 

Functions

static E_MCL_ERROR_CODE _process_registration_response_shared_secret (http_processor_t *http_processor, http_response_t *http_response)
 
static E_MCL_ERROR_CODE _process_registration_response_rsa_3072 (http_processor_t *http_processor, http_response_t *http_response)
 
static E_MCL_ERROR_CODE _concatenate_host_and_endpoint (string_t *host, string_t *endpoint, string_t **uri)
 
static E_MCL_ERROR_CODE _exchange_fill_http_request (http_processor_t *http_processor, store_t *store, http_request_t *request)
 
static E_MCL_ERROR_CODE _exchange_prepare_data (store_data_t *store_data)
 
static E_MCL_ERROR_CODE _exchange_add_current_data_to_request (store_data_t *current_store_data, http_request_t *request)
 
static E_MCL_ERROR_CODE _exchange_add_current_data_to_request_by_streaming (store_data_t *current_store_data, http_request_t *request)
 
static E_MCL_ERROR_CODE _exchange_evaluate_response (store_t *store, E_MCL_ERROR_CODE send_result, http_response_t *response, void **reserved, string_t *correlation_id)
 
static E_MCL_ERROR_CODE _exchange_update_store_state (store_t *store, mcl_bool_t send_operation_successful)
 
static E_MCL_ERROR_CODE _exchange_update_store_data_state (store_data_t *store_data, mcl_bool_t send_operation_successful)
 
static E_MCL_ERROR_CODE _exchange_clear_sent_data_from_store (store_t *store)
 
static E_MCL_ERROR_CODE _exchange_store_data_get_content_info (store_data_t *store_data, string_t **meta_content_type, string_t **meta_content_id, string_t **payload_content_type)
 
static E_MCL_ERROR_CODE _exchange_initialize_http_request_headers (http_processor_t *http_processor, http_request_t *request, mcl_bool_t with_authentication)
 
static E_MCL_ERROR_CODE _exchange_finalize_http_request (http_processor_t *http_processor, http_request_t *request, mcl_bool_t with_authentication)
 
static E_MCL_ERROR_CODE _add_authentication_header_to_request (http_processor_t *http_processor, http_request_t *request, mcl_bool_t with_authentication)
 
static mcl_size_t _get_payload_from_buffer (void *destination, void *source, mcl_size_t size, void *user_context)
 
static mcl_size_t _get_payload_from_file (void *destination, void *file_descriptor, mcl_size_t size, void *user_context)
 
static E_MCL_ERROR_CODE _compose_rsa_onboarding_json (security_handler_t *security_handler, string_t **payload)
 
static E_MCL_ERROR_CODE _compose_rsa_key_rotation_json (security_handler_t *security_handler, string_t **payload)
 
static E_MCL_ERROR_CODE _add_key_to_keys_array (json_t *root, json_t **json_object)
 
static E_MCL_ERROR_CODE _check_file_path (const char *file_name)
 
static E_MCL_ERROR_CODE _custom_load_register_info (http_processor_t *http_processor)
 
static E_MCL_ERROR_CODE _evaluate_response_codes (http_response_t *response)
 
static E_MCL_ERROR_CODE _generate_correlation_id_string (string_t **correlation_id)
 
E_MCL_ERROR_CODE _save_registration_information (http_processor_t *http_processor)
 
E_MCL_ERROR_CODE _compose_access_token_request_payload (http_processor_t *http_processor, string_t **request_payload)
 
E_MCL_ERROR_CODE http_processor_initialize (configuration_t *configuration, http_processor_t **http_processor)
 Http Processor Initialize function. More...
 
E_MCL_ERROR_CODE http_processor_register (http_processor_t *http_processor)
 
E_MCL_ERROR_CODE http_processor_update_security_information (http_processor_t *http_processor)
 
E_MCL_ERROR_CODE http_processor_get_access_token (http_processor_t *http_processor)
 
E_MCL_ERROR_CODE http_processor_exchange (http_processor_t *http_processor, store_t *store, void **reserved)
 Exchange operation logic. More...
 
E_MCL_ERROR_CODE http_processor_stream (http_processor_t *http_processor, store_t *store, void **reserved)
 Exchange operation logic with streaming. More...
 
void http_processor_destroy (http_processor_t **http_processor)
 To destroy the HTTP Processor Handler. More...
 

Variables

string_t endpoint_uri [ENDPOINT_URI_END]
 

Detailed Description

HTTP processor module implementation file.


Date
Jul 19, 2016

Definition in file http_processor.c.

Macro Definition Documentation

#define ACCESS_TOKEN_URI_PATH   "/token"

Definition at line 57 of file http_processor.c.

#define CORRELATION_ID_BYTE_LENGTH   16

Definition at line 66 of file http_processor.c.

Referenced by _generate_correlation_id_string().

#define EVENT_REQUEST_LIMIT   (100)

According to specification.

Definition at line 64 of file http_processor.c.

#define JSON_NAME_ACCESS_TOKEN   "access_token"

Definition at line 54 of file http_processor.c.

Referenced by http_processor_get_access_token().

#define JSON_NAME_CLIENT_ID   "client_id"
#define JSON_NAME_CLIENT_SECRET   "client_secret"

Definition at line 44 of file http_processor.c.

Referenced by _process_registration_response_shared_secret().

#define JSON_NAME_CLIENT_SECRET_EXPIRES_AT   "client_secret_expires_at"

Definition at line 45 of file http_processor.c.

#define JSON_NAME_E   "e"
#define JSON_NAME_GRANT_TYPES   "grant_types"

Definition at line 43 of file http_processor.c.

#define JSON_NAME_JWKS   "jwks"
#define JSON_NAME_KEYS   "keys"
#define JSON_NAME_KID   "kid"
#define JSON_NAME_KTY   "kty"
#define JSON_NAME_N   "n"
#define JSON_NAME_REGISTRATION_ACCESS_TOKEN   "registration_access_token"
#define JSON_NAME_REGISTRATION_CLIENT_URI   "registration_client_uri"
#define JSON_NAME_TOKEN_ENDPOINT_AUTH_METHOD   "token_endpoint_auth_method"

Definition at line 42 of file http_processor.c.

#define MAX_RANGE_HEADER_LENGTH   (100)

Definition at line 62 of file http_processor.c.

Referenced by _process_registration_response_rsa_3072().

#define MAX_STREAM_CALLBACK_CALL_COUNT   10

Definition at line 60 of file http_processor.c.

Referenced by _get_payload_from_file().

#define MAX_TOP_EVENT_PARAMETER_LENGTH   (50)

Definition at line 63 of file http_processor.c.

#define REGISTER_URI_PATH   "/register"

Definition at line 56 of file http_processor.c.

#define SERVER_NONCE   "server_nonce"

Definition at line 38 of file http_processor.c.

#define SERVER_PROOF   "server_proof"

Definition at line 39 of file http_processor.c.

Enumeration Type Documentation

Enumeration for the Mindsphere endpoints.

Enumerator
ENDPOINT_ONBOARDING 

Onboarding endpoint.

ENDPOINT_KEY_ROTATION 

Key rotation endpoint.

ENDPOINT_EXCHANGE 

Exchange endpoint.

Definition at line 71 of file http_processor.c.

Enumeration for URIs for different endpoints.

Enumerator
ENDPOINT_URI_EXCHANGE 

Uri for exchange endpoint.

ENDPOINT_URI_DOWNLOAD 

Uri for download endpoint.

ENDPOINT_URI_EVENT 

Uri for event endpoint.

ENDPOINT_URI_ACK_EVENT 

Uri for ack event endpoint.

ENDPOINT_URI_ACCESS_TOKEN 

Uri for access token endpoint.

ENDPOINT_URI_REGISTER 

Uri for registration endpoint.

ENDPOINT_URI_END 

End of uri endpoint.

Definition at line 81 of file http_processor.c.

Function Documentation

static E_MCL_ERROR_CODE _add_key_to_keys_array ( json_t root,
json_t **  json_object 
)
static

Definition at line 2214 of file http_processor.c.

References ASSERT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, JSON_OBJECT, json_util_add_item_to_array(), json_util_initialize(), and MCL_OK.

Referenced by _compose_rsa_key_rotation_json(), and _compose_rsa_onboarding_json().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _check_file_path ( const char *  file_name)
static

Definition at line 2227 of file http_processor.c.

References DEBUG_ENTRY, DEBUG_LEAVE, file_util_fclose(), file_util_fopen(), MCL_NULL, and MCL_OK.

Referenced by http_processor_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE _compose_access_token_request_payload ( http_processor_t http_processor,
string_t **  request_payload 
)
E_MCL_ERROR_CODE _concatenate_host_and_endpoint ( string_t host,
string_t endpoint,
string_t **  uri 
)
static

Definition at line 766 of file http_processor.c.

References ASSERT_STATEMENT_CODE_MESSAGE, string_t::buffer, DEBUG_ENTRY, DEBUG_LEAVE, string_t::length, MCL_FAIL, MCL_NULL, MCL_OK, string_destroy(), string_initialize_new(), and string_util_snprintf().

Referenced by http_processor_get_access_token(), and http_processor_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _exchange_clear_sent_data_from_store ( store_t store)
static

Definition at line 1625 of file http_processor.c.

References mcl_list_node_t::data, DATA_STATE_SENT, DEBUG_ENTRY, DEBUG_LEAVE, store_t::high_priority_list, list_next(), store_t::low_priority_list, MCL_NULL, MCL_OK, store_data_get_state(), and store_data_remove().

Referenced by _exchange_evaluate_response().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _exchange_evaluate_response ( store_t store,
E_MCL_ERROR_CODE  send_result,
http_response_t response,
void **  reserved,
string_t correlation_id 
)
static
static E_MCL_ERROR_CODE _exchange_finalize_http_request ( http_processor_t http_processor,
http_request_t request,
mcl_bool_t  with_authentication 
)
static

Definition at line 1763 of file http_processor.c.

References _add_authentication_header_to_request(), ASSERT_CODE, ASSERT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, http_request_finalize(), MCL_HTTP_REQUEST_FINALIZE_FAILED, and MCL_OK.

Referenced by _exchange_fill_http_request(), and _get_payload_from_file().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _exchange_initialize_http_request_headers ( http_processor_t http_processor,
http_request_t request,
mcl_bool_t  with_authentication 
)
static
static E_MCL_ERROR_CODE _exchange_update_store_data_state ( store_data_t store_data,
mcl_bool_t  send_operation_successful 
)
static

Definition at line 1571 of file http_processor.c.

References DATA_STATE_PREPARED, DATA_STATE_SENT, DATA_STATE_WRITTEN, DEBUG_ENTRY, DEBUG_LEAVE, MCL_DEBUG, MCL_OK, MCL_TRUE, store_data_get_state(), and store_data_set_state().

Referenced by _exchange_update_store_state().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _exchange_update_store_state ( store_t store,
mcl_bool_t  send_operation_successful 
)
static

Definition at line 1600 of file http_processor.c.

References _exchange_update_store_data_state(), mcl_list_node_t::data, DEBUG_ENTRY, DEBUG_LEAVE, store_t::high_priority_list, list_next(), list_reset(), store_t::low_priority_list, MCL_NULL, and MCL_OK.

Referenced by _exchange_evaluate_response().

Here is the call graph for this function:

Here is the caller graph for this function:

static E_MCL_ERROR_CODE _generate_correlation_id_string ( string_t **  correlation_id)
static
static mcl_size_t _get_payload_from_buffer ( void *  destination,
void *  source,
mcl_size_t  size,
void *  user_context 
)
static

Definition at line 1799 of file http_processor.c.

References DEBUG_ENTRY, DEBUG_LEAVE, and string_util_memcpy().

Referenced by _exchange_add_current_data_to_request(), and _exchange_add_current_data_to_request_by_streaming().

Here is the call graph for this function:

Here is the caller graph for this function:

void http_processor_destroy ( http_processor_t **  http_processor)

To destroy the HTTP Processor Handler.

Will release the resources of HTTP Processor. After destroy operation, handler shouldn't be used.

Parameters
[in]http_processorHTTP Processor handle to be destroyed.

Definition at line 946 of file http_processor.c.

References DEBUG_ENTRY, DEBUG_LEAVE, http_client_destroy(), MCL_DEBUG, MCL_FREE, MCL_NULL, security_handler_destroy(), and string_destroy().

Referenced by http_processor_initialize(), and mcl_communication_destroy().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_processor_exchange ( http_processor_t http_processor,
store_t store,
void **  reserved 
)

Exchange operation logic.

Performs exchange operation on MindSphere. After successfully sending the data from the received store object, data will be removed.

Parameters
[in]http_processorHTTP Processor handle to be used.
[in]storeThe data to be exchanged will be read from this store.
[out]reservedReserved for future use.
Returns

Definition at line 786 of file http_processor.c.

References _exchange_evaluate_response(), _exchange_fill_http_request(), _exchange_initialize_http_request_headers(), _generate_correlation_id_string(), ASSERT_CODE_MESSAGE, http_processor_t::configuration, mcl_list_t::count, DEBUG_ENTRY, DEBUG_LEAVE, configuration_t::exchange_endpoint, store_t::high_priority_list, http_processor_t::http_client, http_client_send(), HTTP_HEADER_CORRELATION_ID, http_header_names, http_request_add_header(), http_request_destroy(), http_request_initialize(), HTTP_REQUEST_RESIZE_ENABLED, store_t::low_priority_list, configuration_t::max_http_payload_size, MCL_DEBUG, MCL_ERROR_RETURN, MCL_HTTP_POST, MCL_NULL, MCL_OK, MCL_STORE_IS_EMPTY, MCL_TRUE, store_get_data_count(), string_destroy(), and configuration_t::user_agent.

Referenced by mcl_communication_exchange().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_processor_get_access_token ( http_processor_t http_processor)

This function is called by mcl_communication_get_access_token().

See also
mcl_communication_get_access_token for details.
Parameters
[in]http_processorHTTP Processor handle to be used.
Returns

Definition at line 580 of file http_processor.c.

References _add_authentication_header_to_request(), _compose_access_token_request_payload(), _concatenate_host_and_endpoint(), _evaluate_response_codes(), _generate_correlation_id_string(), security_handler_t::access_token, configuration_t::access_token_endpoint, ASSERT_CODE_MESSAGE, ASSERT_STATEMENT_CODE_MESSAGE, string_t::buffer, http_processor_t::configuration, CONTENT_TYPE_URL_ENCODED, content_type_values, DEBUG_ENTRY, DEBUG_LEAVE, ENDPOINT_URI_DOWNLOAD, file_destroy(), file_initialize(), http_processor_t::http_client, http_client_send(), HTTP_HEADER_ACCEPT, HTTP_HEADER_CONTENT_DISPOSITION, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_CORRELATION_ID, http_header_names, HTTP_HEADER_SERVER_TIME, http_request_add_header(), http_request_destroy(), http_request_initialize(), HTTP_REQUEST_RESIZE_ENABLED, http_response_destroy(), http_response_get_header(), http_response_get_payload(), JSON_NAME_ACCESS_TOKEN, json_util_destroy(), json_util_get_object_item(), json_util_get_string(), json_util_parse_with_size(), security_handler_t::last_token_time, string_t::length, configuration_t::max_http_payload_size, MCL_BUFFER_OVERFLOW_ERROR, MCL_ERROR, MCL_ERROR_RETURN, MCL_FAIL, MCL_FREE, MCL_HTTP_GET, MCL_HTTP_POST, MCL_INFO, MCL_NULL, MCL_OK, MCL_PARTIAL_CONTENT, MCL_TRUE, configuration_t::mindsphere_hostname, http_response_t::payload, http_request_t::payload, http_response_t::payload_size, http_processor_t::security_handler, string_destroy(), string_initialize_static(), string_util_memcpy(), and configuration_t::user_agent.

Referenced by mcl_communication_get_access_token(), mcl_communication_onboard(), mcl_communication_rotate_key(), and mcl_communication_update_security_information().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_processor_initialize ( configuration_t configuration,
http_processor_t **  http_processor 
)

Http Processor Initialize function.

Performs creation and initializations of following modules :

  • security_handler
  • jwt
  • http_client
Parameters
[in]configurationThe configuration parameters to be used for initializing itself and other modules.
[out]http_processorThe newly initialized HTTP processor.
Returns

Definition at line 196 of file http_processor.c.

References _check_file_path(), _concatenate_host_and_endpoint(), _custom_load_register_info(), ASSERT_CODE_MESSAGE, ASSERT_STATEMENT_CODE_MESSAGE, DEBUG_ENTRY, DEBUG_LEAVE, ENDPOINT_URI_ACCESS_TOKEN, ENDPOINT_URI_EXCHANGE, ENDPOINT_URI_REGISTER, http_client_initialize(), http_processor_destroy(), json_util_initialize_json_library(), MCL_DEBUG, MCL_ERROR, MCL_INFO, MCL_NEW, MCL_NO_ACCESS_TOKEN_PROVIDED, MCL_NULL, MCL_OK, MCL_OUT_OF_MEMORY, MCL_PATH_NOT_ACCESSIBLE, MCL_REGISTRATION_INFO_IS_NOT_LOADED, MCL_SECURITY_RSA_3072, MCL_SECURITY_SHARED_SECRET, security_handler_generate_rsa_key(), security_handler_initialize(), security_initialize(), storage_load_rsa_registration_information(), and storage_load_shared_secret_registration_information().

Referenced by mcl_communication_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_processor_register ( http_processor_t http_processor)

This function is called by mcl_communication_onboard() and mcl_communication_rotate_key().

See also
mcl_communication_onboard and
mcl_communication_rotate_key for details.
Parameters
[in]http_processorHTTP Processor handle to be used.
Returns

Definition at line 323 of file http_processor.c.

References _compose_rsa_key_rotation_json(), _compose_rsa_onboarding_json(), _evaluate_response_codes(), _generate_correlation_id_string(), _process_registration_response_rsa_3072(), _process_registration_response_shared_secret(), _save_registration_information(), ASSERT_CODE_MESSAGE, ASSERT_STATEMENT_CODE_MESSAGE, string_t::buffer, security_handler_t::client_id, http_processor_t::configuration, CONTENT_TYPE_APPLICATION_JSON, content_type_values, DEBUG_ENTRY, DEBUG_LEAVE, http_processor_t::http_client, http_client_send(), HTTP_HEADER_ACCEPT, HTTP_HEADER_AUTHORIZATION, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_CORRELATION_ID, http_header_names, http_request_add_header(), http_request_destroy(), http_request_initialize(), HTTP_REQUEST_RESIZE_ENABLED, http_response_destroy(), configuration_t::initial_access_token, string_t::length, configuration_t::max_http_payload_size, MCL_CREATED, MCL_ERROR, MCL_ERROR_RETURN, MCL_FAIL, MCL_HTTP_POST, MCL_HTTP_PUT, MCL_INFO, MCL_NULL, MCL_OK, MCL_SECURITY_RSA_3072, MCL_SECURITY_SHARED_SECRET, MCL_UNEXPECTED_RESULT_CODE, http_request_t::payload, security_handler_t::registration_access_token, security_handler_t::registration_client_uri, configuration_t::registration_endpoint, http_processor_t::security_handler, configuration_t::security_profile, string_destroy(), string_initialize_new(), string_util_memcpy(), string_util_snprintf(), and configuration_t::user_agent.

Referenced by mcl_communication_onboard(), and mcl_communication_rotate_key().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_processor_stream ( http_processor_t http_processor,
store_t store,
void **  reserved 
)

Exchange operation logic with streaming.

Performs exchange operation on MindSphere using the http transfer-encoding method. This method directly writes the data to the request buffer while performing the send operation, this way uses less memory than normal exchange method, hence it is suitable sending large data in resource constrained systems. Also this is the only way to send unknown size data, which represented in MCL as stream_data_t.

Warning
The store passed to this method must be a streamable store (mcl_store_initialize() ) .
Parameters
[in]http_processorHTTP Processor handle to be used
[in]storeThe data to be exchanged will be read from this store.
[out]reservedReserved for future use.

Definition at line 870 of file http_processor.c.

References _exchange_evaluate_response(), _exchange_initialize_http_request_headers(), _generate_correlation_id_string(), ASSERT_CODE_MESSAGE, http_processor_t::configuration, mcl_list_t::count, DEBUG_ENTRY, DEBUG_LEAVE, configuration_t::exchange_endpoint, store_t::high_priority_list, http_processor_t::http_client, http_client_send(), HTTP_HEADER_CORRELATION_ID, http_header_names, http_request_add_header(), http_request_destroy(), http_request_initialize(), HTTP_REQUEST_RESIZE_DISABLED, store_t::low_priority_list, configuration_t::max_http_payload_size, MCL_DEBUG, MCL_ERROR_RETURN, MCL_FAIL, MCL_HTTP_POST, MCL_NULL, MCL_OK, MCL_OPERATION_IS_NOT_SUPPORTED, MCL_STORE_IS_EMPTY, MCL_TRUE, http_client_send_callback_info_t::read_callback, http_processor_stream_callback_context_t::request, store_get_data_count(), string_destroy(), configuration_t::user_agent, and http_client_send_callback_info_t::user_context.

Referenced by mcl_communication_exchange().

Here is the call graph for this function:

Here is the caller graph for this function:

E_MCL_ERROR_CODE http_processor_update_security_information ( http_processor_t http_processor)

This function is called by mcl_communication_update_security_information().

See also
mcl_communication_update_security_information for details.
Parameters
[in]http_processorHTTP Processor handle to be used.
Returns

Definition at line 459 of file http_processor.c.

References ASSERT_CODE_MESSAGE, string_t::buffer, security_handler_t::client_id, security_handler_t::client_secret, http_processor_t::configuration, DEBUG_ENTRY, DEBUG_LEAVE, configuration_t::load_function, MCL_FAIL, MCL_FREE, MCL_NULL, MCL_OK, MCL_SECURITY_SHARED_SECRET, MCL_SECURITY_UP_TO_DATE, MCL_TRUE, rsa_t::private_key, rsa_t::public_key, security_handler_t::registration_access_token, security_handler_t::rsa, mcl_load_registration_information_callback_t::rsa, configuration_t::save_function, http_processor_t::security_handler, configuration_t::security_profile, mcl_load_registration_information_callback_t::shared_secret, mcl_save_registration_information_callback_t::shared_secret, storage_load_rsa_registration_information(), storage_load_shared_secret_registration_information(), configuration_t::store_path, string_compare_with_cstr(), string_destroy(), string_initialize_dynamic(), string_util_strlen(), and string_util_strncmp().

Referenced by mcl_communication_update_security_information().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

string_t endpoint_uri[ENDPOINT_URI_END]
Initial value:
=
{
STRING_CONSTANT("api/mindconnect/v3/exchange"),
STRING_CONSTANT("api/mindconnect/v3/files"),
STRING_CONSTANT("api/mindconnect/v3/events"),
STRING_CONSTANT("api/mindconnect/v3/events/acknowledge"),
STRING_CONSTANT("api/agentmanagement/v3/oauth/token"),
}
#define STRING_CONSTANT(s)
Definition: definitions.h:135

Definition at line 93 of file http_processor.c.