fix: strip taler:// default :443/:80 in bank mint consumers

Align demo-withdraw-api, goa-withdraw-ladder, refresh-demo-withdraw,
amount-ladder bench, and extreme tests with mon normalize rules so
libeufin host:443 never reaches wallets or QR payloads.
This commit is contained in:
Hernâni Marques 2026-07-19 15:38:34 +02:00
parent 947c72e595
commit dc94b30fed
No known key found for this signature in database
5 changed files with 51 additions and 12 deletions

View file

@ -38,8 +38,16 @@ URI=$(printf '%s' "$WD" | sed -n 's/.*"taler_withdraw_uri"[[:space:]]*:[[:space:
WID=$(printf '%s' "$WD" | sed -n 's/.*"withdrawal_id"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')
[ -n "$URI" ] || { echo "no URI from: $WD" >&2; exit 1; }
[ -n "$WID" ] || WID=$(basename "$URI")
# libeufin emits host:443 — strip default HTTPS port for wallet apps
URI=$(printf '%s' "$URI" | sed -E 's|(taler://withdraw/[^/:]+):443(/)|\1\2|; s|(taler://withdraw/[^/:]+):443$|\1|')
# libeufin emits host:443 — strip default HTTPS/HTTP ports for wallet apps
URI=$(printf '%s' "$URI" | python3 -c '
import re,sys
u=sys.stdin.read().strip()
u=re.sub(r"(taler://[A-Za-z0-9._-]+/)([^/?#:]+):443(?=/|$|\?|#)", r"\1\2", u, flags=re.I)
u=re.sub(r"(taler://[A-Za-z0-9._-]+/)([^/?#:]+):80(?=/|$|\?|#)", r"\1\2", u, flags=re.I)
for a,b in ((":443/","/"),(":443?","?"),(":80/","/"),(":80?","?")):
u=u.replace(a,b)
print(u)
')
mkdir -p "$LANDING_DIR"
printf '%s\n' "$URI" >"$LANDING_DIR/withdraw.uri"