Repository navigation
fix(webhooks): enforce retry limits, scope tenancy ownership, and align legacy auth - #949
Open
mopxam-art wants to merge 1 commit into
Open
mopxam-art wants to merge 1 commit into
mopxam-art wants to merge 1 commit into
Conversation
…gn legacy auth Enforce strict validation and bounding for max_retries (0..10) and retry_delay_ms (100..60000 ms), rejecting invalid or out-of-range configurations with HTTP 400. Attach tenant owner context to registered webhooks to ensure isolation across list, retrieval, and deletion operations. Mount requestSigning middleware on legacy webhooks endpoint for parity with v1. Closes Heliobond#886 Payout: USDC (EVM / Base / Arbitrum / ERC20): 0x387c064ccf729a4846b62e95dc6b70e4d4c41e73
This branch has not been deployed
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.
Why
The webhook management endpoint allowed unbounded values for
max_retriesandretry_delay_ms, which could lead to resource exhaustion or prolonged delivery backlogs. In addition, webhook configurations lacked tenant ownership isolation, allowing callers to list, inspect, or delete webhooks configured by other tenants. Lastly, the legacy/api/webhooksmount was missing therequestSigningmiddleware present in other secure endpoints.What
max_retriesis capped at0..10, andretry_delay_msis bounded to100..60000ms, rejecting non-integer or out-of-range values with HTTP 400.extractWebhookOwner, extracting consumer identity from request headers (x-consumer-name,x-consumer-id,x-tenant-id), body, query params, or falling back to"default".listWebhooks(owner),getWebhook(id, owner), andremoveWebhook(id, owner)to ensure complete tenant isolation (unowned accesses return 404).requestSigningmiddleware to the legacyapp.use("/api/webhooks", ipWhitelist, adminLimiter, requestSigning, webhooksRouter)mount insrc/index.ts.src/__tests__/webhooks-bounds-and-tenancy.test.ts).Verified
src/__tests__/webhooks-bounds-and-tenancy.test.tspass cleanly.src/__tests__/webhooks.test.tspasses cleanly (13/13).npx tsc --noEmit).npm run lint).npm run build).Closes #886