1
0
Fork 0

shutdown uses jwt secrets

This commit is contained in:
Kaveh Vahedipour 2017-05-18 14:26:29 +02:00
parent e3cbd7fec1
commit bc06d14bb3
1 changed files with 9 additions and 1 deletions

View File

@ -22,12 +22,20 @@ else
PROT=http
fi
if [ -z "$JWT_SECRET" ];then
AUTHENTICATION="--server.authentication false"
AUTHORIZATION_HEADER=""
else
AUTHENTICATION="--server.jwt-secret $JWT_SECRET"
AUTHORIZATION_HEADER="Authorization: bearer $(jwtgen -a HS256 -s $JWT_SECRET -c 'iss=arangodb' -c 'server_id=setup')"
fi
echo $JWT_SECRET
shutdown() {
PORT=$1
echo -n "$PORT "
$CURL DELETE $PROT://$LOCALHOST:$PORT/_admin/shutdown >/dev/null 2>/dev/null
$CURL DELETE $PROT://$LOCALHOST:$PORT/_admin/shutdown -H "$AUTHORIZATION_HEADER" >/dev/null 2>/dev/null
}
if [ "$SECONDARIES" == "1" ]; then