diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-11-02 16:32:46 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-11-02 16:32:46 +0100 |
commit | 1acbbdec112eeaa7176b40764e13251d6f65ab04 (patch) | |
tree | bad354e2166048fd6f65c1b571715234cdbae037 /src/testing | |
parent | 4a775c6baacd14ce143155a063b0d3ba45a26f9e (diff) |
check for RFC 8959 prefix
Diffstat (limited to 'src/testing')
-rwxr-xr-x | src/testing/taler-unified-setup.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh index 85735fd1f..5e7748b7b 100755 --- a/src/testing/taler-unified-setup.sh +++ b/src/testing/taler-unified-setup.sh @@ -238,6 +238,7 @@ register_bank_account() { MAYBE_IBAN="${4:-}" if test -n "$MAYBE_IBAN"; then + # shellcheck disable=SC2001 ENAME=$(echo "$3" | sed -e "s/ /+/g") # Note: this assumes that $3 has no spaces. Should probably escape in the future.. PAYTO="payto://iban/SANDBOXX/${MAYBE_IBAN}?receiver-name=$ENAME" @@ -526,6 +527,13 @@ then then echo -n "Enabling Challenger client for $SECTION" CLIENT_SECRET=$(taler-config -c "$CONF" -s "$SECTION" -o "KYC_OAUTH2_CLIENT_SECRET") + RFC_8959_PREFIX="secret-token:" + if ! echo "${CLIENT_SECRET}" | grep ^${RFC_8959_PREFIX} > /dev/null + then + exit_fail "Client secret does not begin with ${RFC_8959_PREFIX}" + fi + # shellcheck disable=SC2001 + CLIENT_SECRET=$(echo "${CLIENT_SECRET}" | sed -e "s/^${RFC_8959_PREFIX}//") REDIRECT_URI="${EXCHANGE_URL}kyc-proof/kyc-provider-example-challeger" CLIENT_ID=$(challenger-admin --add="${CLIENT_SECRET}" --quiet "${REDIRECT_URI}") taler-config -c "$CONF" -s "$SECTION" -o KYC_OAUTH2_CLIENT_ID -V "$CLIENT_ID" |