Skip to content

Commit

Permalink
Use 'jq -r' instead of sed to remove quotes (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ligfx authored Aug 27, 2024
1 parent b128dad commit 676a158
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/networking/pages/aws-privatelink.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ EOF`
CLUSTER_ID=`curl -vv -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AUTH_TOKEN" \
-d "$CLUSTER_POST_BODY" $PUBLIC_API_ENDPOINT/v1beta2/clusters | jq .operation.metadata.cluster_id | sed 's/"//g'`
-d "$CLUSTER_POST_BODY" $PUBLIC_API_ENDPOINT/v1beta2/clusters | jq -r .operation.metadata.cluster_id`
echo $CLUSTER_ID
----
Expand Down
2 changes: 1 addition & 1 deletion modules/networking/pages/azure-private-link.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ EOF`
CLUSTER_ID=`curl -vv -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AUTH_TOKEN" \
-d "$CLUSTER_POST_BODY" $PUBLIC_API_ENDPOINT/v1beta2/clusters | jq .operation.metadata.cluster_id | sed 's/"//g'`
-d "$CLUSTER_POST_BODY" $PUBLIC_API_ENDPOINT/v1beta2/clusters | jq -r .operation.metadata.cluster_id`
echo $CLUSTER_ID
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export AUTH_TOKEN=`curl -s --request POST \
--data grant_type=client_credentials \
--data client_id="$CLOUD_CLIENT_ID" \
--data client_secret="$CLOUD_CLIENT_SECRET" \
--data audience=cloudv2-production.redpanda.cloud | jq .access_token | sed 's/"//g'`
--data audience=cloudv2-production.redpanda.cloud | jq -r .access_token`
----

You must send the API token in the `Authorization` header when making requests to the Cloud API.
2 changes: 1 addition & 1 deletion modules/security/pages/cloud-authentication.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ AUTH_TOKEN=`curl -s --request POST \
--data grant_type=client_credentials \
--data client_id=<client-id> \
--data client_secret=<client-secret> \
--data audience=cloudv2-production.redpanda.cloud | jq .access_token | sed 's/"//g'`
--data audience=cloudv2-production.redpanda.cloud | jq -r .access_token`
CLUSTER_PATCH_BODY=`cat << EOF
{
Expand Down

0 comments on commit 676a158

Please sign in to comment.