[TON-372] Multitenant webhooks#195
Conversation
…moving the old handler. Update main application to utilize the new service for wallet webhooks. Clean up configuration by removing unused WebhookURL variable.
📊 Performance MetricsPerformance Metrics (memory storage)
|
…e management. Update various webhook-related functions to handle errors gracefully and improve code clarity by using underscore for ignored return values.
📊 Performance MetricsPerformance Metrics (postgres storage)
|
📊 Performance MetricsPerformance Metrics (cluster-valkey storage)
|
… of response body with error handling.
…ook tests - Added `WALLET_LIST_URL` and `WALLET_LIST_REFRESH_INTERVAL` to `docker-compose.dnsmasq.yml` and `docker-compose.nginx.yml` for wallet integration. - Refactored webhook tests to utilize a shared mock server and improved handling of webhook readiness and record management.
- Changed `WALLET_LIST_URL` from `http://bridge-gointegration:9091/wallets` to `http://gointegration:9091/wallets` across multiple Docker Compose files for consistency. - Updated `WEBHOOK_MOCK_HOST` from `bridge-gointegration` to `gointegration` in relevant services to reflect the new configuration.
📊 Performance MetricsPerformance Metrics (nginx storage)
|
📊 Performance MetricsPerformance Metrics (dnsmasq storage)
|
- Replaced the previous WALLET_LIST_URL and WALLET_LIST_REFRESH_INTERVAL with a new WEBHOOK_CONFIG environment variable for per-wallet webhook settings. - Updated the main application and webhook service to utilize the new configuration format, allowing for individual wallet URLs and optional authentication tokens. - Adjusted Docker Compose files and documentation to reflect these changes, ensuring consistency across services.
…on token - Modified the WEBHOOK_CONFIG environment variable across multiple Docker Compose files to include an authentication token for the test wallet. - Updated related tests to validate the presence of the authorization header in webhook requests.
… and improve readability.
…onfiguration - Updated the webhook service to allow configuration from both inline JSON and an optional file/URL source. - Introduced a refresh mechanism for source-backed configurations, ensuring updates are applied periodically. - Enhanced documentation to reflect the new configuration options and their usage. - Added tests to validate loading and merging of webhook configurations from different sources.
…or notifications - Modified the webhook service to ensure that notifications are only sent when both `wallet` and `topic` query parameters are present. - Updated related documentation to clarify the new requirement for webhook payloads. - Refactored tests to validate the behavior when the `topic` parameter is omitted, ensuring no notifications are sent in such cases.
Why this can't be deployed as-isThe multitenant wallet-webhook feature is functionally complete, but it can't ship until the SDK is updated. Webhook duplication — needs an SDK update firstThe webhook fires once per Because the SDK can connect to two different bridges at once, a single logical send produces two POSTs → two webhook deliveries |
Summary
This PR adds multitenant wallet webhooks with support for dynamic config loading and periodic refresh.