http_push

This submodule contains methods related to the HTTP Push type Data Connector.

Methods

dtintegrations.data_connector.http_push.decode_request(request, provider, secret)

Decodes the incoming event, first validating the source- and origin using a signature secret and the provider-specific request.

Parameters:
  • request (Any) – Unmodified incoming request format of the spcified provider.

  • provider ({"flask", "gcloud", "lambda", "azure"}, str) – Name of the provider used to receive the request.

  • secret (str) – The secret to sign the request at source.

Return type:

Any

Returns:

  • event (Event) – An object representing the received event.

  • labels (dict) – Labels from the source device forwarded by the Data Connector.

Raises:

ConfigurationError – If any of the input parameters are of invalid type, or the signature secret is expired.

dtintegrations.data_connector.http_push.decode(headers, body, secret)

Decodes the incoming event, first validating the source- and origin using a signature secret and the request header- and body.

Parameters:
  • headers (dict[str, str]) – Headers key- value pairs in request. For multi-header format, the value should be a comma-separated string.

  • body (bytes) – Request body bytes.

  • secret (str) – The secret to sign the request at source.

Return type:

Any

Returns:

  • event (Event) – An object representing the received event.

  • labels (dict) – Labels from the source device forwarded by the Data Connector.

Raises:

ConfigurationError – If any of the input parameters are of invalid type, or the signature secret is expired.