Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

webhook-adapter Adapter

The webhook-adapter adapter provides the ability for the ClearBlade platform to receive incoming HTTP requests via MQTT.

MQTT Topic Structure

The webhook-adapter adapter utilizes MQTT messaging to communicate with the ClearBlade Platform. The webhook-adapter adapter will publish messages to a MQTT topic in order to provide the ClearBlade Platform/Edge with data received from a HTTP request. The topic structures utilized by the webhook-adapter adapter is as follows:

  • Send HTTP request data to Clearblade: webhook-adapter/received (default topic)

ClearBlade Platform Dependencies

The webhook-adapter adapter was constructed to provide the ability to communicate with a System defined in a ClearBlade Platform instance. Therefore, the adapter requires a System to have been created within a ClearBlade Platform instance.

Once a System has been created, artifacts must be defined within the ClearBlade Platform system to allow the adapters to function properly. At a minimum:

  • A device needs to be created in the Auth --> Devices collection. The device will represent the adapter account. The name and active key values specified in the Auth --> Devices collection will be used by the adapter to authenticate to the ClearBlade Platform or ClearBlade Edge.

Usage

Executing the adapter

./webhook-adapter -systemKey <SYSTEM_KEY> -systemSecret <SYSTEM_SECRET> -platformURL <PLATFORM_URL> -messagingURL <MESSAGING_URL> -deviceName <DEVICE_NAME> -activeKey <DEVICE_ACTIVE_KEY> -receiverPort <LISTENING_PORT>

Where

systemKey

  • REQUIRED
  • The system key of the ClearBLade Platform System the adapter will connect to

systemSecret

  • REQUIRED
  • The system secret of the ClearBLade Platform System the adapter will connect to

platformURL

  • REQUIRED
  • The url of the ClearBlade Platform instance the adapter will connect to

messagingURL

  • REQUIRED
  • The MQTT url of the ClearBlade Platform instance the adapter will connect to

deviceName

  • REQUIRED
  • The device name the adapter will use to authenticate to the ClearBlade Platform
  • Requires the device to have been defined in the Auth - Devices collection within the ClearBlade Platform System

activeKey

  • REQUIRED
  • The active key the adapter will use to authenticate to the platform
  • Requires the device to have been defined in the Auth - Devices collection within the ClearBlade Platform System

receiverPort

  • REQUIRED
  • The port the adapter will listen on

topicName

  • The MQTT topic the adapter will publish to
  • OPTIONAL
  • Defaults to webhook-adapter/received

enableTLS

  • Whether or not the adapter should utilize TLS
  • OPTIONAL
  • Defaults to false

tlsCertPath

  • The path to the TLS .crt file
  • REQUIRED if enableTLS is set to true

tlsKeyPath

  • The path to the TLS .key file
  • REQUIRED if enableTLS is set to true

Setup


The webhook-adapter adapter is dependent upon the ClearBlade Go SDK and its dependent libraries being installed. The webhook-adapter adapter was written in Go and therefore requires Go to be installed (https://golang.org/doc/install).

Adapter compilation

In order to compile the adapter for execution, the following steps need to be performed:

  1. Retrieve the adapter source code
    • git clone git@github.com:ClearBlade/webhook-adapter.git
  2. Navigate to the webhook-adapter directory
    • cd webhook-adapter
  3. go get -u github.com/ClearBlade/Go-SDK.git
    • This command should be executed from within your Go workspace
  4. Compile the adapter
    • go build

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published