From 7583d0896e66d1f9ca676c3e98bb77ce830fa600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A2ni=20Marques?= Date: Fri, 10 Jul 2026 15:43:00 +0200 Subject: [PATCH] bank: auto usernames goa-account- shown to user API and docs describe the visible auto username shape. --- configs/bank-landing/README.md | 3 ++- scripts/taler-bank/README.md | 2 +- scripts/taler-bank/demo-withdraw-api.py | 14 +++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/configs/bank-landing/README.md b/configs/bank-landing/README.md index d141a41..0f13452 100644 --- a/configs/bank-landing/README.md +++ b/configs/bank-landing/README.md @@ -49,7 +49,8 @@ In the optional fold: 3. Server registers a new libeufin user via public `POST /accounts`. 4. UI shows **username / password / balance GOA:0** once (“created for you”; not stored for recovery). -5. Username shape: **`goa-bank-acc-<16-hex>`**. +5. Username shape: **`goa-account-`** (shown to the user). + Password embeds **`pleasechangeme`** with random chars around it. 6. QR_Taler + link open `/webui/` so the user can log in with those credentials. Balance **starts at zero** — not the shared `explorer` pool. diff --git a/scripts/taler-bank/README.md b/scripts/taler-bank/README.md index e8f558d..df29e4b 100644 --- a/scripts/taler-bank/README.md +++ b/scripts/taler-bank/README.md @@ -42,7 +42,7 @@ Details + JSON schema: `configs/bank-landing/README.md`. | Path | Behaviour | |------|-----------| | `GET /demo-withdraw.json` | Mint one-shot withdraw from shared **`explorer`** pool; write `withdraw.uri` + watch ids | -| `GET /auto-account.json` | Public `POST /accounts` with generated **`goa-bank-acc-`** user + password; **balance GOA:0**; return credentials once | +| `GET /auto-account.json` | Public `POST /accounts` with generated **`goa-account-`** user + password containing **pleasechangeme**; **balance GOA:0**; return credentials once | Install / restart: diff --git a/scripts/taler-bank/demo-withdraw-api.py b/scripts/taler-bank/demo-withdraw-api.py index 8da7792..2b98c5c 100755 --- a/scripts/taler-bank/demo-withdraw-api.py +++ b/scripts/taler-bank/demo-withdraw-api.py @@ -124,8 +124,10 @@ def mint_withdraw() -> dict: def _rand_username() -> str: - # goa-bank-acc- — unique guest id, bank-safe [a-z0-9-] - return "goa-bank-acc-" + secrets.token_hex(8) + # Shown to the user: goa-account- (bank-safe [a-z0-9-]) + alphabet = string.ascii_lowercase + string.digits + rnd = "".join(secrets.choice(alphabet) for _ in range(12)) + return "goa-account-" + rnd def _rand_password() -> str: @@ -140,9 +142,8 @@ def create_personal_account() -> dict: """Public registration: auto username/password, balance starts at 0.""" username = _rand_username() password = _rand_password() - # short label from id suffix - suffix = username.rsplit("-", 1)[-1][:8] - name = "GOA bank acc " + suffix + # Display name mirrors username for webui clarity + name = username code, body = http_json( "POST", f"{BANK}/accounts", @@ -156,8 +157,7 @@ def create_personal_account() -> dict: # retry once on conflict if code in (409, 400): username = _rand_username() - suffix = username.rsplit("-", 1)[-1][:8] - name = "GOA bank acc " + suffix + name = username code, body = http_json( "POST", f"{BANK}/accounts",