Skip to content

Bound checkout payment URL work - #268

Merged
ValeraFinebits merged 2 commits into
ValeraFinebits:masterfrom
chavic:hardening/payment-url-limits
Nov 25, 2026
Merged

ValeraFinebits merged 2 commits into
ValeraFinebits:masterfrom
chavic:hardening/payment-url-limits

Conversation

@chavic

@chavic chavic commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Rate-limit the public Payjoin checkout payment URL endpoint by remote address. Cap concurrent invoice work and the rate of new work. Concurrent requests for the same invoice share one operation.

Return HTTP 429 with a retry hint at capacity. Checkout can still retry transient failures and fall back to the regular Bitcoin payment URI.

@ValeraFinebits

Copy link
Copy Markdown
Owner

@chavic Could we also add a test to make sure the limit of 16 new operations per second kicks in and resets as expected?

Count new payment URL generations in fixed one-second windows read from
an injected TimeProvider, so a test can drive the window without sleeping.
The test fills the 16-start window, checks the next start is refused up to
the last tick of the window, and checks a full new window opens once it ends.
@ValeraFinebits
ValeraFinebits marked this pull request as ready for review November 25, 2026 20:42
@ValeraFinebits
ValeraFinebits merged commit c00ac91 into ValeraFinebits:master Nov 25, 2026
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