I am using webhook endpoint to push messages to SQS service
pipeline looks:
gateway -> integration request -> SQS -> integration response
everything works fine but now third party integration requires time-to-time validation request, and i need to return calculated hmac sha256 hash in response
Not sure if response template support all utils, but I am trying next Integration response template:
#set($token = $context.responseOverride.header.RequestBody)
#if(!$token || $token == '')
{"status": "ok"}
#else
#set($secretKey = "my-secret-key")
#set($hmac = $util.cryptoHmac("HmacSHA256", "$token", $secretKey))
{
"token": "$message",
"hmac": "$util.base64Encode($hmac)"
}
#end
but looks like $util.cryptoHmac("HmacSHA256", "$token", $secretKey)
not working, method returns null
maybe somebody could help me to resolve this case