12 lines
627 B
Bash
12 lines
627 B
Bash
#!/bin/sh
|
|
set -eu
|
|
umask 077
|
|
check=$(mktemp -d /private/check.XXXXXX)
|
|
trap 'rm -rf "$check"' EXIT
|
|
printf 'Authorization: Bearer %s\n' "$(cat /run/sendico/access-token)" > "$check/header"
|
|
for path in "payments/fx/currencies/$SENDICO_ORGANIZATION_REF" "ledger_accounts/$SENDICO_ORGANIZATION_REF"; do
|
|
curl -fsS --max-time 15 -H "@$check/header" "http://127.0.0.1:18081/api/v1/$path" > "$check/response" 2>/dev/null || { echo 'Local Sendico authenticated API check failed' >&2; exit 1; }
|
|
jq -e '.status=="success"' "$check/response" >/dev/null
|
|
done
|
|
echo 'PASS: local Sendico authenticated currency and ledger APIs are accessible'
|