Skip to content

feat: add webhook URL validation with configuration scheme allowlist - #208

Merged
Manuel1234477 merged 1 commit into
StellarGateLabs:mainfrom
ayomideaccess:fix/webhook-validation
Jul 25, 2026
Merged

feat: add webhook URL validation with configuration scheme allowlist#208
Manuel1234477 merged 1 commit into
StellarGateLabs:mainfrom
ayomideaccess:fix/webhook-validation

Conversation

@ayomideaccess

Copy link
Copy Markdown
Contributor

Closes issue #129

What

Adds validation for webhook_url in the payments module by:

  • Enforcing a maximum length of 2048 characters
  • Making the list of allowed URL schemes configurable through the ALLOWED_WEBHOOK_SCHEMES environment variable
  • Defaulting to https when the environment variable is not set

Why

The previous implementation used hardcoded URL scheme validation and did not enforce the maximum URL length required by the issue. This change makes the validation more flexible while ensuring the missing length constraint is applied.

How to Test

Run with both HTTP and HTTPS enabled:

ALLOWED_WEBHOOK_SCHEMES=https,http cargo run

Run without setting ALLOWED_WEBHOOK_SCHEMES to verify that only https URLs are accepted.

@Manuel1234477
Manuel1234477 merged commit 3b42e28 into StellarGateLabs:main Jul 25, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants