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

@ -43,24 +43,36 @@ def public_webui_url() -> str:
def normalize_taler_withdraw_uri(uri: str) -> str:
"""Strip default :443/:80 from taler://withdraw host (wallet base-URL fix).
"""Strip default :443/:80 from any taler:// authority (wallet base-URL fix).
libeufin builds authority from https BASE_URL and includes port 443; Android /
iOS wallets then fail host parsing or TLS. Path and id stay unchanged.
Applies to withdraw, pay, pay-template, etc.
"""
if not uri:
return uri
# taler://withdraw/bank.example:443/taler-integration/UUID
# taler://SCHEME/host:443/... or :80
uri = re.sub(
r"(taler://withdraw/)([^/?#]+):443(?=/|$)",
r"(taler://[A-Za-z0-9._-]+/)([^/?#:]+):443(?=/|$|\?|#)",
r"\1\2",
uri,
flags=re.I,
)
uri = re.sub(
r"(taler://withdraw/)([^/?#]+):80(?=/|$)",
r"(taler://[A-Za-z0-9._-]+/)([^/?#:]+):80(?=/|$|\?|#)",
r"\1\2",
uri,
flags=re.I,
)
for a, b in (
(":443/", "/"),
(":443?", "?"),
(":443#", "#"),
(":80/", "/"),
(":80?", "?"),
(":80#", "#"),
):
uri = uri.replace(a, b)
return uri
def load_pass() -> str: