# Generic function to query the A1PMS/ICS via the REST or DMAAP interface.
# Used by all other A1PMS/ICS api test functions
-# If operation sufffix is '_BATCH' the the send and get response is split in two sequences,
+# If operation suffix is '_BATCH' the the send and get response is split in two sequences,
# one for sending the requests and one for receiving the response
# but only when using the DMAAP interface
# REST or DMAAP is controlled of the base url of $XX_ADAPTER
echo "-000"
return 1
fi
-
+ jwt=""
+ if [ ! -z "$KUBE_PROXY_CURL_JWT" ]; then
+ jwt=" -H "\""Authorization: Bearer $KUBE_PROXY_CURL_JWT"\"
+ fi
if [ $__ADAPTER_TYPE == "REST" ]; then
url=" "${__ADAPTER}${input_url}
oper=" -X "$oper
curlString="curl -k $proxyflag "${oper}${timeout}${httpcode}${accept}${content}${url}${file}
- echo " CMD: "$curlString >> $HTTPLOG
+ echo " CMD: $curlString $jwt" >> $HTTPLOG
if [ $# -gt 3 ]; then
echo " FILE: $(<$fname)" >> $HTTPLOG
fi
while [ $maxretries -ge 0 ]; do
let maxretries=maxretries-1
- res=$($curlString)
+ if [ ! -z "$KUBE_PROXY_CURL_JWT" ]; then
+ res=$($curlString -H "Authorization: Bearer $KUBE_PROXY_CURL_JWT")
+ else
+ res=$($curlString)
+ fi
retcode=$?
if [ $retcode -ne 0 ]; then
echo " RETCODE: "$retcode >> $HTTPLOG