Created
June 13, 2024 13:22
-
-
Save rssnyder/15abe71d7f451f66a33bc0a0a02d13b8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fill in these values | |
API_KEY= | |
FLAG= | |
HOST=config.ff.harness.io | |
TARGET=foo | |
# Authenticate as a client SDK with target | |
AUTH_TOKEN=$(curl -X POST "https://$HOST/api/1.0/client/auth" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"apiKey\":\"$API_KEY\",\"target\":{\"identifier\":\"$TARGET\"}}" | jq -r '.authToken') | |
# Get Cluster ID and Env ID from request | |
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') | |
# Start stream | |
curl --trace-ascii - -N \ | |
-H "authorization: Bearer ${AUTH_TOKEN}" \ | |
-H "api-key: ${API_KEY}" \ | |
"https://$HOST/api/1.0/stream?cluster=$CLUSTER_ID" | |
# once stream is open, you can toggle a flag in the UI and you should see the payload printed in your terminal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment