commit d72bec42356e986196b9abeeff8c5d6cae046dc4
parent 17e40d7105bed87678eb400e4866bfd88dfbb2b4
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 12 May 2023 16:38:44 +0200
style
Diffstat:
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/challenger/test-challenger.sh b/src/challenger/test-challenger.sh
@@ -90,7 +90,7 @@ if [ "$STATUS" != "200" ]
then
exit_fail "Expected 200 OK. Got: $STATUS" $(cat $LAST_RESPONSE)
fi
-NONCE=`jq -r .nonce < "$LAST_RESPONSE"`
+NONCE=$(jq -r .nonce < "$LAST_RESPONSE")
echo " OK"
CLIENT_STATE="the-client-state"
@@ -122,7 +122,7 @@ STATUS=$(curl "${BURL}/challenge/${NONCE}" \
if [ "$STATUS" != "200" ]
then
- exit_fail "Expected 200 OK. Got: $STATUS" `cat $LAST_RESPONSE`
+ exit_fail "Expected 200 OK. Got: $STATUS" $(cat $LAST_RESPONSE)
fi
echo "OK"
@@ -138,7 +138,7 @@ TARGET=$(echo "$RESULT" | awk '{print $2}')
if [ "$STATUS" != "302" ]
then
- exit_fail "Expected 302. Got: $STATUS" `cat $LAST_RESPONSE`
+ exit_fail "Expected 302. Got: $STATUS" $(cat $LAST_RESPONSE)
fi
TURL=$(echo "$TARGET" | sed -e "s/?.*//g")
@@ -167,15 +167,15 @@ STATUS=$(curl "${BURL}/token" \
if [ "$STATUS" != "200" ]
then
- exit_fail "Expected 200 OK. Got: $STATUS" `cat $LAST_RESPONSE`
+ exit_fail "Expected 200 OK. Got: $STATUS" $(cat $LAST_RESPONSE)
fi
-TOKEN_TYPE=`cat $LAST_RESPONSE | jq -r .token_type`
+TOKEN_TYPE=$(cat $LAST_RESPONSE | jq -r .token_type)
if [ "$TOKEN_TYPE" != "Bearer" ]
then
exit_fail "Expected Bearer token. Got: $TOKEN_TYPE"
fi
-ACCESS_TOKEN=`cat $LAST_RESPONSE | jq -r .access_token`
-EXPIRES_IN=`cat $LAST_RESPONSE | jq -r .expires_in`
+ACCESS_TOKEN=$(cat $LAST_RESPONSE | jq -r .access_token)
+EXPIRES_IN=$(cat $LAST_RESPONSE | jq -r .expires_in)
echo "OK"
echo -n "Requesting user information for client ..."
@@ -184,11 +184,11 @@ STATUS=$(curl "${BURL}/info" \
-w "%{http_code}" -s -o $LAST_RESPONSE)
if [ "$STATUS" != "200" ]
then
- exit_fail "Expected 200 OK. Got: $STATUS" `cat $LAST_RESPONSE`
+ exit_fail "Expected 200 OK. Got: $STATUS" $(cat $LAST_RESPONSE)
fi
-TADDRESS=`cat $LAST_RESPONSE | jq -r .address`
-TADDRESS_TYPE=`cat $LAST_RESPONSE | jq -r .address_type`
+TADDRESS=$(cat $LAST_RESPONSE | jq -r .address)
+TADDRESS_TYPE=$(cat $LAST_RESPONSE | jq -r .address_type)
if [ "$TADDRESS" != "$FILENAME" ]
then