use variable for client subject

This commit is contained in:
AJ ONeal 2020-07-29 10:26:15 -06:00
parent ec0c7ff696
commit be242e98de
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ set -u
source .env source .env
TUNNEL_RELAY_API="${TUNNEL_RELAY_API:-"https://devices.example.com/api"}" TUNNEL_RELAY_API="${TUNNEL_RELAY_API:-"https://devices.example.com/api"}"
CLIENT_SUBJECT="${CLIENT_SUBJECT:-"newbie"}"
echo "RELAY_SECRET: $RELAY_SECRET" echo "RELAY_SECRET: $RELAY_SECRET"
TOKEN=$(go run cmd/signjwt/*.go \ TOKEN=$(go run cmd/signjwt/*.go \
@ -15,5 +16,5 @@ TOKEN=$(go run cmd/signjwt/*.go \
echo "ADMIN TOKEN: '$TOKEN'" echo "ADMIN TOKEN: '$TOKEN'"
echo "Auth URL: $TUNNEL_RELAY_API" echo "Auth URL: $TUNNEL_RELAY_API"
curl -X DELETE "$TUNNEL_RELAY_API/subscribers/ruby" -H "Authorization: Bearer ${TOKEN}" curl -X DELETE "$TUNNEL_RELAY_API/subscribers/${CLIENT_SUBJECT}" -H "Authorization: Bearer ${TOKEN}"
echo "" echo ""