-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathff-test.sh
More file actions
18 lines (13 loc) · 754 Bytes
/
ff-test.sh
File metadata and controls
18 lines (13 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# /bin/sh
PROXY_HOST=ff-proxy.k8s.rileysnyder.dev
PROXY_PATH=ff-proxy
TARGET=proxytest
API_KEY=b89d7f72-547f-49df-b8a4-70a24efd2171dddd
# Authenticate as Client SDK with target
AUTH_TOKEN=$(curl -s -X POST "https://$PROXY_HOST/$PROXY_PATH/client/auth" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"apiKey\":\"$API_KEY\",\"target\":{\"identifier\":\"$TARGET\"}}" | jq -r '.authToken')
# Get custer id and env id from the token
CLUSTER_ID=$(echo $AUTH_TOKEN | jq -R 'split(".") | .[1] | @base64d | fromjson' | jq -r '.clusterIdentifier')
ENV_ID=$(echo $AUTH_TOKEN | jq -R 'split(".") | .[1] | @base64d | fromjson' | jq -r '.environment')
echo "auth token: $AUTH_TOKEN"
echo "cluster id: $CLUSTER_ID"
echo "env id: $ENV_ID"