fix(ack-pay): enforce payment request expiresAt - #158
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
WalkthroughPayment request token verification now validates ChangesPayment request expiry verification
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change adds enforcement for expired payment requests while preserving receipt verification behavior when expiry checks are disabled; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PaymentRequest.expiresAtis documented as the point after which a payment request becomes invalid, butverifyPaymentRequestTokenonly enforced the standard JWTexpclaim.Payment requests created through ACK-Pay carry
expiresAtin the JWT payload without anexpclaim, so a validly signed request with a pastexpiresAtwas still accepted by the default verification path.Fix: after parsing the payment request, reject it when
expiresAthas passed and expiry verification is enabled.verifyExpiry: falsecontinues to skip expiry checks, preserving the existing receipt-verification behavior where receipts may outlive the payment request.Tests: added regression coverage for past and future
expiresAtvalues,verifyExpiry: false, and verifying a receipt over an expired payment request.Changeset: added (
@agentcommercekit/ack-pay, patch).Related to #120, but non-overlapping: that PR validates and normalizes
expiresAtvalues at the schema level; this change enforces the parsed timestamp during verification.Verified locally:
@agentcommercekit/ack-paytests (38/38), package build,oxlint,oxfmt --check, andgit diff --check.AI usage disclosure (per AI_POLICY.md): this fix was developed with AI assistance (Codex - GPT 5.6 Sol). I reviewed the final diff and understand the change.
Summary by CodeRabbit