fix(api): enforce HTTPS webhook URLs in production - #164
Merged
Manuel1234477 merged 1 commit intoJul 20, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request addresses the security requirement of enforcing HTTPS schemes for webhook URLs on public deployments (mainnet). Insecure HTTP schemes remain allowed under testnet and local development environments to preserve developer experience.
What Changed
webhook_urlusingreqwest::Url::parsefor structural validation. Enforceshttpsscheme when the configuration network is"public". Permissivehttpandhttpsschemes are allowed otherwise.test_reject_bad_webhook_urlwith 5 integration tests (test_webhook_url_https_accepted_on_testnet,test_webhook_url_http_accepted_on_testnet,test_webhook_url_http_rejected_on_public_network,test_webhook_url_https_accepted_on_public_network, andtest_webhook_url_invalid_rejected).Why the Change Was Necessary
In public production networks, sending webhooks over insecure HTTP exposes sensitive gateway payload data—such as merchant IDs, payment amounts, and transaction hashes—to interception and man-in-the-middle modifications. Enforcing HTTPS protects transport-layer privacy.
Security Impact
Prevents merchants from configuring insecure webhook destinations in production deployments, protecting payment settlement notifications against eavesdropping and injection attacks.
Testing Performed
publicandtestnetnetwork configurations.cargo test,cargo fmt -- --check, andcargo clippy --all-targets --all-features -- -D warnings). All checks passed with zero errors or warnings.Checklist for Reviewers
panic()or unsafe unwrap statements.reqwest::Url).closes #69