Connect local SXCHNGE to the Sendico stand

This commit was merged in pull request #53.
This commit is contained in:
Stephan D committed 2026-10-16 10:19:59 +02:00
1 parent 34d8ef18d1
commit a5689876ff
14 files changed
+336 -9

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
#!/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'