From fd8b9504b844d72e61845d3123d5e71dad7aca3a Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Wed, 11 Dec 2024 12:25:10 +0000 Subject: [PATCH] Dynamically set s2s url for prod and non prod envs (#2008) Co-authored-by: Tom Elliott --- bin/utils/idam-lease-service-token.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/utils/idam-lease-service-token.sh b/bin/utils/idam-lease-service-token.sh index 4ca87d835a..0e103de527 100755 --- a/bin/utils/idam-lease-service-token.sh +++ b/bin/utils/idam-lease-service-token.sh @@ -5,8 +5,14 @@ set -eu microservice=${1} oneTimePassword=${2} +s2sUrl=${S2S_URL_BASE:-http://rpe-service-auth-provider-aat.service.core-compute-aat.internal}/testing-support/lease + +if [[ "${ENVIRONMENT}" == 'prod' ]]; then + s2sUrl=${S2S_URL_BASE:-http://rpe-service-auth-provider-aat.service.core-compute-aat.internal}/lease +fi + curl -v --insecure --fail --show-error --silent -X POST \ - ${S2S_URL_BASE:-http://rpe-service-auth-provider-aat.service.core-compute-aat.internal}/lease \ + ${s2sUrl} \ -H "Content-Type: application/json" \ -d '{ "microservice": "'${microservice}'",