Supported Custom jq Functions for Encoding and Decoding

The Rapid Adapter Builder platform supports custom jq functions.

connectivity::base64

The following list of supported custom jq functions enable the developer to use encoding and decoding mechanisms for inbound security policies:

Base64 Encode Binary/Text Content

Input Output Expression in Adapter Definition Document

A JSON node that can be either binary or text.

Hex encoded string as a text node.

To compute base64 encoded HMAC digest:

{ "arguments": { "body": "${connectivity::hex(connectivity::hmac(\"HMACSHA256\"; .securityProperties.signKey; .request.url + (.request.body| tostring))) }" } }

connectivity::hex

Hex Encode Binary/Text Content

Input Output Expression in Adapter Definition Document

A JSON node that can be either binary or text.

Base64 encoded string as text node.

To compute Hex encoded HMAC digest:

{ "arguments": { "body": "${connectivity::base64(connectivity::hmac(\"HMACSHA256\"; .securityProperties.signKey; .request.url + (.request.body| tostring))) }" } }

connectivity::base64URLDecode

base64URL decode the value

Input Output Expression in Adapter Definition Document

JSON text node

Binary node with decode byte array.

{ "arguments": { "body": "${connectivity::rsa(\"SHA256withRSA\"; .securityProperties.signKey; .request.body; connectivity::base64URLDecode(.request.headers.signature))}" } }

connectivity::stringToBinary

Converts string to binary (byte string) node.

Input Output Expression in Adapter Definition Document

Consists of:

  • Key
  • Text node
  • String to be converted

Binary node

{ "arguments": { "body": "${connectivity::stringToBinary(.input.message)}" } }

connectivity::binaryToString

Converts binary to string

Input Output Expression in Adapter Definition Document

Consists of:

  • Key
  • Binary node
  • Binary to be converted

Text node

{ "arguments": { "body": "${ connectivity::binaryToString(connectivity::stringToBinary(.input.message))}" } }

connectivity::hexDecode

Hex decode string or byte array

Input Output Expression in Adapter Definition Document

Consists of:

  • Key
  • Binary node
  • Text or binary to be converted

Binary node

{ "name": "decodedSignature", "type": "expression", "operation": "connectivity::hexDecode(.request.headers.digest)" },

connectivity::base64Decode

Hex decode string or byte array

Input Output Expression in Adapter Definition Document

Consists of:

  • Key
  • Binary node
  • Text or binary to be converted

Binary node

{ "name": "decodedSignature", "type": "expression", "operation": "connectivity::base64Decode(.request.headers.digest)" },