How rcbtst/payment-webhook-test-app works
This is a Sanic API for user and account administration, bearer-token authentication, and signed transaction webhooks. Users sign up or log in to receive JWTs; authenticated users can inspect their profile, accounts, and transactions, while admins manage users. A signed webhook creates or finds an account, records an idempotent transaction, and updates its balance. The graph follows calls visible in the excerpts and module references in the source index; startup wiring and migration details are not expanded.
Main entry points: services/auth.py Token and signature checks · v1/auth.py Login and signup · users.py User administration · crud.py Database operations
Components 15
API routes
- Login and signup
src/rest_api/routes/v1/auth.py - Profile and activity
src/rest_api/routes/v1/me.py - User administration
src/rest_api/routes/v1/users.py - Transaction webhook
src/rest_api/routes/v1/webhooks.py
Authentication
- Token and signature checks
src/rest_api/services/auth.py - JWT handling
src/utils/jwt.py - Password hashing
src/utils/passwords.py - Signature utility
src/utils/signature.py
Persistence
- Database operations
src/database/crud.py - User account transaction schema
src/database/schema.py
Contracts and configuration
- Authentication contracts
src/rest_api/models/auth.py - User contracts
src/rest_api/models/user.py - Webhook contract
src/rest_api/models/webhooks.py - Runtime settings
src/config.py
Other components
- API client
Connections 24
- API client → Login and signup: requests
src/rest_api/routes/v1/auth.py - API client → Profile and activity: requests
src/rest_api/routes/v1/me.py - API client → User administration: requests
src/rest_api/routes/v1/users.py - API client → Transaction webhook: posts transaction
src/rest_api/routes/v1/webhooks.py - Login and signup → Database operations: reads and writes users
src/rest_api/routes/v1/auth.py - Login and signup → Password hashing: hashes and verifies
src/rest_api/routes/v1/auth.py - Login and signup → JWT handling: creates tokens
src/rest_api/routes/v1/auth.py - Login and signup → Authentication contracts: validates and returns
src/rest_api/routes/v1/auth.py - Profile and activity → Token and signature checks: checks scopes
src/rest_api/routes/v1/me.py - Profile and activity → Database operations: reads profile and activity
src/rest_api/routes/v1/me.py - Profile and activity → User contracts: returns
src/rest_api/routes/v1/me.py - User administration → Token and signature checks: checks admin scope
src/rest_api/routes/v1/users.py - User administration → Database operations: manages users
src/rest_api/routes/v1/users.py - User administration → Password hashing: hashes passwords
src/rest_api/routes/v1/users.py - User administration → User contracts: validates and returns
src/rest_api/routes/v1/users.py - Transaction webhook → Token and signature checks: checks signature
src/rest_api/routes/v1/webhooks.py - Transaction webhook → Database operations: processes transaction
src/rest_api/routes/v1/webhooks.py - Transaction webhook → Webhook contract: validates request
src/rest_api/routes/v1/webhooks.py - Token and signature checks → JWT handling: decodes tokens
src/rest_api/services/auth.py - Token and signature checks → Signature utility: verifies signatures
src/rest_api/services/auth.py - Token and signature checks → Authentication contracts: parses token payload
src/rest_api/services/auth.py - Database operations → User account transaction schema: queries and updates
src/database/crud.py - JWT handling → Runtime settings: uses token settings
src/utils/jwt.py - Signature utility → Runtime settings: uses webhook secret
src/utils/signature.py