SPB Git

Repository Public

README.md 1.6 KB 26 lines markdown

1# demo-wallet — "Northbank Wallet"23A wallet where **raising the transfer limit requires a verified identity**. Python 3.10+, FastAPI,4server-rendered pages, Python SDK (async client) installed from `sdk/python`.56```bash7./setup.sh                    # uv venv, installs the SDK from the repository, provisions application + key + webhook8.venv/bin/python app.py       # http://localhost:88829```1011| Where | What |12|---|---|13| `app.py` → `limit_gate()` | the server-side gate (local record + live check, fail closed) |14| `app.py` → `raise_limit()` | the gated action; the request is saved before verification |15| `app.py` → `start_verification()` + `POST /verify/start` | session creation with `return_url`, then a 303 redirect to the hosted page |16| `app.py` → `GET /verify/return` | return page: the server looks the result up, nothing in the URL is trusted |17| `app.py` → `POST /webhooks/identity` | raw body, `Webhook.construct_event`, deduplication on `event.id` |18| `app.py` → `session_ended()` | `verification.cancelled` / `.expired`: the pending session is forgotten, a record still under review for it is closed, the user can start again |19| `app.py` → `GET /u/{handle}` | public badge and what it does and does not certify |2021Environment: `PORT`, `PUBLIC_URL`, `MLID_BASE_URL`, `MLID_SECRET_KEY`, `MLID_WEBHOOK_SECRET`,22`DEMO_STATE_FILE` (default `data/state.json`), `MLID_TIMEOUT`, `MLID_MAX_RETRIES`.2324Demo shortcuts that must not be copied: the login is an unsigned cookie, the database is a JSON file, and25`/api/debug/events` exposes the webhook log for the end-to-end script.26
Files main
Menu

Theme