Contract

The description of the contract objects which must be used by the broker and the client.

The following object descriptions must be considered on the client and broker side.

Claim

To claim a topic, the claim must be published to the claim-topic (default: access/claim) with the JSON representation within the payload. The following JSON structure represents a valid claim.

{
  "restriction": {
    "topicName": "restricted/4Z6BOASZMWKO6YP4BALMNRZ4EBDWIOVXVVJBZ647WASYOEA7AUJQ====/temperature",
    "permissions": [
      {
      "clientId": "T5LKBKSPOWU43HVKN7ZCB54VQB2ZVR3ZOQRV6EZSDDF5JX4HX4SQ====",
      "activity": "PUBLISH"
      }
    ],
    "restrictionType": "WHITELIST"
  },
  "signature": "c/p7jJevMaXIImzBfE4+r5xAYQZt0ukiuICeIpJNjxZ6FYWUESO/2lO1Bs5ZX5+sDr44nyjyisEo8trPlHkfAHsicGVybWlzc2lvbnMiOlt7ImFjdGl2aXR5IjoiUFVCTElTSCIsImNsaWVudElkIjoiVDVMS0JLU1BPV1U0M0hWS043WkNCNTRWUUIyWlZSM1pPUVJWNkVaU0RERjVKWDRIWDRTUT09PT0ifV0sInJlc3RyaWN0aW9uVHlwZSI6IldISVRFTElTVCIsInRvcGljTmFtZSI6InJlc3RyaWN0ZWQvNFo2Qk9BU1pNV0tPNllQNEJBTE1OUlo0RUJEV0lPVlhWVkpCWjY0N1dBU1lPRUE3QVVKUT09PT0vdGVtcGVyYXR1cmUifQ=="
}

Signature

Every Claim needs to be signed by the client and verified by the broker. To make sure that signatures are consistent over all platforms the signature payload is specified as follows:

  • JSON representation of the Restriction Object
    • lowerCamelCase
    • Alphabetically sorted properties
    • Oneliner (no spaces, no pagebreaks)

This payload must be signed with a valid ED25519 key-pair which was generated when the client connected to the broker. The signature must then be set on the claim in a Base64 representation.

Claim properties

Property Type Description Mandatory
signature string A Base64 representation of the signed Restriction Y
restriction Restriction The Restriction-Object which holds all relevant information about the topic that will be claimed Y

Restriction properties

Property Type Description Mandatory
topicName string The name of the topic that will be claimed. This topic must be prefixed with: restricted/{clientId}/ Y
permissions Permission[] A list of Permission-Objects. If no permissions are set, only the owner can interact on this topic. N
restrictionType string The type of the restriction and how the permissions should be interpreted. Allowed values are: WHITELIST or BLACKLIST Y

Permission properties

Property Type Description Mandatory
clientId string A Base32 representation of a client ID of any other SMOKER client. A * can be used to include all clients. Y
activity string The MQTT-Activity which this rule is activated on. Allowed values are: PUBLISH, SUBSCRIBE or ALL Y
Last modified May 28, 2021